VOGONS

Common searches


First post, by etil

User metadata
Rank Newbie
Rank
Newbie

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.

Attachments

  • Filename
    win_con.diff
    File size
    922 Bytes
    Downloads
    120 downloads
    File license
    Fair use/fair dealing exception

Reply 1 of 1, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

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

How To Ask Questions The Smart Way
Make your games work offline