VCCE / VCC

Tandy Color Computer 3 Emulator
GNU General Public License v3.0
64 stars 21 forks source link

Vcc random crash when booting Nitros9 #120

Closed ejaquay closed 10 months ago

ejaquay commented 1 year ago

If DOS is typed quickly immediately after VCC starts Nitros9 boot will sometimes crash Vcc with exit code -1073741819

ejaquay commented 1 year ago

I ran windbg to find where crash is happening. It is caused by an access violation in tcc1014graphics at line 9511:

From event viewer: Faulting module name: vcc.exe, version: 2.1.0.8, time stamp: 0x63cf2a5a Exception code: 0xc0000005 Fault offset: 0x00064e97 from windbg: 0:000> ln e20000
(00000000) vcc!__ImageBase
0:000> ln e84e97 <-- e20000 + 64e97 [c:\users\ed\vcc\vccsrc\tcc1014graphics.c @ 9511] (00e84e50)
vcc!DrawBottomBoarder32+0x47 | (00e84ee0) vcc!

9511 DTState->PTRsurface32[x + (2(DTState->LineCounter+LinesperScreen+VertCenter) DTState->SurfacePitch)]=BoarderColor32;

Probably the rapid resolution change just after Nitros9 boots is overflowing the PTRSurface32 array. Must be a race condition somewhere in resolution change. One patch is to range check the calculated index before using it but might need to protect DTState with a critical section if a race condition can be proven.

ejaquay commented 1 year ago

This is fixed pending release