udisksd crashed with SIGSEGV in udisks_daemon_util_check_authorization_sync()

Bug #1236510 reported by Bert Vorenholt
414
This bug affects 63 people
Affects Status Importance Assigned to Milestone
PolicyKit
Fix Released
High
policykit-1 (Fedora)
Fix Released
Undecided
policykit-1 (Ubuntu)
Fix Released
High
Unassigned

Bug Description

I didn't see anything strange.

ProblemType: Crash
DistroRelease: Ubuntu 13.10
Package: udisks2 2.1.0-4
ProcVersionSignature: Ubuntu 3.11.0-11.17-generic 3.11.3
Uname: Linux 3.11.0-11-generic x86_64
ApportVersion: 2.12.5-0ubuntu1
Architecture: amd64
Date: Sun Oct 6 15:01:23 2013
ExecutablePath: /usr/lib/udisks2/udisksd
InstallationDate: Installed on 2013-10-02 (5 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Beta amd64 (20130925.1)
MachineType: Dell Inc. XPS 2720
MarkForUpload: True
ProcCmdline: /usr/lib/udisks2/udisksd --no-debug
ProcEnviron:

ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-3.11.0-11-generic.efi.signed root=/dev/mapper/ubuntu--vg-root ro quiet splash
SegvAnalysis:
 Segfault happened at: 0x4348a5: mov (%rax),%ebp
 PC (0x004348a5) ok
 source "(%rax)" (0x00000000) not located in a known VMA region (needed readable region)!
 destination "%ebp" ok
 Stack memory exhausted (SP below stack segment)
SegvReason: reading NULL VMA
Signal: 11
SourcePackage: udisks2
StacktraceTop:
 ?? ()
 ?? ()
 ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
 ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
 g_cclosure_marshal_generic () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
Title: udisksd crashed with SIGSEGV in ffi_call_unix64()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

dmi.bios.date: 03/28/2013
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A00
dmi.board.name: 05R2TK
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 13
dmi.chassis.vendor: Dell Inc.
dmi.chassis.version: 00
dmi.modalias: dmi:bvnDellInc.:bvrA00:bd03/28/2013:svnDellInc.:pnXPS2720:pvr00:rvnDellInc.:rn05R2TK:rvrA00:cvnDellInc.:ct13:cvr00:
dmi.product.name: XPS 2720
dmi.product.version: 00
dmi.sys.vendor: Dell Inc.

Revision history for this message
In , Tbzatek (tbzatek) wrote :

Created attachment 79966
[PATCH] Use GOnce for interface type registration

In certain cases, randomly, udisksd was failing with the following messages:

> (udisksd:10020): GLib-GObject-WARNING **: cannot register existing type `PolkitSubject'
> (udisksd:10020): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed
> (udisksd:10020): GLib-GObject-WARNING **: invalid cast from `PolkitSystemBusName' to `<invalid>'
> (udisksd:10020): GLib-GObject-WARNING **: cannot register existing type `PolkitSubject'
> (udisksd:10020): GLib-GObject-WARNING **: cannot register existing type `PolkitSubject'
> (udisksd:10020): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed
> (udisksd:10020): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed
> ** (udisksd:10020): CRITICAL **: polkit_authority_check_authorization_sync: assertion `POLKIT_IS_SUBJECT (subject)' failed
> ** (udisksd:10020): CRITICAL **: polkit_authority_check_authorization_sync: assertion `POLKIT_IS_SUBJECT (subject)' failed

Further debugging showed missing locking in polkit_subject_get_type() and potential race explaining the first GObject warning.

The attached patch makes the type registration use modern conventions with GOnce.

Revision history for this message
In , Colin Walters (walters) wrote :

Looks good. I amended the patch to include a link back to this bug.

http://cgit.freedesktop.org/polkit/commit/?id=20ad116a6582e57d20f9d8197758947918753a4c

Revision history for this message
In , Hans de Goede (j-w-r-degoede) wrote :

I can confirm that this patch fixes my reproducable udisksd crashes.

Revision history for this message
In , Zeuthen (zeuthen) wrote :

Nice catch guys, thanks for fixing this!

Revision history for this message
Bert Vorenholt (bert-vorenholt-nl) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 udisks_daemon_util_check_authorization_sync (daemon=daemon@entry=0x1049640, object=<optimized out>, action_id=action_id@entry=0x442008 "org.freedesktop.udisks2.ata-check-power", options=options@entry=0x1170a40, message=message@entry=0x441fc8 "Authentication is required to check power state for $(drive)", invocation=invocation@entry=0x7fe43000ad90) at udisksdaemonutil.c:680
 handle_pm_get_state (_drive=0x10c2990, invocation=0x7fe43000ad90, options=0x1170a40) at udiskslinuxdriveata.c:1232
 ffi_call_unix64 () at ../src/x86/unix64.S:76
 ffi_call (cif=cif@entry=0x7fe43cea6970, fn=0x4271a0 <handle_pm_get_state>, rvalue=0x7fe43cea68e0, avalue=avalue@entry=0x7fe43cea6880) at ../src/x86/ffi64.c:522
 g_cclosure_marshal_generic (closure=0x10bec90, return_gvalue=0x7fe43cea6ac0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x4271a0 <handle_pm_get_state>) at /build/buildd/glib2.0-2.38.0/./gobject/gclosure.c:1454

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in udisks2 (Ubuntu):
importance: Undecided → Medium
summary: - udisksd crashed with SIGSEGV in ffi_call_unix64()
+ udisksd crashed with SIGSEGV in
+ udisks_daemon_util_check_authorization_sync()
tags: removed: need-amd64-retrace
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in udisks2 (Ubuntu):
status: New → Confirmed
affects: udisks2 (Ubuntu) → policykit-1 (Ubuntu)
Changed in policykit-1 (Ubuntu):
importance: Medium → High
status: Confirmed → In Progress
information type: Private → Public
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package policykit-1 - 0.105-4ubuntu2

---------------
policykit-1 (0.105-4ubuntu2) trusty; urgency=medium

  * debian/patches/git_type_registration.patch:
    "Use GOnce for interface type registration. Static local variable may not
     be enough since it doesn't provide locking."
     That should fix some frequent udisks segfaults issues (lp: #1236510)
 -- Sebastien Bacher <email address hidden> Tue, 11 Feb 2014 19:26:03 +0100

Changed in policykit-1 (Ubuntu):
status: In Progress → Fix Released
Changed in policykit:
importance: Unknown → High
status: Unknown → Fix Released
Changed in policykit-1 (Fedora):
importance: Unknown → Undecided
status: Unknown → Fix Released
To post a comment you must log in.