I would like an explanation of the following problem, if at all possible.
For the last month, I have had each version of DOSBox (0.63+ cvs + special builds)
crash upon startup. At first, I believed that it was because of the SDL library,
but I rebuilt SDL.dll and tested it with several demo programs and they worked fine.
I built the debug version of DOSBox, but the program exited right after the curses
window appeared. I then decided to sprinkle sdlmain.cpp with MessageBox()
statements to trace each function call made during main(). The program was crashing
right after a call to control->ParseEnv(environ). Commenting the line out,
I recompiled and DOSBox started up immediately with no problems at all. Does anyone
have an explanation as to why that particular function call would cause a crash?
0
Dosbox Crash
Started by
Guest_Curt Hester_*
, Dec 19 2005 12:17 AM
3 replies to this topic
#1 Guest_Curt Hester_*
Posted 19 December 2005 - 12:17 AM
#2
Posted 19 December 2005 - 07:29 AM
I wouldn't mind knowing which operating sytem this is on.
Try determining the value of envirion (for example add this to
src/misc/setup.cpp (at line 337/338)
LOG_MSG("val of env pointer %X",envp);return; (or a message box)
(you might want to build dosbox without curses)
and if it works try
LOG_MSG("val of env pointer %X %X",envp,*envp); return;
And note down the values reported.
I notice that dosbox doesn't check for an empty/broken enverionment. (not sure if that is possible(the check is possible, but the empty env)). But maybe there is a linker error somewhere
Try determining the value of envirion (for example add this to
src/misc/setup.cpp (at line 337/338)
LOG_MSG("val of env pointer %X",envp);return; (or a message box)
(you might want to build dosbox without curses)
and if it works try
LOG_MSG("val of env pointer %X %X",envp,*envp); return;
And note down the values reported.
I notice that dosbox doesn't check for an empty/broken enverionment. (not sure if that is possible(the check is possible, but the empty env)). But maybe there is a linker error somewhere
#3 Guest_Curt Hester_*
Posted 20 December 2005 - 11:50 AM
OS: Windows XP Pro with Service Pack 2
Value of environ: 3AE2D58
Value of *environ: 3AE2E30
Value of environ: 3AE2D58
Value of *environ: 3AE2E30
#4
Posted 20 December 2005 - 07:59 PM
well try finding out your environment.
(in a cmd.exe type "set")
and compare it with the results dosbox posts when you use this patch in the cvs.
(remove that former LOG_MSG)
It seems dosbox chokes on your environment.
The values you posted showed that it existed. (else they would be null)
(in a cmd.exe type "set")
and compare it with the results dosbox posts when you use this patch in the cvs.
(remove that former LOG_MSG)
Index: src/gui/sdlmain.cpp =================================================================== RCS file: /cvsroot/dosbox/dosbox/src/gui/sdlmain.cpp,v retrieving revision 1.94 diff -u -r1.94 sdlmain.cpp --- src/gui/sdlmain.cpp 2 Dec 2005 10:02:03 -0000 1.94 +++ src/gui/sdlmain.cpp 20 Dec 2005 19:54:59 -0000 @@ -1056,7 +1056,7 @@ static bool no_stdout = false; void GFX_ShowMsg(char * format,...) { - char buf[512]; + char buf[2048]; va_list msg; va_start(msg,format); vsprintf(buf,format,msg); Index: src/misc/setup.cpp =================================================================== RCS file: /cvsroot/dosbox/dosbox/src/misc/setup.cpp,v retrieving revision 1.31 diff -u -r1.31 setup.cpp --- src/misc/setup.cpp 24 Jul 2005 19:04:11 -0000 1.31 +++ src/misc/setup.cpp 20 Dec 2005 19:55:13 -0000 @@ -338,6 +338,7 @@ for(char** env=envp; *env;env++) { char copy[1024]; safe_strncpy(copy,*env,1024); +LOG_MSG("env value %s",copy); if(strncasecmp(copy,"DOSBOX_",7)) continue; char* sec_name = ©[7];
It seems dosbox chokes on your environment.
The values you posted showed that it existed. (else they would be null)