I played a bit more with the Xlib error in GDB, and I now think I know
what's going wrong. Looking at the backtrace (see below), it seems
that the signal handler interrupts the VGA emulation during an
invocation of Xlib (resize window), and then tries to invoke another
Xlib function. Apparently, Xlib is not reentrant (I'm not surprised).
No wonder it didn't go wrong earlier, as replay_vga_io_log() was
invoked *before* the timer was activated.
I'm not quite sure how I should solve this... how does it work in
BOCHS ? Surely there, the same problem is encountered ?
-- Ramon
(gdb) bt
#0 fprintf (stream=0x40100ea0, format=0x40215720 "Xlib: unexpected
async reply (sequence 0x%lx)!\n") at fprintf.c:31
#1 0x401b530d in _XAsyncReply ()
#2 0x401b4026 in _XEventsQueued ()
#3 0x401a8988 in XPending ()
#4 0x40114aa5 in bx_gui_c::handle_events () at x.cc:717
#5 0x4011034d in bx_keyb_c::periodic (usec_delta=100) at
keyboard.cc:1062
#6 0x4010c879 in bx_devices_c::timer (this=0x4011d5e0) at
devices.cc:341
#7 0x4010c838 in bx_devices_c::timer_handler (this_ptr=0x4011d5e0) at
devices.cc:329
#8 0x4010bcf8 in bx_pc_system_c::timer_handler (this=0x4011d2a0) at
pc_system.cc:315
#9 0x4010b80e in timer_handler (i=14) at pc_system.h:133
#10 <signal handler called>
#11 0x4005c800 in ____strtold_l_internal (nptr=0x8056e88 "",
endptr=0x4021e698, group=0, loc=0x8056e88) at strtod.c:240
#12 0x401b4517 in _XRead ()
#13 0x401b4f29 in _XReply ()
#14 0x401a0ebe in XGetWindowProperty ()
#15 0x401bbd9c in XGetWMSizeHints ()
#16 0x401bbe8b in XGetWMNormalHints ()
#17 0x401159c8 in bx_gui_c::dimension_update (x=640, y=480)
at x.cc:1110
#18 0x4011205b in bx_vga_c::write (this=0x4013d900, address=969,
value=0, io_len=1, no_log=0) at vga.cc:955
#19 0x40111a22 in bx_vga_c::write_handler (this_ptr=0x4013d900,
address=969, value=0, io_len=1) at vga.cc:622
#20 0x4010cd20 in bx_devices_c::outp (this=0x4011d5e0, addr=969,
value=0, io_len=1) at devices.cc:551
#21 0x4010ba82 in bx_pc_system_c::outp (this=0x4011d2a0, addr=969,
value=0, io_len=1) at pc_system.cc:183
#22 0x4010b668 in bx_plex86_io (event=EVT_OUTPORT, data=969, op_size=1,
count=1, loc=0xbffff96c) at io.cc:136
#23 0x804ca49 in plugin_emulate_outport (data=969, op_size=1, count=1,
loc=0xbffff96c) at plugin.c:464
#24 0x804c919 in plugin_emulate (event=EVT_OUTPORT, data=969, op_size=1,
count=1, loc=0xbffff96c) at plugin.c:386
#25 0x8049ca0 in emulate () at emulation.c:102
#26 0x804a71f in vm_event_loop () at user.c:271
#27 0x8049b20 in main (argc=1, argv=0xbffffd04) at plex86.c:285
#28 0x40037ca7 in __libc_start_main (main=0x8049480 <main>, argc=1,
argv=0xbffffd04, init=0x804919c <_init>, fini=0x804cb6c <_fini>,
rtld_fini=0x40009c30 <_dl_fini>, stack_end=0xbffffcfc) at
../sysdeps/generic/libc-start.c:78
(gdb)