libudev1 seems to cause a segfault in pcscd when a Vasco DP905v1.1 smart card reader is inserted before pcscd is started
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Hi,
When one plugs in a Vasco DP905v1.1 smart card reader before pcscd is started and waits for a few moments, the green 'power' led on this device will go off, indicating that the device is in low-power mode. When this happens, due to an issue with the specific card reader model, it seems to be impossible to revive the card reader without power-cycling the USB bus.
This is especially annoying as the time between 'USB bus receives power' and 'pcscd starts' is longer than the time it takes for the DP905v1.1 to go to low-power mode on many systems, causing loss of functionality for people who leave their smart card reader plugged in at boot time, and a segfault when the most obvious way to fix the issue (remove the card reader from the USB bus and plug it in again) is attempted. While the loss of functionality could be considered a bug in the smart card reader, not necessarily libudev's problem, the segfault is a different matter.
When one then starts pcscd with the '-f' option (for 'foreground'), the following information is printed to the console:
00000000 ccid_usb.
05000798 ccid_usb.
05000403 ccid_usb.
00000027 ifdhandler.
00000021 readerfactory.
00000009 readerfactory.
00000126 hotplug_
At this point pcscd is stuck waiting, and removing the card reader causes the segfault.
I installed a few debug symbols packages and recompiled pcscd with DEB_BUILD_
At the point when the segfault happens, pcscd will have three threads running:
- The first thread is the main thread, which is usually in select()
- The second thread seems to be a helper thread of some sort; its stack backtrace contains no function symbols
- The third thread will always be in pcscd:hotplug_
udev_
going down the stack trace into libudev gets us:
#0 0x00007ffff72c5200 in __openat_nocancel (fd=-100,
file=
at ../sysdeps/
#1 0x00007ffff7296935 in __opendirat (dfd=dfd@
name=
at ../sysdeps/
#2 0x00007ffff729697d in __opendir (name=name@
at ../sysdeps/
#3 0x00007ffff7bd0a02 in scan_dir (
udev_
basedir=
subdir=
subsystem=
#4 0x00007ffff7bd1280 in scan_devices_all (udev_enumerate
at ../src/
#5 udev_enumerate_
udev_
at ../src/
#6 0x000000000040e2d9 in HPRescanUsbBus (udev=udev@
at hotplug_
#7 0x000000000040e761 in HPEstablishUSBN
at hotplug_
#8 0x00007ffff75a7182 in start_thread (arg=0x7ffff5d2
at pthread_
#9 0x00007ffff72d3fbd in clone ()
at ../sysdeps/
Although this thread is always at the same location which makes me think it seems to cause the segfault, I should note that it is in fact the second thread which does so:
(gdb) thread 2
[Switching to thread 2 (Thread 4168)]
#0 0x00007ffff6533248 in ?? ()
(gdb) where
#0 0x00007ffff6533248 in ?? ()
#1 0x00007ffff6524700 in ?? ()
#2 0x0000000000000018 in ?? ()
#3 0x0000000100000005 in ?? ()
#4 0x0001000100000004 in ?? ()
#5 0x00007ffff6524700 in ?? ()
#6 0x00007ffff6524700 in ?? ()
#7 0x0000000000000000 in ?? ()
but as said, I'm not sure what to do with this.
After having figured out that it's somewhere inside libudev, I wanted to file a bug with a crash report, but apparently I must've done something wrong, because apport no longer seems to want to write crash reports on this system. To make matters worse, I also can't create a core dump using 'ulimit -c unlimited'. If someone could help me fix that, I'll happily submit a core dump if needed.
This problem has been observed on at least three machines, all running trusty (some amd64, some i386).
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: libudev1 204-5ubuntu20.5
ProcVersionSign
Uname: Linux 3.13.0-35-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.3
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Sep 8 12:21:43 2014
InstallationDate: Installed on 2014-08-28 (11 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in systemd (Ubuntu): | |
status: | Confirmed → Won't Fix |
Status changed to 'Confirmed' because the bug affects multiple users.