Bug 79560

Summary: weston segfault on exit when cms-colord.so is loaded
Product: Wayland Reporter: Laurent Bigonville <bigon>
Component: westonAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: 1.5.0   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Weston output
weston.ini

Description Laurent Bigonville 2014-06-02 17:34:13 UTC
Created attachment 100327 [details]
Weston output

Hi,

When running weston from a X session and with the cms-colord.so module loaded, it segfault on exit with the following backtrace:

GLib (gthread-posix.c): Unexpected error from C library during 'pthread_mutex_lock': Invalid argument.  Aborting.
[19:29:57.375] caught signal: 6
[19:29:57.375]   [0000000000410227]  --  (weston)
[19:29:57.375]   [00000000004102ec]  --  (weston)
[19:29:57.375]   [00007f620d106420]  --  (/lib/x86_64-linux-gnu/libc.so.6)
[19:29:57.375]   [00007f620d1063a9]  gsignal  (/lib/x86_64-linux-gnu/libc.so.6)
[19:29:57.375]   [00007f620d1094c8]  abort  (/lib/x86_64-linux-gnu/libc.so.6)
[19:29:57.375]   [00007f6201de4453]  --  (/lib/x86_64-linux-gnu/libglib-2.0.so.0)
[19:29:57.375]   [00007f6201e539a3]  g_mutex_lock  (/lib/x86_64-linux-gnu/libglib-2.0.so.0)
[19:29:57.375]   [00007f6202ae8e44]  --  (/usr/lib/x86_64-linux-gnu/weston/cms-colord.so)
[19:29:57.375]   [00007f6202ae939b]  --  (/usr/lib/x86_64-linux-gnu/weston/cms-colord.so)
[19:29:57.375]   [0000000000407681]  --  (weston)
[19:29:57.375]   [000000000040e8ed]  weston_output_destroy  (weston)
[19:29:57.375]   [00007f620c898b30]  --  (/usr/lib/x86_64-linux-gnu/weston/x11-backend.so)
[19:29:57.375]   [00007f620c899ca8]  --  (/usr/lib/x86_64-linux-gnu/weston/x11-backend.so)
[19:29:57.375]   [00007f620c89a7b2]  --  (/usr/lib/x86_64-linux-gnu/weston/x11-backend.so)
[19:29:57.375]   [00007f620de6ec22]  wl_event_loop_dispatch  (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0)
[19:29:57.375]   [000000000040c0e7]  --  (weston)
[19:29:57.375]   [00007f620de6ec22]  wl_event_loop_dispatch  (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0)
[19:29:57.375]   [00007f620de6d265]  wl_display_run  (/usr/lib/x86_64-linux-gnu/libwayland-server.so.0)
[19:29:57.375]   [00000000004110fd]  --  (weston)
[19:29:57.375]   [00007f620d0f2b45]  __libc_start_main  (/lib/x86_64-linux-gnu/libc.so.6)
[19:29:57.375]   [0000000000407089]  --  (weston)
Comment 1 Laurent Bigonville 2014-06-02 17:35:32 UTC
Created attachment 100328 [details]
weston.ini
Comment 2 Laurent Bigonville 2014-07-10 13:24:07 UTC
Another backtrace: 

(gdb) where
#0  0x00007ffff681d18b in _xbegin () at ../nptl/sysdeps/unix/sysv/linux/x86/hle.h:53
#1  __lll_lock_elision (futex=0x727ab0, adapt_count=0x727ac6, private=128) at ../nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c:56
#2  0x00007fffeca9d991 in g_mutex_lock (mutex=<optimized out>) at /tmp/buildd/glib2.0-2.40.0/./glib/gthread-posix.c:209
#3  0x00007fffed732e5f in colord_idle_cancel_for_output (cms=0x7fffe0003050, o=0x6dbca0) at src/cms-colord.c:77
#4  0x00007fffed7333bf in colord_notifier_output_destroy (listener=0x7fffe00030a8, data=0x6dbca0) at src/cms-colord.c:223
#5  0x0000000000407673 in wl_signal_emit (signal=0x6dbeb0, data=0x6dbca0) at /usr/include/wayland-server.h:260
#6  0x000000000040e9a3 in weston_output_destroy (output=0x6dbca0) at src/compositor.c:3119
#7  0x00007ffff6600b23 in x11_output_destroy (output_base=0x6dbca0) at src/compositor-x11.c:497
#8  0x00007ffff6601c72 in x11_compositor_delete_window (c=0x6400c0, window=50331653) at src/compositor-x11.c:935
#9  0x00007ffff66027a2 in x11_compositor_handle_event (fd=10, mask=1, data=0x6400c0) at src/compositor-x11.c:1273
#10 0x00007ffff7bd3c22 in wl_event_loop_dispatch (loop=0x641290, timeout=<optimized out>) at ../src/event-loop.c:419
#11 0x000000000040c164 in weston_compositor_read_input (fd=9, mask=1, data=0x6400c0) at src/compositor.c:1830
#12 0x00007ffff7bd3c22 in wl_event_loop_dispatch (loop=0x630240, timeout=timeout@entry=-1) at ../src/event-loop.c:419
#13 0x00007ffff7bd2265 in wl_display_run (display=0x6301b0) at ../src/wayland-server.c:969
#14 0x000000000041116f in main (argc=1, argv=0x7fffffffe138) at src/compositor.c:4316


now it's complaining about an illegal instruction
Comment 3 Laurent Bigonville 2014-07-22 08:43:24 UTC
Aurelien Jarno made some research about this on the Debian BTS and apparently this seems to be a memory corruption


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754392
Comment 4 Pekka Paalanen 2014-09-19 09:57:21 UTC
For the record, it seems I reproduced something similar on the first try:

$ weston --modules=cms-colord.so
...
[12:48:14.145] x11 output 1024x600, window id 52428805
[12:48:14.145] Compositor capabilities:
               arbitrary surface rotation: yes
               screen capture uses y-flip: yes
[12:48:14.145] Loading module '/home/pq/local/lib/weston/desktop-shell.so'
[12:48:14.145] Loading module '/home/pq/local/lib/weston/xwayland.so'
[12:48:14.146] xserver listening on display :1
[12:48:14.146] Loading module '/home/pq/local/lib/weston/cms-colord.so'
[12:48:14.149] colord: initialized
[12:48:14.386] colord: no pnp.ids found
[12:48:14.386] colord: output X1 coldplugged
[12:48:14.386] colord: output added xrandr-weston-X11-none
[12:48:14.402] launching '/home/pq/local/libexec/weston-desktop-shell'
child 15321 exited

[12:48:39.389] colord: failed to create new or find existing device: Timeout was reached
[12:48:39.390] caught signal: 11
[12:48:39.390] 0: weston (on_caught_signal+0x17) [0x409427]
[12:48:39.416] 1: /lib64/libpthread.so.0 (funlockfile+0x60) [0x7fc4fb8f342f]
[12:48:39.417] 2: /home/pq/local/lib/weston/cms-colord.so (colord_run_loop_thread+0x28) [0x7fc4f470e808]
[12:48:39.422] 3: /usr/lib64/libglib-2.0.so.0 (g_test_get_filename+0x185) [0x7fc4f3a2c7d5]
[12:48:39.422] 4: /lib64/libpthread.so.0 (__pthread_get_minstack+0x12f7) [0x7fc4fb8ec3b7]
[12:48:39.423] 5: /lib64/libc.so.6 (clone+0x6d) [0x7fc4fb628236]
[12:48:39.423] 6: ? (?+0x6d) [0x6d]
Trace/breakpoint trap

Note a half minute pause after the Weston window was gone, before the errors came up.
Comment 5 Dawid Gajownik 2015-08-04 17:35:00 UTC
Can you still reproduce the issue with the weston from git? It looks it was fixed recently: http://lists.freedesktop.org/archives/wayland-devel/2015-July/023510.html
Comment 6 GitLab Migration User 2018-06-08 23:51:53 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/wayland/weston/issues/35.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.