Re: VGA emulation in BOCHS
David Laight <[email protected]>
| Newsgroups | gmane.comp.emulators.bochs.devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Oct 19, 2012 at 06:42:04PM +0200, Stanislav wrote: > > When you did it correctly, only the cpu0 thread increments the timer tick. > Then it checks if one of the timers has expired and if one did, it calls the > associated timer handler. The other cpus should never call the timer code. > The X11 gui code runs in the main thread and a timer call from the cpu0 > thread could make it crash. You should have a look at the wx code and it's > multi-threading implementation. The gui thread and the simulation thread use > an event queue for the thread-safe communication. I got this traceback a while ago: #0 0x00007f7fede06ce5 in ?? () from /usr/lib/libpthread.so.1 #1 0x00007f7fede070e8 in ?? () from /usr/lib/libpthread.so.1 #2 0x00007f7feda9e659 in ?? () from /usr/lib/libc.so.12 #3 0x00007f7feda9ea59 in malloc () from /usr/lib/libc.so.12 #4 0x00007f7fedad9854 in strdup () from /usr/lib/libc.so.12 #5 0x00007f7fedacf36b in __vfprintf_unlocked () from /usr/lib/libc.so.12 #6 0x00007f7fedac8e43 in sprintf () from /usr/lib/libc.so.12 #7 0x00007f7feb6052f6 in bx_x_gui_c::show_ips(unsigned int) () from /usr/pkg/lib/bochs/plugins/libbx_x.so #8 0x0000000000440351 in bx_signal_handler(int) () #9 <signal handler called> #10 0x00007f7fede07355 in pthread_mutex_lock () from /usr/lib/libpthread.so.1 #11 0x00007f7feda9d6ad in ?? () from /usr/lib/libc.so.12 #12 0x00007f7feda9f7f9 in free () from /usr/lib/libc.so.12 #13 0x00007f7ff164b643 in _XEventsQueued () from /usr/X11R7/lib/libX11.so.7 #14 0x00007f7ff1634dbc in XCopyPlane () from /usr/X11R7/lib/libX11.so.7 #15 0x00007f7feb6068c8 in bx_x_gui_c::text_update(unsigned char*, unsigned char*, unsigned long, unsigned long, bx_vga_tminfo_t) () from /usr/pkg/lib/bochs/plugins/libbx_x.so #16 0x00007f7fd6e0afbd in bx_vga_c::update() () from /usr/pkg/lib/bochs/plugins/libbx_vga.so #17 0x00007f7fd6e0cddd in bx_vga_c::timer_handler(void*) () from /usr/pkg/lib/bochs/plugins/libbx_vga.so #18 0x000000000045a373 in bx_virt_timer_c::periodic(unsigned long) () #19 0x000000000045ae2e in bx_virt_timer_c::timer_handler() () #20 0x0000000000451c8d in bx_pc_system_c::countdownEvent() () #21 0x000000000046c9db in BX_CPU_C::handleAsyncEvent() () #22 0x000000000046d50a in BX_CPU_C::cpu_loop() () #23 0x000000000045edcc in bx_dbg_continue_command () #24 0x00000000004642c6 in bxparse () #25 0x000000000045d241 in bx_dbg_user_input_loop() () #26 0x000000000045f0d8 in bx_dbg_main() () #27 0x000000000044229e in bx_begin_simulation(int, char**) () #28 0x00000000004d6972 in bx_config_interface(int) () #29 0x00000000004d6b80 in bx_config_interface(int) () #30 0x00000000004d6f75 in ci_callback(void*, ci_command_t) () #31 0x00000000004d1310 in bx_real_sim_c::configuration_interface(char const*, ci_command_t) () #32 0x0000000000441fd1 in bxmain() () #33 0x000000000043f282 in ___start () this deadlocked because sprintf() uses gtoa() (I think that is the name) in order to convert FP values - and that ends up in malloc() which isn't signal safe. However the code will also re-enter X from the signal handler (to display IPS) which is also not allowed. David -- David Laight: [email protected] ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct