DosBox console window crashing

Here you can discuss the development of patches.

DosBox console window crashing

Postby etil » 2007-5-08 @ 12:49

If the user closes the console window pressing ctrl-break or clicking the 'X' on the upper right corner dosbox crashes: dosbox.exe caused an Access Violation at location 6813fe30 in module SDL.dll Reading from location 127cf100. But dosbox exits normally when the console is closed pressing ctrl-c.

Sdl sets handlers for SIGINT and SIGTERM signals. The handlers push an SDL_QuitEvent in the event queue and the application can normally exit. When the user presses ctrl-c the run-time generates SIGINT signal and dosbox exits without crash. But signals are not generated if other events occur (ctrl-break, clicking the 'X', logging off, shutting down) and the default event handler causes dosbox to crash. I don't know the reason of the crash. I guess dosbox is terminated without calling SDL_Quit().

An application should install an handler function with the SetConsoleCtrlHandler winapi function and can handle the console events. Or sets handler for SIGBREAK signal and the run-time generates SIGBREAK when an console event occurs (excepting ctrl-c).

I have attached a small patch. It should avoid crashing.
You do not have the required permissions to view the files attached to this post.
etil
Newbie
 
Posts: 17
Joined: 2007-2-15 @ 15:15

Re: DosBox console window crashing

Postby DosFreak » 2007-7-28 @ 02:04

Closing the console with the "X" always crashes DosBox in Windows XP no matter how DosBox is started.

May not have been the same behavior in earlier DosBox builds but do not have information on which ones. Seems this problem has been around a long time.


Added to CVS
Game Acronym List
DosBox CVS Builds
DosBox Feature Request Thread
DosBox FAQ
PC Game Compatibility List
"Who's got time to read all the way down to the bottom of an email?"
User avatar
DosFreak
l33t++
 
Posts: 9543
Joined: 2002-6-30 @ 16:35
Location: Your Head


Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest