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 757061 - Fails to build gtk-doc without X
Fails to build gtk-doc without X
Status: RESOLVED NOTGNOME
Product: yelp
Classification: Applications
Component: General
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: Yelp maintainers
Yelp maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-24 15:07 UTC by Michael Biebl
Modified: 2016-04-25 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Biebl 2015-10-24 15:07:45 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.
Comment 1 Mario Sánchez Prada 2015-12-14 15:50:00 UTC
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
Comment 2 Michael Biebl 2015-12-14 15:55:19 UTC
that's a duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=756648
which was rejected
Comment 3 Michael Biebl 2015-12-14 15:55:51 UTC
sorry, my last comment was supposed to go at bug 759457
Comment 4 Michael Biebl 2015-12-14 16:21:20 UTC
(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.
Comment 5 Michael Biebl 2016-04-18 16:23:18 UTC
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
  • #0 XCloseDisplay
    from /usr/lib/x86_64-linux-gnu/libX11.so.6
  • #1 WebCore::PlatformDisplayX11::~PlatformDisplayX11
    at /build/webkit2gtk-ea7lQt/webkit2gtk-2.12.1/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp line 53
  • #2 WebCore::PlatformDisplayX11::~PlatformDisplayX11
    at /build/webkit2gtk-ea7lQt/webkit2gtk-2.12.1/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp line 54
  • #3 __run_exit_handlers
    at exit.c line 82
  • #4 __GI_exit
    at exit.c line 104
  • #5 __libc_start_main
    at libc-start.c line 325
  • #6 _start



Not very surprisingly, this issue started happening when yelp switched from webkit to webkit2.
Comment 6 Michael Catanzaro 2016-04-18 16:41:46 UTC
(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?
Comment 7 Michael Biebl 2016-04-18 17:00:21 UTC
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.
Comment 8 Alberto Garcia 2016-04-25 10:03:35 UTC
This is happening because XCloseDisplay() is called with a NULL pointer:

(gdb) bt
  • #0 XCloseDisplay
    at ../../src/ClDisplay.c line 51
  • #1 WebCore::PlatformDisplayX11::~PlatformDisplayX11
    at /build/webkit2gtk-ea7lQt/webkit2gtk-2.12.1/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp line 53

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);
 }
Comment 9 Alberto Garcia 2016-04-25 11:57:38 UTC
WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=156972