After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652391 - g-ir-compiler segfault
g-ir-compiler segfault
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-compiler
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-06-12 12:47 UTC by jakob.gruber
Modified: 2018-01-25 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GIR files that doesn't compile with g-ir-compiler (74.91 KB, application/x-bzip)
2011-12-14 20:21 UTC, Daniel Espinosa
Details

Description jakob.gruber 2011-06-12 12:47:52 UTC
While building sqlheavy from git, the following command causes a segfault:

LD_LIBRARY_PATH=.libs /usr/bin/g-ir-compiler --includedir=. --includedir=. --shared-library=sqlheavy0.1 SQLHeavy-0.1.gir -o SQLHeavy-0.1.typelib &

sqlheavy git repo: http://gitorious.org/sqlheavy

The segfault is caused either by 99313967 or a985c883, previous checkouts work fine.

Shouldn't g-ir-compiler abort on error instead of entering an infinite recursion and segfaulting?

gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007f651866c1ab in vfprintf () from /lib/libc.so.6
(gdb) bt
  • #0 vfprintf
    from /lib/libc.so.6
  • #1 vasprintf
    from /lib/libc.so.6
  • #2 g_vasprintf
    from /usr/lib/libglib-2.0.so.0
  • #3 g_strdup_vprintf
    from /usr/lib/libglib-2.0.so.0
  • #4 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #5 g_log
    from /usr/lib/libglib-2.0.so.0
  • #6 ??
  • #7 ??
  • #8 ??
    from /usr/lib/libglib-2.0.so.0
  • #9 g_markup_parse_context_parse
    from /usr/lib/libglib-2.0.so.0
  • #10 _g_ir_parser_parse_string
  • #11 ??
  • #12 ??
  • #13 ??
    from /usr/lib/libglib-2.0.so.0
  • #14 g_markup_parse_context_parse
    from /usr/lib/libglib-2.0.so.0
  • #15 _g_ir_parser_parse_string
  • #16 ??
  • #17 ??
  • #18 ??
    from /usr/lib/libglib-2.0.so.0
  • #19 g_markup_parse_context_parse
    from /usr/lib/libglib-2.0.so.0
  • #20 _g_ir_parser_parse_string
  • #21 ??
  • #22 ??
  • #23 ??
    from /usr/lib/libglib-2.0.so.0
  • #24 g_markup_parse_context_parse
    from /usr/lib/libglib-2.0.so.0
  • #25 _g_ir_parser_parse_string

The backtrace has over 35000 levels (at least that's where I stopped pressing return).

kernel.log:

[ 5750.495752] g-ir-compiler[11877]: segfault at 7fff71ee3f18 ip 00007fd1720e51ab sp 00007fff71ee3f20 error 6 in libc-2.14.so[7fd1720a1000+157000]
Comment 1 Evan Nemerson 2011-07-16 19:43:43 UTC
Looks like this is due to SQLHeavy-0.1.gir containing an <include name="SQLHeavy" version="0.1"/>. It might be nice for g-ir-compiler to check for this type of issue, but the real problem seems valac (at least the 0.12 branch) generating an invalid GIR.
Comment 2 Daniel Espinosa 2011-12-14 20:21:27 UTC
Created attachment 203515 [details]
GIR files that doesn't compile with g-ir-compiler

In this examples, you have the Gda-5.0.gir and GdaData-5.0.gir files, the first one is created with g-ir-scanner from sources in libgda. The second, is created from Vala sources using valac.

Inspecting the first lines in GdaData-5.0.gir you can see that the following line is missing:

<include name="Gee" version="0.8"/>

when you try to compile to typelib using: 

g-ir-compiler --includedir=./ GdaData-5.0.gir --output GdaData-5.0.typelib

Fails with a segfault.

If you add that missing line (with gee-0.8.gir installed in your system) the compilation succeed.

I think g-ir-compiler must check first that a symbol definition is missing instead to segfault.
Comment 3 André Klapper 2015-02-07 17:18:19 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 4 Emmanuele Bassi (:ebassi) 2018-01-25 16:12:43 UTC
Closing as obsolete. This should really be a bug in Vala, but given the age of the issue, I'm going to assume Vala has also been fixed not to generate invalid introspection data.