Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2159543

Summary: pcscd terminated with signal SIGSEGV, Segmentation fault
Product: Red Hat Enterprise Linux 8 Reporter: Orion Poplawski <orion>
Component: pcsc-liteAssignee: Bob Relyea <rrelyea>
Status: CLOSED MIGRATED QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.7CC: jjelen
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-19 20:53:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Orion Poplawski 2023-01-09 23:49:32 UTC
Description of problem:

Core was generated by `/usr/sbin/pcscd --foreground --auto-exit'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd01b699a84 in pthread_mutex_lock () from /lib64/libpthread.so.0
[Current thread is 1 (Thread 0x7fd0067fc700 (LWP 851798))]
(gdb) bt
#0  0x00007fd01b699a84 in pthread_mutex_lock () at /lib64/libpthread.so.0
#1  0x000055dd8362a5ee in IFDStatusICC
    (rContext=rContext@entry=0x55dd83a2c420, pdwStatus=pdwStatus@entry=0x7fd0067fba28)
    at ifdwrapper.c:346
#2  0x000055dd83629a90 in EHStatusHandlerThread (rContext=0x55dd83a2c420) at eventhandler.c:332
#3  0x00007fd01b6971cf in start_thread () at /lib64/libpthread.so.0
#4  0x00007fd01a3c1e73 in clone () at /lib64/libc.so.6
(gdb) up
#1  0x000055dd8362a5ee in IFDStatusICC (rContext=rContext@entry=0x55dd83a2c420,
    pdwStatus=pdwStatus@entry=0x7fd0067fba28) at ifdwrapper.c:346
346             (void)pthread_mutex_lock(rContext->mMutex);
(gdb) print *rContext
$1 = {library = 0x7fd00010f9b0 " \314\t", device = 0x7fd000031e20 "`\242\023",
  pthThread = 140531438962432, pthCardEvent = 0x7fd014281330, mMutex = 0x0, handlesList = {
    head_sentinel = 0x7fd0000b5470, tail_sentinel = 0x7fd0000be3d0, mid = 0x0, numels = 0,
    spareels = 0x7fd00005dca0, spareelsnum = 1, iter_active = 0, iter_pos = 0,
    iter_curentry = 0x0, attrs = {comparator = 0x0,
      seeker = 0x55dd8362b240 <RDR_CLIHANDLES_seeker>, meter = 0x0, copy_data = 0, hasher = 0x0,
      serializer = 0x0, unserializer = 0x0}}, handlesList_lock = {__data = {__lock = 0,
      __count = 0, __owner = 0, __nusers = 0, __kind = -1, __spins = 0, __elision = 0, __list = {
        __prev = 0x0, __next = 0x0}},
    __size = '\000' <repeats 16 times>, "\377\377\377\377", '\000' <repeats 19 times>,
    __align = 0}, psFunctions = {psFunctions_v2 = {pvfCreateChannel = 0x0,
      pvfCloseChannel = 0x0, pvfGetCapabilities = 0x0, pvfSetCapabilities = 0x0,
      pvfSetProtocolParameters = 0x0, pvfPowerICC = 0x0, pvfTransmitToICC = 0x0,
      pvfICCPresence = 0x0, pvfControl = 0x0}, psFunctions_v3 = {pvfCreateChannel = 0x0,
      pvfCloseChannel = 0x0, pvfGetCapabilities = 0x0, pvfSetCapabilities = 0x0,
      pvfSetProtocolParameters = 0x0, pvfPowerICC = 0x0, pvfTransmitToICC = 0x0,
      pvfICCPresence = 0x0, pvfControl = 0x0, pvfCreateChannelByName = 0x0}}, vHandle = 0x0,
  version = 0, port = 0, slot = 0, hLockId = 0, LockCount = 0, contexts = 0, pFeeds = 0x0,
  pMutex = 0x0, powerState = 3, powerState_lock = {__data = {__lock = 0, __count = 0,
      __owner = 0, __nusers = 0, __kind = -1, __spins = 0, __elision = 0, __list = {
        __prev = 0x0, __next = 0x0}},
    __size = '\000' <repeats 16 times>, "\377\377\377\377", '\000' <repeats 19 times>,
    __align = 0}, reference = 0, reference_lock = {__data = {__lock = 0, __count = 0,
      __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0,
        __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0},
  readerState = 0x55dd83840480 <readerStates>}
(gdb) print rContext->mMutex
$2 = (pthread_mutex_t *) 0x0
(gdb) print rContext
$3 = (READER_CONTEXT *) 0x55dd83a2c420

Version-Release number of selected component (if applicable):
pcsc-lite-1.9.5-1.el8.x86_64

How reproducible:
Just the once on this machine.  I see another machine with a pcscd crash, but haven't been able to look at the core yet.

Seems to have happened shortly after YK re-insertion:

Jan 04 12:04:02  pcscd[7536]: 01000192 eventhandler.c:336:EHStatusHandlerThread() Error communicating to: Yubico Yubikey 4 OTP+U2F+CCID 00 00
Jan 04 12:04:02  pcscd[7536]: 00000070 ccid_usb.c:1312:InterruptRead() libusb_submit_transfer failed: LIBUSB_ERROR_NO_DEVICE
Jan 04 12:04:02  pcscd[7536]: 00400178 ccid_usb.c:849:WriteUSB() write failed (4/4): -4 LIBUSB_ERROR_NO_DEVICE
Jan 04 12:04:02  pcscd[7536]: 00000026 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 617
Jan 04 12:04:03  kernel: usb 4-1: new full-speed USB device number 6 using uhci_hcd
Jan 04 12:04:03  kernel: usb 4-1: New USB device found, idVendor=1050, idProduct=0407, bcdDevice= 4.37
Jan 04 12:04:03  kernel: usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jan 04 12:04:03  kernel: usb 4-1: Product: Yubikey 4 OTP+U2F+CCID
Jan 04 12:04:03  kernel: usb 4-1: Manufacturer: Yubico
Jan 04 12:04:03  kernel: input: Yubico Yubikey 4 OTP+U2F+CCID as /devices/pci0000:00/0000:00:1a.1/usb4/4-1/4-1:1.0/0003:1050:0407.000C/input/input23
Jan 04 12:04:03  kernel: hid-generic 0003:1050:0407.000C: input,hidraw3: USB HID v1.10 Keyboard [Yubico Yubikey 4 OTP+U2F+CCID] on usb-0000:00:1a.1-1/input0
Jan 04 12:04:03  kernel: hid-generic 0003:1050:0407.000D: hiddev97,hidraw4: USB HID v1.10 Device [Yubico Yubikey 4 OTP+U2F+CCID] on usb-0000:00:1a.1-1/input1
Jan 04 12:04:03  pcscd[7536]: 00907014 ifdhandler.c:150:CreateChannelByNameOrChannel() failed
Jan 04 12:04:03  pcscd[7536]: 00002325 ifdhandler.c:150:CreateChannelByNameOrChannel() failed
Jan 04 12:04:03  pcscd[7536]: 00090818 eventhandler.c:336:EHStatusHandlerThread() Error communicating to: Yubico Yubikey 4 OTP+U2F+CCID 00 00
Jan 04 12:04:03  pcscd[7536]: 00000049 ccid_usb.c:1312:InterruptRead() libusb_submit_transfer failed: LIBUSB_ERROR_NO_DEVICE
Jan 04 12:04:04  pcscd[7536]: 00400210 ccid_usb.c:849:WriteUSB() write failed (4/4): -4 LIBUSB_ERROR_NO_DEVICE
Jan 04 12:04:04  pcscd[7536]: 00029618 ifdwrapper.c:180:IFDCloseIFD() Locking failed
Jan 04 12:04:04  ssh-pkcs11-helper[250686]: error: C_Sign failed: 224
Jan 04 12:04:04  kernel: pcscd[851798]: segfault at 10 ip 00007fd01b699a84 sp 00007fd0067fb9e8 error 4 in libpthread-2.28.so[7fd01b68f000+1b000]
Jan 04 12:04:04  kernel: Code: 02 a9 00 00 ba b1 01 00 00 48 8d 35 8b a7 00 00 48 8d 3d 3f a8 00 00 e8 ea b9 ff ff 8b 03 e9 45 fa ff ff 0f 1f 00 f3 0f 1e fa <8b> 47 10 89 c2 81 e2 7f 01 00 00 90 83 e0 7c 0f 85 a7 00 00 00 48
Jan 04 12:04:04  abrt-hook-ccpp[851817]: Process 7536 (pcscd) of user 0 killed by SIGSEGV - dumping core

Comment 1 Jakub Jelen 2023-09-14 13:01:52 UTC
Probably late, but I think it would be useful to see the state of other threads in case of the crash will happen again.

This shows the thread has the mMutex=NULL, which means it was likely cleaned up by some other thread. I went through recent changes, but did not notice any obvious fix for that so it still might be an issue in master.

Comment 2 RHEL Program Management 2023-09-19 20:48:53 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-19 20:53:54 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.