bochs-emu / Bochs

Bochs - Cross Platform x86 Emulator Project
https://bochs.sourceforge.io/
GNU Lesser General Public License v2.1
875 stars 102 forks source link

Crash while resizing window in Windows 3.11 with CL-GD5446 driver #358

Closed Vort closed 2 weeks ago

Vort commented 2 weeks ago

When window is moved or resized in certain way in Windows 3.11 with CL-GD5446 video card, stack overflow happens.

To reproduce this problem:

  1. Switch to 640x480x8 resolution;
  2. Move Program Manager window to the bottom right corner of the screen, like so: bochs_cirrus_crash_part1
  3. Start enlarging this window by dragging its top left corner;
  4. When mouse cursor will be close to the top left corner of the screen, Bochs will crash: bochs_cirrus_crash_part2

Stack overflow happens here: https://github.com/bochs-emu/Bochs/blob/4a32e422309b087eb3a31b91eec3634fcc33174a/bochs/iodev/display/svga_cirrus.cc#L459-L461 when x0 = 0, width = 641 and svga_xres = 640.

Version: 4a32e422309b087eb3a31b91eec3634fcc33174a.

vruppert commented 2 weeks ago

I cannot reproduce this issue here, but this piece of code looks incorrect to me. I have added this code to fix issue #221, but it must fail with the input values you mentioned. I have now applied a more correct version.

Vort commented 2 weeks ago

No more crash with 85c58ff, thank you.

However, while slowly moving partially hidden window I noticed small glitches (dotted lines): bochs_cirrus_win_move