Hi,
I got some strange crashes when handling an exception coming from a
signal
handler. I was able to make a contrived example that triggers it
reliably
(on some of my systems)
valgrind shows the following:
==10757== Invalid read of size 8
==10757== at 0x5760FA0: g_signal_emit_valist (in
/usr/lib/libgobject-2.0.so.0.1000.2)
==10757== by 0x5761382: g_signal_emit (in
/usr/lib/libgobject-2.0.so.0.1000.2)
==10757== by 0x791E41B: gtk_adjustment_value_changed (in
/usr/lib/libgtk-x11-2.0.so.0.800.17)
==10757== by 0x7729936: (within
/usr/lib/ruby/1.8/x86_64-linux/gtk2.so)
==10757== by 0x4B530EB: (within /usr/lib/libruby1.8.so.1.8.4)
==10757== by 0x4B53540: (within /usr/lib/libruby1.8.so.1.8.4)
==10757== by 0x4B4F1F5: (within /usr/lib/libruby1.8.so.1.8.4)
==10757== by 0x4B51106: (within /usr/lib/libruby1.8.so.1.8.4)
==10757== by 0x4B5D5BA: (within /usr/lib/libruby1.8.so.1.8.4)
==10757== by 0x4B5D604: ruby_exec (in
/usr/lib/libruby1.8.so.1.8.4)
==10757== by 0x4B5F8A1: ruby_run (in
/usr/lib/libruby1.8.so.1.8.4)
==10757== by 0x4007B8: main (in /usr/bin/ruby1.8)
==10757== Address 0x7FEFFD438 is not stackâd, mallocâd or
(recently) freeâd
I digged somewhat deeper and it appears that the g_restart_emissions
in
glib2âs gsignal.c points to some memory thatâs no longer on the
stack :(⌠Probably because of some strange interaction between glibâs
signal
handling and ruby jumping to another (exception handling) contextâŚ
Sjoerd