App Bombs in CMD Window but Not in Msys

Submitted by Anonymous
on July 26, 2008 - 12:36pm

Hello. For some reason my app runs just flawlessly in the msys window but from a windows cmd window I get this:

timecodecalc.exe has encountered a problem and needs to close. We are sorry for the inconvenience.

I tried a static compile but got the same result.

App Bombs in CMD Window but Not in Msys

The Lightning Stalker (not verified)
on
July 26, 2008 - 12:49pm

Also, I just noticed that if I run it by double clicking on the exe that it runs just fine. I don't seem to remember this happening before.

Thank you,
Robert

environment

strcmp
on
July 26, 2008 - 1:17pm

have you checked the environment variables? too many, too few, overwriting something important, %PATH% or something else not pointing to a library directory? does it work as a different user (i.e. the one (administrator?) who installed msys)? is something in the windows application event log?

Re: environment

Anonymous (not verified)
on
July 26, 2008 - 2:03pm

Ahh, thanks for the quick reply. I did manage to trace it down a little bit. It bombs when it calls strcpy in msvcrt.dll The event log says

Faulting application timecodecalc.exe, version 0.0.0.0, faulting module msvcrt.dll, version 7.0.2600.2180, fault address 0x000360ad.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

versions

strcmp
on
July 27, 2008 - 10:36am

are there different versions of msvcrt.dll lying around one working, one crashing? iirc dlls are at least searched for in the the application directory and in the %PATH%, what about the current directory and %WINDIR% and its subdirectories (e.g. %WINDIR%\system32)? are more environment variables involved and how are these variables set in which situation? why does your program use the msvcrt.dll implementation of strcpy at all, when you talk about msys i would assume it to use glibc?

Re: environment

The Lightning Stalker (not verified)
on
July 26, 2008 - 2:29pm

Well, I just ran it in a debugger and it works fine. It only seems to bomb when it's called from a command window. Very strange.

Re: environment

Anonymous (not verified)
on
July 26, 2008 - 2:52pm

This is starting to look more like a windows problem than a programming problem.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.