FS#54205 - [openssl] colord-sane aborts at exit, sometimes

Attached to Project: Arch Linux
Opened by Stefan (steinwanderer) - Saturday, 27 May 2017, 16:34 GMT
Last edited by Jan Alexander Steffens (heftig) - Thursday, 20 July 2017, 07:39 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 23
Private No

Details

Description:

colord-sane dumps core a few seconds after start/stop of service and again, when a USB-Stick or HDD is connecting/mounting.

Additional info:

Downgrading sane to 1.0.25-2 resolve this. I'm not sure if this is a sane or colord problem.

* package version(s)

colord (1.3.5-1)
sane (1.0.27-1)
net-snmp (5.7.3-4)
libieee1284 (0.2.11-5)

* config and/or log files etc.

#systemctl status colord.service

● colord.service - Manage, Install and Generate Color Profiles
Loaded: loaded (/usr/lib/systemd/system/colord.service; static; vendor preset: disabled)
Active: active (running) since Sat 2017-05-27 17:31:48 CEST; 2s ago
Main PID: 3914 (colord)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/colord.service
└─3914 /usr/lib/colord/colord

Mai 27 17:31:48 localhost.localdomain colord[3914]: /usr/lib/colord/colord-sane: error while loading shared libraries: libsane.so.1: cannot open shared object file: No such file or directory

#sudo pacman -Syu sane

#systemctl stop colord.service
#systemctl start colord.service

Mai 27 17:37:15 polkitd[668]: Registered Authentication Agent for unix-process:4043:1632816 (system bus name :1.595 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/P…ocale de_DE.UTF-8)
Mai 27 17:37:15 polkitd[668]: Unregistered Authentication Agent for unix-process:4043:1632816 (system bus name :1.595, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale de_DE.U…onnected from bus)
Mai 27 17:37:21 colord[4049]: GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Invalid argument. Aborting.
Mai 27 17:37:21 systemd-coredump[4060]: Process 4053 (colord-sane) of user 124 dumped core.

Stack trace of thread 4056:...

#systemctl status colord.service

● colord.service - Manage, Install and Generate Color Profiles
Loaded: loaded (/usr/lib/systemd/system/colord.service; static; vendor preset: disabled)
Active: active (running) since Sat 2017-05-27 17:37:15 CEST; 45s ago
Main PID: 4049 (colord)
Tasks: 3 (limit: 4915)
CGroup: /system.slice/colord.service
└─4049 /usr/lib/colord/colord

Mai 27 17:37:21 localhost.localdomain colord[4049]: GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Invalid argument. Aborting.

Steps to reproduce:

Install colord and sane and start the service.
This task depends upon

Closed by  Jan Alexander Steffens (heftig)
Thursday, 20 July 2017, 07:39 GMT
Reason for closing:  Fixed
Comment by Hussam Al-Tayeb (hussam) - Monday, 29 May 2017, 09:19 GMT
I filed a colord bug https://github.com/hughsie/colord/issues/38 (this is likely due to sane 1.0.27 update).
I wasn't seeing the missing libsane.so.1 error though as I have sane installed.
I still need to report this in sane bug tracker.
Comment by Jan Alexander Steffens (heftig) - Tuesday, 30 May 2017, 15:34 GMT
The bug is as follows:

At program start, GSlice allocates pthread key 0 for the private_thread_memory GPrivate.

When enumerating devices, libsane's magicolor plugin initializes libnetsnmp, which initializes libcrypto, which registers OPENSSL_cleanup as an atexit function and gets itself pthread keys 7, 8 and 9.

When the main thread is finished, glibc calls OPENSSL_cleanup, which deletes pthread keys 7, 8, 9, and 0 (!!!).

In the mean time, there's still stuff happening on the GDBus worker threads, which includes calls to GSlice.

This races with the main thread, and if there's a call to GSlice after the main thread deleted key 0, GSlice explodes.

This is a bug in OpenSSL.
Comment by Jan Alexander Steffens (heftig) - Tuesday, 30 May 2017, 16:04 GMT Comment by Stefan (steinwanderer) - Thursday, 22 June 2017, 01:42 GMT
Can confirm, that patch seems to fix it. Tested with openssl 1.1.0.f-1. Thank you very much!
Comment by Federico (fedev) - Saturday, 08 July 2017, 02:49 GMT
Any idea of when the patch will make it to the repos?
Comment by Heinrich Siebmanns (Harvey) - Thursday, 13 July 2017, 08:41 GMT
As openssl project simply seems to have forgotten to include this patch into their last release (https://github.com/openssl/openssl/pull/3592), is it possible to apply the patch on the archlinux package until openssl decides to release a new version? This has been a bug for long time now...
Comment by Jan de Groot (JGC) - Wednesday, 19 July 2017, 08:59 GMT
Please test openssl 1.1.0f-2 in testing.
Comment by Heinrich Siebmanns (Harvey) - Wednesday, 19 July 2017, 12:08 GMT
The crash is gone... Thank you.
Comment by Boban (boban_dj) - Thursday, 20 July 2017, 05:35 GMT
Linux archz800 4.9.36-1-lts #1 SMP Wed Jul 5 17:34:52 CEST 2017 x86_64 GNU/Linux
openssl Version: 1.1.0.f-2 x86_64
confirmed patch is working

Loading...