Floating point exception in functions called from gtk_main_iteration_do



I have a clock application written using gtk and cairo in Fortran (via
gtk-fortran) that demonstrates many of the features of using gtk & cairo
from Fortran.  For historical reasons it uses a home-made event loop with a
poll for events and a wait.

Unfortunately now when using Gtk3.6 and building the fortran code with
Floating Point Exception checking (-ffpe-trap=invalid,zero,overflow) the
program fails with a floating point exception deep below the call to
gtk_main_iteration_do.

The gdb traceback is not very useful (I don't know how to get debugging
symbols in Arch Linux and derivatives).

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff6a0e012 in ?? () from /usr/lib/libgtk-3.so.0
(gdb) where
#0  0x00007ffff6a0e012 in ?? () from /usr/lib/libgtk-3.so.0
#1  0x00007ffff6a7af07 in ?? () from /usr/lib/libgtk-3.so.0
#2  0x00007ffff6a7dd91 in ?? () from /usr/lib/libgtk-3.so.0
#3  0x00007ffff6a36826 in gtk_render_background () from
/usr/lib/libgtk-3.so.0
#4  0x00007ffff6af2e0a in ?? () from /usr/lib/libgtk-3.so.0
#5  0x00007ffff69aaf3f in ?? () from /usr/lib/libgtk-3.so.0
#6  0x00007ffff6ad66de in ?? () from /usr/lib/libgtk-3.so.0
#7  0x00007ffff6edf467 in ?? () from /usr/lib/libgobject-2.0.so.0
#8  0x00007ffff6ef7e66 in g_signal_emit_valist () from
/usr/lib/libgobject-2.0.so.0
#9  0x00007ffff6ef86b2 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#10 0x00007ffff6ad9bbc in ?? () from /usr/lib/libgtk-3.so.0
#11 0x00007ffff6ae47b5 in gtk_widget_send_expose () from
/usr/lib/libgtk-3.so.0
#12 0x00007ffff69aad38 in gtk_main_do_event () from /usr/lib/libgtk-3.so.0
#13 0x00007ffff766ceb0 in ?? () from /usr/lib/libgdk-3.so.0
#14 0x00007ffff766c2e6 in ?? () from /usr/lib/libgdk-3.so.0
#15 0x00007ffff766c788 in gdk_window_process_all_updates () from
/usr/lib/libgdk-3.so.0
#16 0x00007ffff6915b94 in ?? () from /usr/lib/libgtk-3.so.0
#17 0x00007ffff764fdf0 in ?? () from /usr/lib/libgdk-3.so.0
#18 0x00007ffff7164845 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
#19 0x00007ffff7164b78 in ?? () from /usr/lib/libglib-2.0.so.0
#20 0x00007ffff7164c34 in g_main_context_iteration () from
/usr/lib/libglib-2.0.so.0
#21 0x00007ffff69a9f71 in gtk_main_iteration_do () from
/usr/lib/libgtk-3.so.0
#22 0x00000000004059c8 in cl_handlers::pending_events ()
    at /home/james/Dev/gtk-fortran-3/examples/hl_cairo_clock.f90:72
#23 0x0000000000405e70 in cairo_clock () at
/home/james/Dev/gtk-fortran-3/examples/hl_cairo_clock.f90:337
#24 0x0000000000406049 in main (argc=1, argv=0x7fffffffe82a)
    at /home/james/Dev/gtk-fortran-3/examples/hl_cairo_clock.f90:313
#25 0x00007ffff55cda15 in __libc_start_main () from /usr/lib/libc.so.6
#26 0x0000000000403db9 in _start ()
(gdb)

The program works fine if FPE trapping is not enabled, and it also works
fine even with FPE trapping on when using Gtk3.4 (Ubuntu 12.04) -- at least
until I move the cursor over the widget at which point it gives a SIGFPE
which is a known (and probably related) issue or with Gtk2.24 (Manjaro or
Ubuntu).

Does anybody have any idea how to diagnose this further?

James



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]