GNOME Bugzilla – Bug 386508
gnome-keyring-scan.c generated by gtk-doc seems wrong
Last modified: 2007-03-13 21:50:01 UTC
Please describe the problem: While compiling with --enable-gtk-doc (#376895 applied), I got a strange segv crash related to gnome_keyring_item_info_get_type incorrect call. Steps to reproduce: 1. configure --enable-gtk-doc 2. make reference 2a. gnome-keyring-scan is run and crash Actual results: gnome-keyring-scan.c:gnome_keyring_item_info_get_type(void) does not fit with gnome-keyring.c:gnome_keyring_item_info_get_type (GnomeKeyringItemInfo *item_info) Expected results: obvious Does this happen every time? yes Other information: GnomeKeyringInfoItem does not seem to follow strict gobject conventions...further investigation needed.
(gdb) r Starting program: /home/beta/svn/gnome2/gnome-keyring/reference/.libs/gnome-keyring-scan [Thread debugging using libthread_db enabled] [New Thread -1210893664 (LWP 21005)] Program received signal SIGSEGV, Segmentation fault.
+ Trace 100208
Thread NaN (LWP 21005)
Created attachment 79650 [details] [review] Remove gnome-keyring.h from gtkdoc-scan because the get_type function is not GObject type
I'm seeing something similar. Increasing severity because it breaks Gnome builds. make[2]: Entering directory `/opt/gnome-2-18/src/gnome-keyring/reference' gtk-doc: Scanning header files cd . && \ gtkdoc-scan --module=gnome-keyring --source-dir=.. --ignore-headers="aes_be.h aes.h aes_le.h beecrypt_compat.h config.h gnome-keyring-daemon.h gnome-keyring-private.h gnome-keyring-proto.h md5.h mkdtemp.h sha256.h " if grep -l '^..*$' ./gnome-keyring.types > /dev/null 2>&1 ; then \ CC="/bin/sh ../libtool --mode=compile gcc -I.. -I.. -I/opt/gnome-2-18/include/glib-2.0 -I/opt/gnome-2-18/lib/glib-2.0/include -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O2 -Wno-strict-aliasing -Wno-sign-compare" LD="/bin/sh ../libtool --mode=link gcc -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O2 -Wno-strict-aliasing -Wno-sign-compare " CFLAGS="" LDFLAGS="../libgnome-keyring.la -L/opt/gnome-2-18/lib -lgobject-2.0 -lglib-2.0 " gtkdoc-scangobj --type-init-func="g_type_init()" --module=gnome-keyring --output-dir=. ; \ else \ cd . ; \ for i in gnome-keyring.args gnome-keyring.hierarchy gnome-keyring.interfaces gnome-keyring.prerequisites gnome-keyring.signals ; do \ test -f $i || touch $i ; \ done \ fi gtk-doc: Compiling scanner gcc -I.. -I.. -I/opt/gnome-2-18/include/glib-2.0 -I/opt/gnome-2-18/lib/glib-2.0/include -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O2 -Wno-strict-aliasing -Wno-sign-compare -c gnome-keyring-scan.c -fPIC -DPIC -o .libs/gnome-keyring-scan.o gtk-doc: Linking scanner gcc -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O2 -Wno-strict-aliasing -Wno-sign-compare -o .libs/gnome-keyring-scan .libs/gnome-keyring-scan.o ../.libs/libgnome-keyring.so -L/opt/gnome-2-18/lib /opt/gnome-2-18/lib/libgobject-2.0.so /opt/gnome-2-18/lib/libglib-2.0.so -Wl,--rpath -Wl,/opt/gnome-2-18/lib creating gnome-keyring-scan gtk-doc: Running scanner gnome-keyring-scan Scan failed: make[2]: *** [scan-build.stamp] Error 255 make[2]: Leaving directory `/opt/gnome-2-18/src/gnome-keyring/reference' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/opt/gnome-2-18/src/gnome-keyring' make: *** [all] Error 2
Since renaming the function is not an option, gtkdoc-scan should get a way to ignore a _get_type function name. The patch above removes gnome-keyring.h from the scan, but that is where most of the useful stuff is in the docs!
At this point, I see only these solutions then: - gtkdoc-scan should support ignore function by name (ignore = gnome_keyring_info_get_type) - let see what I can do. - move the _get_type function declaration to its own header (included by gnome-keyring.h)
You just need to create an empty gnome-keyring.types file and add that to svn. That works for me. Damon (gtk-doc maintainer)
I've added special code to gtk-doc to ignore gnome_keyring_info_get_type so this should be fixed now. (In future gtk-doc will only create the .types file on the very first run, so this shouldn't be as much of a problem - you just delete it once if you need to.)
Wow that's a dirty hack ;-)
This bug also affects HAL with libhal_psi_get_type.
Damon, could we, instead of hardcoding the g-k function, add a command line to gtkdoc-scan to add names to be ignored?
HAL shouldn't have a problem with the latest gtk-doc. Since it already has a hal-sections.txt file gtk-doc shouldn't generate the .types file. (I don't think HAL is using the --rebuild-types option) Though I wouldn't mind a command-line option as well.