Xpra: Ticket #820: XkbQueryExtension: symbol not found (musl C)

I've successfully built packages for xpra / cython & pgen under Alpine Linux (which uses Musl C not Glibc) & have the following dependencies installed:

>>> xpra*: Tracing dependencies...
	py-gobject
	py-gtk
	xf86-video-dummy
	so:libX11.so.6
	so:libXcomposite.so.1
	so:libXdamage.so.1
	so:libXext.so.6
	so:libXfixes.so.3
	so:libXrandr.so.2
	so:libXtst.so.6
	so:libavcodec.so.56
	so:libavutil.so.54
	so:libc.musl-x86.so.1
	so:libgdk-x11-2.0.so.0
	so:libpython2.7.so.1.0
	so:libswscale.so.3
	so:libvpx.so.1
	so:libwebp.so.5
	so:libx264.so.142
	so:libxkbfile.so.1

But crash with the following runtime relocation error under 64 bit:

musl64 [~/aports/testing/xpra]$ cat /home/stuart/.xpra/:100.log
could not determine ld path for x86_64, please file an xpra bug
X.Org X Server 1.16.3
Release Date: 2014-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.10.33-0-grsec x86_64
Current Operating System: Linux musl64 3.16-0.bpo.3-amd64 #1 SMP Debian 3.16.5-1~bpo70+1 (2014-11-02) x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.16-0.bpo.3-amd64 root=/dev/mapper/vg0-root ro quiet cgroup_enable=memory,namespace
Build Date: 23 December 2014  10:23:51AM
Current version of pixman: 0.32.6
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/home/stuart/.xpra/Xorg.:100.log", Time: Sat Feb 28 02:44:44 2015
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
** (Xpra:319): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (Xpra:319): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (Xpra:319): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
xpra main error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/xpra/scripts/main.py", line 103, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/usr/lib/python2.7/site-packages/xpra/scripts/main.py", line 760, in run_mode
    return run_server(error_cb, options, mode, script_file, args)
  File "/usr/lib/python2.7/site-packages/xpra/scripts/server.py", line 948, in run_server
    from xpra.x11.gtk_x11 import gdk_display_source
  File "/usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/__init__.py", line 7, in <module>
    from xpra.x11.gtk_x11.gdk_bindings import *
ImportError: Error relocating /usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/gdk_bindings.so: XkbQueryExtension: symbol not found
2015-02-28 02:44:45,008 removing socket /home/stuart/.xpra/musl64-100

(Alpine has /usr/lib on 64 bit not /usr/lib64) - but I also get exactly the same error on 32 bit:

** (Xpra:319): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (Xpra:319): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (Xpra:319): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Xlib:  extension "RANDR" missing on display ":100".
Xlib:  extension "RANDR" missing on display ":100".
xpra main error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/xpra/scripts/main.py", line 103, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/usr/lib/python2.7/site-packages/xpra/scripts/main.py", line 760, in run_mode
    return run_server(error_cb, options, mode, script_file, args)
  File "/usr/lib/python2.7/site-packages/xpra/scripts/server.py", line 948, in run_server
    from xpra.x11.gtk_x11 import gdk_display_source
  File "/usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/__init__.py", line 7, in <module>
    from xpra.x11.gtk_x11.gdk_bindings import *
ImportError: Error relocating /usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/gdk_bindings.so: XkbQueryExtension: symbol not found
2015-03-01 15:40:05,283 removing socket /home/stuart/.xpra/musl32-100

The 2 systems are Alpine LXC Guests. Any clues where I should be looking to fix this this ?



Tue, 03 Mar 2015 02:31:46 GMT - Antoine Martin: owner changed; milestone set

What do you see with:

ldd /usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/gdk_bindings.so

Please also post the compilation output, the lines that compile and link the gdk bindings.

XkbQueryExtension is defined in libX11, so I don't understand why your library would be missing this symbol. Works on every other platform we build for (of which there are many).

See:

$ nm -D /usr/lib64/libX11.so* | grep -i XkbQueryExtension

Wed, 04 Mar 2015 14:25:55 GMT - itoffshore: attachment set

32 bit build log


Wed, 04 Mar 2015 14:44:44 GMT - itoffshore: cc set

Sorry for the delay in replying - I did not receive an email with your reply.


32 Bit:

musl32 [~]$ ldd /usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/gdk_bindings.so
	ldd (0xf7690000)
	libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xf75a0000)
	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xf7598000)
	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xf7590000)
	libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0xf73f8000)
	libc.musl-x86.so.1 => ldd (0xf7690000)
	libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0xf73e8000)
	libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0xf7398000)
	libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0xf7218000)
	libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xf71d8000)
	libXrender.so.1 => /usr/lib/libXrender.so.1 (0xf71c8000)
	libXi.so.6 => /usr/lib/libXi.so.6 (0xf71b8000)
	libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0xf71a8000)
	libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0xf7198000)
	libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0xf7190000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0xf7170000)
	libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xf7128000)
	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xf7000000)
	libintl.so.8 => /usr/lib/libintl.so.8 (0xf6ff0000)
	libcairo.so.2 => /usr/lib/libcairo.so.2 (0xf6ee8000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0xf6db8000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0xf6da0000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xf6d80000)
	libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0xf6d68000)
	libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xf6d60000)
	libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xf6d58000)
	libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0xf6d08000)
	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xf6c68000)
	libffi.so.6 => /usr/lib/libffi.so.6 (0xf6c60000)
	libz.so.1 => /lib/libz.so.1 (0xf6c48000)
	libexpat.so.1 => /usr/lib/libexpat.so.1 (0xf6c20000)
	libpng16.so.16 => /usr/lib/libpng16.so.16 (0xf6be8000)
	libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0xf6b40000)
	libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0xf6b38000)
	libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0xf6b28000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0xf6b00000)
	libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0xf6ae0000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0xf6ad8000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xf6ad0000)

64 bit:

musl64 [~]$ ldd /usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/gdk_bindings.so
	ldd (0x7fa8982e8000)
	libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x7fa897e08000)
	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x7fa897c00000)
	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x7fa8979f8000)
	libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0x7fa897668000)
	libc.musl-x86_64.so.1 => ldd (0x7fa8982e8000)
	libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x7fa897458000)
	libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x7fa897208000)
	libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x7fa896e88000)
	libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x7fa896c48000)
	libXrender.so.1 => /usr/lib/libXrender.so.1 (0x7fa896a38000)
	libXi.so.6 => /usr/lib/libXi.so.6 (0x7fa896828000)
	libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x7fa896618000)
	libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x7fa896408000)
	libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x7fa896200000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x7fa895fe0000)
	libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x7fa895d90000)
	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x7fa895a68000)
	libintl.so.8 => /usr/lib/libintl.so.8 (0x7fa895858000)
	libcairo.so.2 => /usr/lib/libcairo.so.2 (0x7fa895558000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x7fa895220000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0x7fa895008000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fa894df0000)
	libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x7fa894bd8000)
	libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x7fa8949d0000)
	libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x7fa8947c8000)
	libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x7fa894580000)
	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x7fa8942e8000)
	libffi.so.6 => /usr/lib/libffi.so.6 (0x7fa8940e0000)
	libz.so.1 => /lib/libz.so.1 (0x7fa893ec8000)
	libexpat.so.1 => /usr/lib/libexpat.so.1 (0x7fa893ca0000)
	libpng16.so.16 => /usr/lib/libpng16.so.16 (0x7fa893a70000)
	libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x7fa8937c8000)
	libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x7fa8935c0000)
	libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x7fa8933b0000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7fa893188000)
	libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x7fa892f70000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0x7fa892d68000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7fa892b60000)

(there is no /usr/lib64 in Alpine Linux)

musl32 [~]$ nm -D /usr/lib/libX11.so* | grep -i XkbQueryExtension
00080010 T XkbQueryExtension
00080010 T XkbQueryExtension
musl64 [~]$ nm -D /usr/lib/libX11.so* | grep -i XkbQueryExtension
0000000000085e4c T XkbQueryExtension
0000000000085e4c T XkbQueryExtension

Compilation of the GDK Bindings (32 bit build log also attached):

building 'xpra.x11.gtk_x11.gdk_display_source' extension
creating build/temp.linux-i686-2.7/xpra/x11/gtk_x11
gcc -DNDEBUG -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -I/usr/include/pygtk-2.0 -I/usr/lib/libffi-3.2.1/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/python2.7 -c xpra/x11/gtk_x11/gdk_display_source.c -o build/temp.linux-i686-2.7/xpra/x11/gtk_x11/gdk_display_source.o -Wall -Werror=implicit-function-declaration -fPIC
gcc -shared -Wl,--as-needed -Wl,--as-needed -Os -fomit-frame-pointer -Os -fomit-frame-pointer build/temp.linux-i686-2.7/xpra/x11/gtk_x11/gdk_display_source.o -L/usr/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -lpython2.7 -o build/lib.linux-i686-2.7/xpra/x11/gtk_x11/gdk_display_source.so -pthread -Wall
building 'xpra.x11.gtk_x11.gdk_bindings' extension
gcc -DNDEBUG -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -I/usr/include/pygtk-2.0 -I/usr/lib/libffi-3.2.1/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/python2.7 -c xpra/x11/gtk_x11/gdk_bindings.c -o build/temp.linux-i686-2.7/xpra/x11/gtk_x11/gdk_bindings.o -Wall -Werror=implicit-function-declaration -fPIC
xpra/x11/gtk_x11/gdk_bindings.c: In function '__pyx_f_4xpra_3x11_7gtk_x11_12gdk_bindings_x_event_filter':
xpra/x11/gtk_x11/gdk_bindings.c:12780:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
               __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_11))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
               ^
xpra/x11/gtk_x11/gdk_bindings.c:12780:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
xpra/x11/gtk_x11/gdk_bindings.c: In function '__pyx_pf_4xpra_3x11_7gtk_x11_12gdk_bindings_32init_x11_filter':
xpra/x11/gtk_x11/gdk_bindings.c:13427:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     __Pyx_INCREF(Py_False);
     ^
xpra/x11/gtk_x11/gdk_bindings.c:13469:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   __Pyx_INCREF(Py_True);
   ^
xpra/x11/gtk_x11/gdk_bindings.c: In function '__pyx_pf_4xpra_3x11_7gtk_x11_12gdk_bindings_34cleanup_x11_filter':
xpra/x11/gtk_x11/gdk_bindings.c:13547:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     __Pyx_INCREF(Py_False);
     ^
xpra/x11/gtk_x11/gdk_bindings.c:13575:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   __Pyx_INCREF(Py_True);
   ^
gcc -shared -Wl,--as-needed -Wl,--as-needed -Os -fomit-frame-pointer -Os -fomit-frame-pointer build/temp.linux-i686-2.7/xpra/x11/gtk_x11/gdk_bindings.o -L/usr/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -lXdamage -lXfixes -lpython2.7 -o build/lib.linux-i686-2.7/xpra/x11/gtk_x11/gdk_bindings.so -pthread -Wall
building 'xpra.codecs.argb.argb' extension
creating build/temp.linux-i686-2.7/xpra/codecs/argb
gcc -DNDEBUG -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -I/usr/include/python2.7 -c xpra/codecs/argb/argb.c -o build/temp.linux-i686-2.7/xpra/codecs/argb/argb.o
gcc -DNDEBUG -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -I/usr/include/python2.7 -c xpra/codecs/buffers/old_buffers.c -o build/temp.linux-i686-2.7/xpra/codecs/buffers/old_buffers.o
gcc -shared -Wl,--as-needed -Wl,--as-needed -Os -fomit-frame-pointer -Os -fomit-frame-pointer build/temp.linux-i686-2.7/xpra/codecs/argb/argb.o build/temp.linux-i686-2.7/xpra/codecs/buffers/old_buffers.o -L/usr/lib -lpython2.7 -o build/lib.linux-i686-2.7/xpra/codecs/argb/argb.so
building 'xpra.gtk_common.gdk_atoms' extension
creating build/temp.linux-i686-2.7/xpra/gtk_common
gcc -DNDEBUG -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -I/usr/include/pygtk-2.0 -I/usr/lib/libffi-3.2.1/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/python2.7 -c xpra/gtk_common/gdk_atoms.c -o build/temp.linux-i686-2.7/xpra/gtk_common/gdk_atoms.o -Wall -Werror=implicit-function-declaration -fPIC
gcc -shared -Wl,--as-needed -Wl,--as-needed -Os -fomit-frame-pointer -Os -fomit-frame-pointer build/temp.linux-i686-2.7/xpra/gtk_common/gdk_atoms.o -L/usr/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -lpython2.7 -o build/lib.linux-i686-2.7/xpra/gtk_common/gdk_atoms.so -pthread -Wall

I am sending a patch in to Alpine to update 'setxkbmap' to 1.3.0 so it has the '-query' option


Wed, 04 Mar 2015 16:59:31 GMT - itoffshore:

I updated setxkbmap to version 1.3.0

& tried adding '-fno-strict-aliasing' to setup.py:

--- xpra-0.14.19/setup.py
+++ xpra-0.14.19/setup.py.new
@@ -619,7 +619,7 @@
             eifd = "-Werror-implicit-function-declaration"
         add_to_keywords(kw, 'extra_compile_args', eifd)
     if PIC_ENABLED and not is_msvc():
-        add_to_keywords(kw, 'extra_compile_args', "-fPIC")
+        add_to_keywords(kw, 'extra_compile_args', "-fno-strict-aliasing")
     if debug_ENABLED:
         if is_msvc():
             add_to_keywords(kw, 'extra_compile_args', '/Zi')

& this removed the gdk strict anti-aliasing warnings (see attached build2.log) - but the runtime relocation error still persists.


Wed, 04 Mar 2015 17:00:40 GMT - itoffshore: attachment set

32 bit build with strict anti-aliasing disabled


Thu, 05 Mar 2015 05:01:50 GMT - Antoine Martin:

Sorry, but this is beyond me. A shot in the dark: maybe you would need to link against libX11 directly? As in, adding -lX11 to the linker stage? If not, best to ask someone who understands linking better than I do.. sorry.


Mon, 23 Mar 2015 22:45:16 GMT - itoffshore:

Explicitly linking to libX11 :

building 'xpra.x11.gtk_x11.gdk_bindings' extension
gcc -DNDEBUG -Os -fomit-frame-pointer -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -I/usr/include/pygtk-2.0 -I/usr/lib/libffi-3.2.1/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/python2.7 -c xpra/x11/gtk_x11/gdk_bindings.c -o build/temp.linux-i686-2.7/xpra/x11/gtk_x11/gdk_bindings.o -Wall -Werror=implicit-function-declaration -fPIC
xpra/x11/gtk_x11/gdk_bindings.c: In function '__pyx_f_4xpra_3x11_7gtk_x11_12gdk_bindings_x_event_filter':
xpra/x11/gtk_x11/gdk_bindings.c:12780:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
               __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_11))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
               ^
xpra/x11/gtk_x11/gdk_bindings.c:12780:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
xpra/x11/gtk_x11/gdk_bindings.c: In function '__pyx_pf_4xpra_3x11_7gtk_x11_12gdk_bindings_32init_x11_filter':
xpra/x11/gtk_x11/gdk_bindings.c:13427:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     __Pyx_INCREF(Py_False);
     ^
xpra/x11/gtk_x11/gdk_bindings.c:13469:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   __Pyx_INCREF(Py_True);
   ^
xpra/x11/gtk_x11/gdk_bindings.c: In function '__pyx_pf_4xpra_3x11_7gtk_x11_12gdk_bindings_34cleanup_x11_filter':
xpra/x11/gtk_x11/gdk_bindings.c:13547:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
     __Pyx_INCREF(Py_False);
     ^
xpra/x11/gtk_x11/gdk_bindings.c:13575:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   __Pyx_INCREF(Py_True);
   ^
gcc -shared -Wl,--as-needed -Wl,--as-needed -lX11 -Os -fomit-frame-pointer -Os -fomit-frame-pointer build/temp.linux-i686-2.7/xpra/x11/gtk_x11/gdk_bindings.o -L/usr/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype -lXdamage -lXfixes -lpython2.7 -o build/lib.linux-i686-2.7/xpra/x11/gtk_x11/gdk_bindings.so -pthread -Wall

unfortunately did not solve the gdk relocation error:

ImportError: Error relocating /usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/gdk_bindings.so: XkbQueryExtension: symbol not found

setxkbmap is now version 1.3.0 in Alpine & has -query


Tue, 14 Apr 2015 15:55:02 GMT - Antoine Martin: status changed; resolution set

I am closing this as needinfo because this looks like a toolchain issue and I am not going to install yet another distribution to investigate.

If you do find out the answer, please post it here.


Tue, 14 Apr 2015 18:48:13 GMT - itoffshore:

I will keep investigating. An Alpine LXC container is 10 meg: lxc-create -n guest1 -f /etc/lxc/lxc.conf -t alpine


Fri, 22 Apr 2016 20:11:38 GMT - urzds: status changed; resolution deleted

This is a simple case of underlinking, which there are more instances of:

ImportError: Error relocating /usr/lib/python2.7/site-packages/xpra/x11/gtk_x11/gdk_bindings.so: XkbQueryExtension: symbol not found
ImportError: Error relocating /usr/lib/python2.7/site-packages/xpra/x11/gtk2/gdk_bindings.so: XShapeQueryExtension: symbol not found
ImportError: Error relocating /usr/lib/python2.7/site-packages/xpra/x11/bindings/window_bindings.so: XInternAtom: symbol not found
ImportError: Error relocating /usr/lib/python2.7/site-packages/xpra/x11/bindings/ximage.so: XGetImage: symbol not found

It's mostly just a missing dependency on libX11.so, but gdk_bindings.so also needs libXext.so in addition.

The following sed snippet fixes it:

        sed -i setup.py \
                -e '/GDK_BINDINGS_PACKAGES = PYGTK_PACKAGES/s/"xfixes"/"x11", "xext", "xfixes"/' \
                -e 's/pkgconfig("xtst", "xfixes", "xcomposite", "xdamage", "xext")/pkgconfig("x11", "xtst", "xfixes", "xcomposite", "xdamage", "xext")/' \
                -e 's/pkgconfig("xcomposite", "xdamage", "xext")/pkgconfig("x11", "xcomposite", "xdamage", "xext")/'

Before:

/ # scanelf -n /usr/lib/python2.7/site-packages/xpra/x11/gtk2/gdk_bindings.so
 TYPE   NEEDED FILE
ET_DYN libgdk-x11-2.0.so.0,libXdamage.so.1,libXfixes.so.3,libpython2.7.so.1.0,libc.musl-x86_64.so.1 /usr/lib/python2.7/site-packages/xpra/x11/gtk2/gdk_bindings.so
/ # scanelf -n /usr/lib/python2.7/site-packages/xpra/x11/bindings/window_bindings.so
 TYPE   NEEDED FILE
ET_DYN libXcomposite.so.1,libXdamage.so.1,libXfixes.so.3,libXext.so.6,libpython2.7.so.1.0,libc.musl-x86_64.so.1 /usr/lib/python2.7/site-packages/xpra/x11/bindings/window_bindings.so
/ # scanelf -n /usr/lib/python2.7/site-packages/xpra/x11/bindings/ximage.so
 TYPE   NEEDED FILE
ET_DYN libXcomposite.so.1,libXext.so.6,libpython2.7.so.1.0,libc.musl-x86_64.so.1 /usr/lib/python2.7/site-packages/xpra/x11/bindings/ximage.so

After:

/ # scanelf -n /usr/lib/python2.7/site-packages/xpra/x11/gtk2/gdk_bindings.so
 TYPE   NEEDED FILE
ET_DYN libgdk-x11-2.0.so.0,libX11.so.6,libXext.so.6,libXdamage.so.1,libXfixes.so.3,libpython2.7.so.1.0,libc.musl-x86_64.so.1 /usr/lib/python2.7/site-packages/xpra/x11/gtk2/gdk_bindings.so
/ # scanelf -n /usr/lib/python2.7/site-packages/xpra/x11/bindings/window_bindings.so
 TYPE   NEEDED FILE
ET_DYN libX11.so.6,libXcomposite.so.1,libXdamage.so.1,libXfixes.so.3,libXext.so.6,libpython2.7.so.1.0,libc.musl-x86_64.so.1 /usr/lib/python2.7/site-packages/xpra/x11/bindings/window_bindings.so
/ # scanelf -n /usr/lib/python2.7/site-packages/xpra/x11/bindings/ximage.so
 TYPE   NEEDED FILE
ET_DYN libX11.so.6,libXcomposite.so.1,libXext.so.6,libpython2.7.so.1.0,libc.musl-x86_64.so.1 /usr/lib/python2.7/site-packages/xpra/x11/bindings/ximage.so

Sat, 23 Apr 2016 00:45:57 GMT - itoffshore:

Building with the sed fix above (thank you urzds) now shows output from xorg in the xpra logs & asks to file a bug for ld path not being found:

could not determine ld path for x86_64, please file an xpra bug
2016-04-23 00:45:57,353 Warning: failed to load the mdns avahi publisher: No module named avahi
2016-04-23 00:45:57,354  either fix your installation or use the 'mdns=no' option
X.Org X Server 1.18.0
Release Date: 2015-11-09
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.18.20-1-grsec x86_64
Current Operating System: Linux alpine64-kvm 4.1.20-0-grsec #1-Alpine SMP Mon Mar 21 15:49:51 GMT 2016 x86_64
Build Date: 10 November 2015  03:35:56PM
Current version of pixman: 0.32.8
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/home/stuart/.xpra/Xorg.:100.log", Time: Sat Apr 23 00:45:57 2016
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
	 at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/home/stuart/.xpra/Xorg.:100.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
could not connect to X server on display ':100' after 3 seconds
2016-04-23 00:46:00,359 removing socket /home/stuart/.xpra/alpine64-kvm-100

Sat, 23 Apr 2016 03:33:59 GMT - Antoine Martin:

@urzds: thanks, applied in r12471. (not sure why pkgconfig doesn't list those libraries if we are supposed to link against them)

@itoffshore: the xpra_Xdummy launch script needs to locate ld-linux.so to run Xorg nosuid, where is it located in your case? (you can try adding your location to that script to see if that works)


Sat, 23 Apr 2016 13:12:52 GMT - Dennis Schridde:

not sure why pkgconfig doesn't list those libraries if we are supposed to link against them

You yourself are using functions from those libraries. It's not caused by the libraries you link to, but by your own code. (At least in the cases I checked...)

@itoffshore: I ran into the same issue. There seems to be some case of underlinking in dummy_drv.so -- or maybe XOrg drivers are not supposed to link against XOrg modules by design... You can workaround the issue by placing the following in etc/xpra/xorg.conf:

Section "Module"
  Load "fb"
EndSection

Since I am not yet sure what the appropriate fix is, I first reported a bug against Alpine to get their XOrg maintainers into the boat: https://bugs.alpinelinux.org/issues/5478


Sat, 23 Apr 2016 13:37:10 GMT - Antoine Martin:

You yourself are using functions from those libraries.


@devurandom: indeed we are. Not sure how I missed that, or how it built properly until now!

@itoffshore: I would fix the ld path suid problem before trying to load other X11 modules. Xdummy should not run as root.


Sat, 23 Apr 2016 13:58:28 GMT - itoffshore:

The underlinking is probably caused by Musl C not supporting lazy loading of modules in xorg.

Here is a patch for Xdummy to detect ld-musl-*.so

--- xpra-0.16.3/scripts/xpra_Xdummy
+++ xpra-0.16.3/scripts/xpra_Xdummy.new
@@ -2,7 +2,7 @@
 #@PydevCodeAnalysisIgnore
 find_ld_linux() {
-	arch=$(uname -m)
+	local arch=$(uname -m) ldmusl=$(ls /lib | grep ^ld-musl)
 	if [ $arch = "x86_64" ]; then
 		LD_LINUX='/lib64/ld-linux-x86-64.so.2'
@@ -27,6 +27,10 @@
 	else
 		#suitable for: powerpc/ppc, mips/mipsel, s390 and others:
 		LD_LINUX='/lib/ld.so.1'
+	fi
+		# Musl C / Alpine Linux
+	if [ -n "$ldmusl" ]; then
+		LD_LINUX="/lib/$ldmusl"
 	fi
 	if [ ! -x "$LD_LINUX" ]; then

@devurandom - I am revising the xpra 0.16.3 patch in Alpine to include the above fixes. I am also adding some more python depends for lz4 gtkglext / rencode.


Sat, 23 Apr 2016 14:13:31 GMT - Antoine Martin:

@itoffshore: thanks for the patch. I'm not sure about the use of "local" here, is this going to be supported by all posix shells? (even the very limited ones)

Also, I would rather avoid the "ls" subshell command since it isn't needed for 99.9% of users, can we do something like this instead:

	if [ ! -x "$LD_LINUX" ]; then
		# Musl C / Alpine Linux
		ldmusl=$(ls /lib | grep ^ld-musl)
		if [ -n "$ldmusl" ]; then
			LD_LINUX="/lib/$ldmusl"
		else
			LD_LINUX=''
			echo "could not determine ld path for $arch, please file an xpra bug"
		fi
	fi

Sat, 23 Apr 2016 14:26:22 GMT - itoffshore:

Yes - a patch without local

--- xpra-0.16.3/scripts/xpra_Xdummy
+++ xpra-0.16.3/scripts/xpra_Xdummy.new
@@ -30,8 +30,14 @@
 	fi
 	if [ ! -x "$LD_LINUX" ]; then
-		LD_LINUX=''
-		echo "could not determine ld path for $arch, please file an xpra bug"
+		# Musl C / Alpine Linux
+		ldmusl=$(ls /lib | grep ^ld-musl)
+		if [ -n "$ldmusl" ]; then
+			LD_LINUX="/lib/$ldmusl"
+		else
+			LD_LINUX=''
+			echo "could not determine ld path for $arch, please file an xpra bug"
+		fi
 	fi
 }

Sat, 23 Apr 2016 14:28:42 GMT - Antoine Martin:

Thanks, applied in r12475.


Sat, 23 Apr 2016 17:08:25 GMT - Dennis Schridde:

@devurandom: indeed we are. Not sure how I missed that, or how it built properly until now!

You probably were lucky that on the more bloated distros (no offence intended) some of the other libraries you use linked against e.g. libX11.

The underlinking is probably caused by Musl C not supporting lazy loading of modules in xorg.

So you say that there probably no good fix for https://bugs.alpinelinux.org/issues/5478 ?

@devurandom - I am revising the xpra 0.16.3 patch in Alpine to include the above fixes. I am also adding some more python depends for lz4 gtkglext / rencode.

py-lz4: https://bugs.alpinelinux.org/issues/5480 py-rencode: https://bugs.alpinelinux.org/issues/5481 py-opencl: https://bugs.alpinelinux.org/issues/5482 py-opengl: https://bugs.alpinelinux.org/issues/5483 py-gtkglext: https://bugs.alpinelinux.org/issues/5484 py-numpy-dev missing dep on py-numpy: https://bugs.alpinelinux.org/issues/5485


Wed, 10 Aug 2016 02:26:46 GMT - Antoine Martin: status changed; resolution set

I think this is all fixed and the backport was in r12476.

Feel free to re-open if I've missed something.


Sat, 15 Jul 2017 10:05:33 GMT - Antoine Martin:

Just a heads up as I got reminded of this ticket when I made some changes to the way some gtk extensions are built, which tested fine on the more bloated distros I have here, but may cause problems elsewhere: r16349, r16350, r16351, r16352, r16353.


Sat, 23 Jan 2021 05:07:00 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/820