473,394 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

runtime error, help

I am working on converting a win32 console application from VC6 to VC7.

My version is Microsoft Development Environment 2003 version 7.1.3088.

The code works fine on VC6. it is a console program for scientific
computation, so it has nothing to do with MFC. But it needs some
other libraries such as MKL, sparselib, etc.

VC7 can build the executable successfully. However, when i run it,
there is only one line on the command window:

"runtime error Press any key to continue"

No other complain/information about it. This happens for both debug
and release versions.

----
I solved two problems before being stuck by this runtime error.

1. cl : Command line error D2004 : '/I' requires an argument
solve: manu -> project -> property pages -> C/C++ -> command lines
-> remove /I

2. Command line error D2016 : '/RTC1' and 'O2' command-line options
are incompatible.
solve: changing the AppName.vcproj file by replacing all BasicRuntime-
Checks="3" with BasicRuntimeChecks="0"

I left one warning unsolved:
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:
ICF' specification
I know I provided very limited information about the runtime error. But
that's
all i got. Any guide to solve this error is indeed appreiated !

Happy New Year!

Yuanlin

Dec 29 '05 #1
7 6931
Its a very basic question - where did it crash during the debugging
process ? Are you able to debug it successfully while it crashes only
running standalone ?
The /I is for include search path. As the code compiled, this can be
harmless (unless and until there is some configuration #defines which
were missed because of illegal directories)
If the compiler mentions a mismatch between /RTC1 and /O2 - then there
is very little you can do about it. You can stick with one of the
options. Also another thing you can try is turn off optimizations and
see if the app runs fine.
And the /EDITANDCONTINUE is fairly harmless.
I will suggest you running it under the debugger and also to turn of the
optimizations and see if things work fine.

yu**********@gmail.com wrote:
I am working on converting a win32 console application from VC6 to VC7.

My version is Microsoft Development Environment 2003 version 7.1.3088.

The code works fine on VC6. it is a console program for scientific
computation, so it has nothing to do with MFC. But it needs some
other libraries such as MKL, sparselib, etc.

VC7 can build the executable successfully. However, when i run it,
there is only one line on the command window:

"runtime error Press any key to continue"

No other complain/information about it. This happens for both debug
and release versions.

----
I solved two problems before being stuck by this runtime error.

1. cl : Command line error D2004 : '/I' requires an argument
solve: manu -> project -> property pages -> C/C++ -> command lines
-> remove /I

2. Command line error D2016 : '/RTC1' and 'O2' command-line options
are incompatible.
solve: changing the AppName.vcproj file by replacing all BasicRuntime-
Checks="3" with BasicRuntimeChecks="0"

I left one warning unsolved:
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:
ICF' specification
I know I provided very limited information about the runtime error. But
that's
all i got. Any guide to solve this error is indeed appreiated !

Happy New Year!

Yuanlin

Dec 29 '05 #2

If the application still terminates silently even when running under debugger,
set breakpoint at abort() and at ntdll!NtTerminateProcess functions.
When the breakpoint is hit, take a look at the call stack to find out who is trying
to terminate the application.

To set breakpoint at ntdll!NtTerminateProcess, use the following expression
in New Breakpoint dialog:

{,,ntdll.dll}_NtTerminateProcess@8

It will require symbols for ntdll.dll, you can use symbol server to download them:
http://msdn.microsoft.com/library/en...mbolServer.asp

Regards,
Oleg
[VC++ MVP http://www.debuginfo.com/]

Dec 29 '05 #3
Thanks, Gangadhar, Oleg,

Just as Oleg said, the program terminates silently when running under
debugger, even i set a breakpoint at very beginning of the code.

It gives out messages like this: (GPRS2P.exe is my app name)

'GPRS2P.exe': Loaded 'E:\MyWorkingDir\GPRS2P.exe', Symbols loaded.
'GPRS2P.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols
loaded.
'GPRS2P.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols
loaded.
'GPRS2P.exe': Loaded 'C:\WINDOWS\system32\mkl_support.dll', No symbols
loaded.
The program '[1540] GPRS2P.exe: Native' has exited with code 255
(0xff).

I followed the instruction of Oleg and setup a breakpoint for
{,,ntdll.dll}_NtTerminateProcess@8 (I think this is a function), and
set path as :symsrv*symsrv.dll*c:\localcache*http://msdl.microsoft.
com/download/symbols

However, it seems that the breakpoint is not hitted. I did not find
any downloaded file in folder c:\localcache. Program quits directly
and shows the same messages.

Yuanlin

Dec 29 '05 #4
btw: when i setup the breakpoint, I use "function" tab page,

Function: {,,ntdll.dll}_NtTerminateProcess@8
Line: 1
Character: I
Language: Unknown (if i choose C++, it complains that "IntelliSense
could not find the specified location" ).

Dec 29 '05 #5
so, the application dies even before it starts up. Are there any global,
static initializers (constructors) that do some sort of processing ?
Take a look at these initializers to see if there is something wrong
going on in there.
Also, when you run under the windbg, see if you can single step (even if
it is disassembly) and look for any jmp to invalid addresses.

yu**********@gmail.com wrote:
btw: when i setup the breakpoint, I use "function" tab page,

Function: {,,ntdll.dll}_NtTerminateProcess@8
Line: 1
Character: I
Language: Unknown (if i choose C++, it complains that "IntelliSense
could not find the specified location" ).

Dec 30 '05 #6
Just as Oleg said, the program terminates silently when running under
debugger, even i set a breakpoint at very beginning of the code.

It gives out messages like this: (GPRS2P.exe is my app name)

'GPRS2P.exe': Loaded 'E:\MyWorkingDir\GPRS2P.exe', Symbols loaded.
'GPRS2P.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols
loaded.
If everything is configured properly, the breakpoint should be hit even if NtTerminateProcess
is called e.g. from a constructor of a global object. The problem is that symbols for ntdll.dll
are not loaded, so probably there is something wrong with symbol server configuration.
'GPRS2P.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols
loaded.
'GPRS2P.exe': Loaded 'C:\WINDOWS\system32\mkl_support.dll', No symbols
loaded.
The program '[1540] GPRS2P.exe: Native' has exited with code 255
(0xff).

Additionally, this output shows that there is no unhandled exception, but someone
calls abort() or ExitProcess() on purpose.
I followed the instruction of Oleg and setup a breakpoint for
{,,ntdll.dll}_NtTerminateProcess@8 (I think this is a function), and
set path as :symsrv*symsrv.dll*c:\localcache*http://msdl.microsoft.
com/download/symbols


I would recommend to resolve the symbol server configuration problem,
then the breakpoint should be hit.

Try the following:

1. Download and install the latest Debugging Tools for Windows:
http://www.microsoft.com/whdc/ddk/de...g/default.mspx

2. Copy symsrv.dll from the installation directory of Debugging Tools
to <VSInstallDir>\Common7\IDE directory (overwrite the old symsrv.dll
if it exists there).

3. Set the following setting in your project settings:
Project properties | Configuration Properties | Debugging | Symbol Path
to the following:
srv*c:\localcache*http://msdl.microsoft.com/download/symbols
(alternatively, you can set _NT_SYMBOL_PATH environment variable
to the same value, then any project will pick up the symbol server path
after system restart).

4. Run the project again and see if symbols get loaded.

If this still does not help (symbols do not get loaded), you can check the following option
in VS settings:
Tools | Options | Debugging | Native | Load DLL exports
and change the expression used to set the breakpoint to the following:
{,,ntdll.dll}NtTerminateProcess

Then the breakpoint should hit even without symbols, though resulting call stack
can be worse than in the case with good symbols.

Oleg

Dec 30 '05 #7
I followed Oleg's elaborate instruction, and it works. The size of old
version of symsrv.dll is about 37k and the new one is 112k.

The breakpoint at _NtTerminateProcess@8 is hit and the call stack shows
below messages:
--------------------------------------------
ntdll.dll!_NtTerminateProcess@8()
kernel32.dll!__ExitProcess@4() + 0x37
kernel32.dll!7c81cab6()
GPRS2P.exe!__crtExitProcess(int status=255) Line 464 C
GPRS2P.exe!doexit(int code=255, int quick=1, int retcaller=0) Line 414
+ 0x9 C
GPRS2P.exe!_exit(int code=255) Line 311 + 0xd C
GPRS2P.exe!_amsg_exit(int rterrnum=589855) Line 321 + 0xb C
GPRS2P.exe!mainCRTStartup() Line 231 + 0x9 C
kernel32.dll!_BaseProcessStart@4() + 0x23
---------------------

By tracing the code, the problem is located at:
mainCRTStartup(){ ...
initret = _cinit(TRUE);
if (initret != 0)
_amsg_exit(initret);
...
}

By checking the whole program, I found the error comes from DFOR.LIB.
(My code needs the library, but I dont have digital fortran installed
on my mechine. So I insert the lib file explicitly in my project.)

There are two versions of DFOR.lib. The size of the one used to work
in VC6 is about 789k. It causes all the problem. After replacing it
with a new one (864k, however, I dont know which one is really "new"),
the problem works as good as it should be.

I would like to thank you guys for your kind help!

Happy New Year !

Yuanlin 1/1/2006

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Jan 1 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bob Bamberg | last post by:
Hello All, I have been trying without luck to get some information on debugging the Runtime Error R6025 - Pure Virtual Function Call. I am working in C++ and have only one class that is derived...
5
by: Nathan Bloom | last post by:
Hi, I have a secured database that runs fine on the computer the database is installed on. I have several workstations with access runtime installed that also need access to the database. ...
2
by: Paul | last post by:
I'm hoping someone can help me with the problem. I have a database where the default value for a date field in a table is =date() This works perfectly in my table and on my form. But when I...
4
by: Aliza Klein | last post by:
Apologies in advance as I am SURE this has been asked 100 times - but I haven't got a simple answer: I have MS Office XP Developer and have created an installation package (with the runtime) for...
24
by: ekz | last post by:
Hi guys I have a very weird bug and will welcome gracefully any help We developed ASP.Net application that run on production server, Net Framework 1.1 , IIS 6.0, the application is huge, having...
8
by: g_man | last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of a command button that closes the form. I have code in the Form_Error event that does a good job of providing a more meaningful...
3
by: enough2Bdangerous | last post by:
access runtime error 3011 on docmd.openreport -------------------------------------------------------------------------------- Access database (file format 2002-2003) generates reports with...
0
by: na | last post by:
After installing AJAX 1.0 RC on my Windows 2003 server, I run into the following errors when requesting an ASP.Net 2.0 page that transforms XML data with XSLT. The XML data is of size 5MB and the...
0
by: Anbu | last post by:
Hello All, I have developed an Win 32 application using .NET 2.0 Framework. This application uses the cassini dll provided by one of the Microsoft groups. While using this component, I'm getting...
1
by: BL3WC | last post by:
Hi, I'd created a MDE under Access 2003. It is now under testing stage. Some of the users will use Access 2003 runtime and some will use Access 2007 runtime to run this MDE. I installed the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.