Ticket #1192 (closed defect: wontfix)

Opened 4 years ago

Last modified 4 years ago

GLib-CRITICAL **: g_timeout_add_full: assertion `function != NULL' failed

Reported by: guest Owned by: somebody
Priority: minor Milestone:
Component: general (Gtk+, Glib) Version: 0.11.0
Keywords: callback Cc: mikolaj.konarski@…, gtk2hs-bug-tracker@…


PowerPC Linux, ghc6_6.12.1-13 with Debian patches. Tested with different GTK versions and with gtk2hs from hackage, tarball and the newest from darcs. A lot of haskell code runs OK, including most gtk demos. The problem may be in FFI implementation in GHC for PowerPC, but it may be in gtk, too, since I don't get any similar error when compiling GHC itself, gtk2hs and any Haskell apps that don't use gtk. I'm ready to debug, as instructed.

When I run the cairo clock demo (and many other gtk applications that depend on g_timeout_add_full) I get:

mikolaj@bratek:~/Desktop/gtknew/gtk2hs/gtk2hs/cairo/demo$ ./clock (clock:1521): GLib-CRITICAL **: g_timeout_add_full: assertion `function != NULL' failed

And the clock is shown but does not run. Other applications that show this assertion sometimes run, but e.g. reacting to many key-presses at once after a delay and then freezing again.

Change History

Changed 4 years ago by guest

  • priority changed from normal to minor

I was trying to debug a little, but it's hard since neither -funregisterised not -fvia-C GHC options work on my 7447A CPU (probably they are not supported on powerpc at all, with it's multitude of instruction set variants, but there is no informative message --- they just fail).

The best backtrace I could get is below. If I commpile without "-debug" I get another backtrace, from the GLib-CRITICAL assertion, but it does not mention illegal instructions. I suspect gtk2hs' fault in all this is minor, if any, so I decrease the bug's priority. Probably GHC does not cope with powerpc instruction set variants well. If I read GHC code right, it may be due to hardcoding C calling conventions in assembler, instead of using GCC or piggybacking on something else. I will ask somebody who knows these issues and close the bug report, if the GHC hypothesis is confirmed.

mikolaj@bratek:~/Desktop/gtknew/gtk2hs/gtk2hs/cairo/demo$ ghc -O0 -debug -dcore-lint --make Clock.hs -o clock
[1 of 1] Compiling Main             ( Clock.hs, Clock.o )
Linking clock ...
mikolaj@bratek:~/Desktop/gtknew/gtk2hs/gtk2hs/cairo/demo$ gdb clock
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /home/mikolaj/Desktop/gtknew/gtk2hs/gtk2hs/cairo/demo/clock...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/mikolaj/Desktop/gtknew/gtk2hs/gtk2hs/cairo/demo/clock 
[Thread debugging using libthread_db enabled]

Program received signal SIGILL, Illegal instruction.
0xbfffcda4 in ?? ()
(gdb) bt
#0  0xbfffcda4 in ?? ()
#1  0x0f3e0260 in g_timeout_dispatch (source=0x1084c620, callback=0xbfffcda0, user_data=0xbfffcda0) at /build/buildd/glib2.0-2.24.1/glib/gmain.c:3396
#2  0x0f3df940 in g_main_dispatch (context=0x10828c80) at /build/buildd/glib2.0-2.24.1/glib/gmain.c:1960
#3  IA__g_main_context_dispatch (context=0x10828c80) at /build/buildd/glib2.0-2.24.1/glib/gmain.c:2513
#4  0x0f3e4628 in g_main_context_iterate (context=0x10828c80, block=1, dispatch=1, self=<value optimized out>) at /build/buildd/glib2.0-2.24.1/glib/gmain.c:2591
#5  0x0f3e4c44 in IA__g_main_loop_run (loop=0x10858818) at /build/buildd/glib2.0-2.24.1/glib/gmain.c:2799
#6  0x0fcae664 in IA__gtk_main () at /build/buildd/gtk+2.0-2.20.1/gtk/gtkmain.c:1219
#7  0x10398684 in gtkzm0zi11zi0_GraphicsziUIziGtkziGeneralziGeneral_mainGUI_info ()
#8  0x106bfb28 in schedule ()
#9  0x106c17fc in scheduleWaitThread ()
#10 0x106bb3c4 in rts_evalLazyIO ()
#11 0x106bda10 in real_main ()
#12 0x106bdb8c in hs_main ()
#13 0x10042d50 in main ()

Changed 4 years ago by guest

  • cc gtk2hs-bug-tracker@… added
  • keywords callback added
  • milestone 0.11.0 deleted

This callback segfault problem is already diagnosed here: http://hackage.haskell.org/trac/ghc/ticket/3971. There is a very small example unrelated to gtk that triggers it. I've confirmed it persists even with "fvia-C -funregisterised" options one (some) powerpcs. It's not very likely to be fixed soon. Please feel free to close the bug report (all traffic under this ticket is from the original submitter: me).

Changed 4 years ago by axel

  • status changed from new to closed
  • resolution set to wontfix

Ok. That's sad. But if there is no workaround then there's little we can do.

Note: See TracTickets for help on using tickets.