VOGONS


First post, by junglemontana

User metadata
Rank Newbie
Rank
Newbie

I found a freeze/crash problem with the original Grand Theft Auto.

When playing, video mode set to 640x480x32, press F11 and choose video mode 800x600x32. Dosbox freezes and audio starts looping. Choosing certain other video modes may also result in a freeze, or sometimes distorted aspect ratio.

If normal core is used, with 64-bit or 32-bit Dosbox, a bunch of messages like "Illegal read from 1018afab, CS:IP 2e0:1018afaa" appears in the console. See attachment. Dosbox can be terminated with Ctrl+C.

If dynamic core is used with 64-bit Dosbox, a core dump is generated when Dosbox is terminated by Ctrl+C. Sometimes Dosbox crashes by itself and core is dumped. I examined one core dump using coredumpctl, please see the attachment.

If dynamic core and 32-bit Dosbox are used, no core dump is generated and no messages seem to appear.

System is Arch Linux, 64-bit. Dosbox is SVN rev. 4252. I used openglnb as video output. Please let me know if there's any other information I should provide.

Attachments

  • Filename
    dosbox_gta1_crash_64_dynamic.txt
    File size
    6.82 KiB
    Downloads
    12 downloads
    File comment
    coredumpctl results when dynamic core was used
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox_gta1_crash_64_normal.txt
    File size
    50.78 KiB
    Downloads
    11 downloads
    File comment
    Console output when normal core is used
    File license
    Fair use/fair dealing exception

Reply 1 of 10, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The line mentioned in the crash is probably a corrupt event after switching the videomode. Not really sure what is happening.
Does it always crash at the same line ?

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 10, by junglemontana

User metadata
Rank Newbie
Rank
Newbie
Qbix wrote:

The line mentioned in the crash is probably a corrupt event after switching the videomode. Not really sure what is happening.
Does it always crash at the same line ?

Do you mean this:

Illegal read from 1018afab, CS:IP 2e0:1018afaa

I think it's always the same... I repeated this 3 times, once with 32-bit Dosbox, twice with 64-bit Dosbox, with normal core, and the console output was always the same.

I tried this again with 64-bit Dosbox and dynamic core and this time it crashed by itself. I saw this in the console:

terminate called after throwing an instance of 'char*'
Aborted (core dumped)

coredumpctl/GDB output is in attachment.

Attachments

  • Filename
    dosbox_gta1_crash_64_dynamic_2.txt
    File size
    6.51 KiB
    Downloads
    8 downloads
    File comment
    coredumpctl output, 64-bit Dosbox, r4252, dynamic core
    File license
    Fair use/fair dealing exception

Reply 3 of 10, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
junglemontana wrote:
I tried this again with 64-bit Dosbox and dynamic core and this time it crashed by itself. I saw this in the console: […]
Show full quote

I tried this again with 64-bit Dosbox and dynamic core and this time it crashed by itself. I saw this in the console:

terminate called after throwing an instance of 'char*'
Aborted (core dumped)

This is what happens when a function called from dynamic code throws an exception (unwinding doesn't work properly). Normally this means something has gone wrong and DOSBox was trying to show an error message before quitting (via E_Exit) - the "char*" that it mentions is the error message, but you miss out on seeing what it was unless you're lucky enough to have gdb attached at the time the exception is thrown.

Reply 4 of 10, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Ah wait, I was looking at the wrong line number. It does show up in throw(0); thought it was the HandleMousemotion line

Water flows down the stream
How to ask questions the smart way!

Reply 5 of 10, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

The "Illegal read from 1018afab, CS:IP 2e0:1018afaa" messages mean execution jumped to an invalid address/unmapped page so DOSBox would be fetching/translating 0xFF instead of valid opcodes.

Reply 6 of 10, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

If this is with GTA24.EXE (hi-color) then use GTA8.EXE (256 color) instead; the former is prone to crashing, and not the gameplay kind, which appears to be caused by flaws in the game code.

Reply 7 of 10, by junglemontana

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote:

If this is with GTA24.EXE (hi-color) then use GTA8.EXE (256 color) instead; the former is prone to crashing, and not the gameplay kind, which appears to be caused by flaws in the game code.

Yes, this is the high-color version.

I'm pretty sure I have occasionally managed to switch to 800x600x32 but I don't remember when exactly. It may have worked with 0.74-2 but I'm not completely sure. Or it may have just worked randomly.

I think the game may successfully use the new video mode if it doesn't crash when it's switched and the game is closed normally. But again, I'm not completely sure. I haven't yet found where the game saves the video mode information when it's closed.

Reply 8 of 10, by junglemontana

User metadata
Rank Newbie
Rank
Newbie

The low-color version works quite well but it doesn't seem to have an option to change the game resolution. It also has a very low in-game resolution.

It suffers from this problem as well, just like the high-color version: GTA1 - up arrow "stops" after a while

edit: I tried the GTA London 1969 expansion, and it doesn't seem to crash when switching the resolution. However, some resolutions still cause a distorted aspect ratio. Could this be related to the scaler setting?

Reply 9 of 10, by FulValBot

User metadata
Rank Newbie
Rank
Newbie

With 800x600 GTA1 freeze here too...

I don't know if is a problem of DOSBox 0.74 and all latest versions...

For that scaling problem i suggest to use a multiple of game resolution (for example: if your game use 640x480 try to use 1280x960 in DOSBox settings; for 320x200 games try with 1600x1000 if your have a 1080p display)

set also opengl (NOT openglnb), scaler=normal3x for 320x200 games and scaler=normal2x for 640x480 games

(for this you need also to use GPU scaling and use center scaling or no scaling; DON'T use display scaling)

Reply 10 of 10, by junglemontana

User metadata
Rank Newbie
Rank
Newbie

I tried the high color version (GTA24) in windowed mode, output set to surface, scaler set to none, windowresolution set to original and the aspect ratio problem still occurred so it's not apparently related to any scaling. It's either a bug in Dosbox or in the game. Probably in the game.

The game video mode is 640x480x32 when it's started, setting it to 640x400x16 results in a badly distorted aspect ratio. Also, after setting it to 640x400x16 (distorted), then back to 640x480x32 (normal), then 640x480x16 results in similar distortion. However, I managed to set 640x480x16 without distortion when I set it right after starting the game.

Setting video mode to 640x400x32 caused Dosbox to freeze with looping audio although no distortion occurred. No messages or core dump were generated this time.