GNOME Bugzilla – Bug 757061
Fails to build gtk-doc without X
Last modified: 2016-04-25 13:08:41 UTC
Yelp failed to build on all our buildds: https://buildd.debian.org/status/package.php?p=yelp Those don't have any X/desktop environment installed: gtkdoc-scan --module=libyelp --ignore-headers="yelp-common-types.h yelp-debug.h yelp-types.h " ${_source_dir} --deprecated-guards="G_DISABLE_DEPRECATED" --rebuild-types if grep -l '^..*$' libyelp.types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$?" = "0"; then \ if test "x" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="/bin/bash ../../libtool --tag=CC --mode=compile gcc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -g" LD="/bin/bash ../../libtool --tag=CC --mode=link gcc -lgobject-2.0 -lglib-2.0 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -g -Wl,-z,relro -Wl,-z,defs -Wl,-O1 -Wl,--as-needed" RUN="/bin/bash ../../libtool --mode=execute" CFLAGS="-pthread -I/usr/include/gtk-3.0/unix-print -I/usr/include/webkitgtk-4.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/webkitgtk-4.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../libyelp -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -g" LDFLAGS="-lbz2 -llzma -lgio-2.0 -lxslt -lxml2 -lexslt -lxslt -lxml2 -lsqlite3 -lwebkit2gtk-4.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -ljavascriptcoregtk-4.0 -lglib-2.0 ../../libyelp/libyelp.la -Wl,-z,relro -Wl,-z,defs -Wl,-O1 -Wl,--as-needed" \ gtkdoc-scangobj $scanobj_options --module=libyelp; \ else \ for i in libyelp.args libyelp.hierarchy libyelp.interfaces libyelp.prerequisites libyelp.signals ; do \ test -f $i || touch $i ; \ done \ fi (process:28251): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed ** (process:28251): WARNING **: Unable to connect to dbus: Cannot autolaunch D-Bus without X11 $DISPLAY Segmentation fault Scan failed: Makefile:644: recipe for target 'scan-build.stamp' failed make[4]: *** [scan-build.stamp] Error 139 make[4]: Leaving directory '/«PKGBUILDDIR»/docs/libyelp' I can reproduce the problem within a GNOME session when running the following commands unset XAUTHORITY unset DISPLAY ./configure --enable-gtk-doc make with a 3.18.1 dist tarball.
I recently found that building with --enable-gtk-doc was broken in that tarball, since it was missing a reference to libyelpcommon.lo in the Makefile, and perhaps that's the root cause of this error too, you commenting just in case. More details about that specific issue in bug 759457
that's a duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=756648 which was rejected
sorry, my last comment was supposed to go at bug 759457
(In reply to Mario Sánchez Prada from comment #1) > I recently found that building with --enable-gtk-doc was broken in that > tarball, since it was missing a reference to libyelpcommon.lo in the > Makefile, and perhaps that's the root cause of this error too, you > commenting just in case. Even after fixing the linker issues, the build still fails without X. So the issues don't look related.
I think this might be related to webkit2, which the scanner links against. This is the backtrace I get when running it directly with DISPLAY unset: Starting program: /home/michael/debian/build-area/yelp-3.20.1/docs/libyelp/.libs/lt-libyelp-scan» [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffa25ff700 (LWP 3277)] [New Thread 0x7fffa1dfe700 (LWP 3278)] Program received signal SIGSEGV, Segmentation fault. 0x00007fffea66bd84 in XCloseDisplay () from /usr/lib/x86_64-linux-gnu/libX11.so.6
+ Trace 236189
Not very surprisingly, this issue started happening when yelp switched from webkit to webkit2.
(In reply to Michael Biebl from comment #5) > I think this might be related to webkit2, which the scanner links against. Why does it link against WebKit?
docs/libyelp/Makefile.am has GTKDOC_LIBS = \ $(YELP_LIBS) \ $(top_builddir)/libyelp/libyelp.la YELP_LIBS contains a dependency on webkit2: PKG_CHECK_MODULES(YELP, [ ... webkit2gtk-4.0 >= 2.7.1 ... ]) libyelp.la also links against $(YELP_LIBS), so there is also an indirect dependency.
This is happening because XCloseDisplay() is called with a NULL pointer: (gdb) bt
+ Trace 236204
I haven't tested it, but it looks like we simply need to check for m_display. --- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp +++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp @@ -49,7 +49,7 @@ PlatformDisplayX11::PlatformDisplayX11(Display* display) PlatformDisplayX11::~PlatformDisplayX11() { - if (m_ownedDisplay) + if (m_ownedDisplay && m_display) XCloseDisplay(m_display); }
WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=156972