perl crashed with SIGABRT in _dbus_abort()

Bug #1743216 reported by Carlos Gomes
122
This bug affects 27 people
Affects Status Importance Assigned to Milestone
xdg-utils (Debian)
Fix Released
Unknown
xdg-utils (Ubuntu)
Fix Released
High
Iain Lane
Bionic
Fix Released
High
Iain Lane
Cosmic
Fix Released
High
Iain Lane

Bug Description

[ Description ]

When xdg-screensaver suspend <wid> refers to a window with invalid UTF-8 in its title, it will spawn a perl process that crashes with an assertion:

  dbus[19455]: arguments to dbus_message_iter_append_basic() were incorrect, assertion "_dbus_check_is_valid_utf8 (*string_p)" failed in file ../../../dbus/dbus-message.c line 2754.
  This is normally a bug in some application using the D-Bus library.

[ Fix ]

Use decode() from the Encode module to replace invalid character sequences with U+FFFD, the replacement symbol. This is not a new dependency as Encode has been a perl core module since 5.8.

[ QA ]

I don't know how to get a window with such a title, so we can do two things.

1)

1. $ sudo -e $(which xdg-screensaver) # hack the script
2. Find the line "# Inhibit idle detection (flags = 8) with window name and ID."
3. Find the } on its own above that. Insert a new line afterwards and set the window name to be the same as the one in this bug, by pasting the code
  $window_name = "\253\062\065 Meter fehlten bis zur Katastrophe\273 - News Panorama: Vermischtes - tagesanzeiger.ch - Mozilla Firefox";
4. Save and exit
5. $ xwininfo
6. click some window, and copy the "Window id", which will be 0x<something>
7. $ xdg-screensaver suspend <that window id>

In the bad case (before this bug is fixed) it should crash, and in the good case it should work.

8. Undo what you just did by running $ xdg-screensaver resume <that window id>

2)

Observe that the error bucket

  https://errors.ubuntu.com/problem/b386f287972198daca290969b0ea5182ce8e5d52

has a reduction in report rate with the new versions.

[ Regression potential ]

If the code is bad then the window name passed to Inhibit() could be wrong. That shouldn't matter too much.

If it is really bad then the program might crash for everybody and we'll see an increase in errors.

[ Original description ]

Errors Bucket
-------------
https://errors.ubuntu.com/problem/b386f287972198daca290969b0ea5182ce8e5d52

crashed after launching the software updater

ProblemType: CrashDistroRelease: Ubuntu 18.04
Package: perl-base 5.26.1-4
ProcVersionSignature: Ubuntu 4.14.0-16.19-generic 4.14.12
Uname: Linux 4.14.0-16-generic x86_64
ApportVersion: 2.20.8-0ubuntu6
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Jan 14 13:30:52 2018
ExecutablePath: /usr/bin/perl
InstallationDate: Installed on 2017-12-28 (17 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20171201)
Signal: 6SourcePackage: perl
StacktraceTop:
 _dbus_abort () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 _dbus_warn_check_failed () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 dbus_message_iter_append_basic () from /lib/x86_64-linux-gnu/libdbus-1.so.3
 ?? () from /usr/lib/x86_64-linux-gnu/perl5/5.26/auto/Net/DBus/DBus.so
 Perl_pp_entersub ()
Title: perl crashed with SIGABRT in _dbus_abort()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo

Revision history for this message
Carlos Gomes (gocarlos) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 _dbus_abort () at ../../../dbus/dbus-sysdeps.c:93
 _dbus_warn_check_failed (format=format@entry=0x7f67696eb7c8 "arguments to %s() were incorrect, assertion \"%s\" failed in file %s line %d.\nThis is normally a bug in some application using the D-Bus library.\n") at ../../../dbus/dbus-internals.c:281
 _dbus_warn_return_if_fail (function=function@entry=0x7f67696ea1b0 <__func__.5319> "dbus_message_iter_append_basic", assertion=assertion@entry=0x7f67696e94b8 "_dbus_check_is_valid_utf8 (*string_p)", file=file@entry=0x7f67696e9a1d "../../../dbus/dbus-message.c", line=line@entry=2754) at ../../../dbus/dbus-internals.c:936
 dbus_message_iter_append_basic (iter=0x55e5b0ba6530, type=type@entry=115, value=value@entry=0x7ffd7fe845b0) at ../../../dbus/dbus-message.c:2754
 XS_Net__DBus__Binding__Iterator_append_string (my_perl=<optimized out>, cv=<optimized out>) at DBus.xs:1543

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 perl (Ubuntu):
importance: Undecided → Medium
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 perl (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

The ProcCmdline.txt file in this bug report, and some of its duplicates (I didn't check them all), are quite strange.

information type: Private → Public
Changed in perl (Ubuntu):
importance: Medium → High
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote :

The perl code is actually from xdg-screensaver.

Changed in xdg-utils (Ubuntu):
status: New → Confirmed
importance: Undecided → High
tags: added: regression-release
removed: package-from-proposed
Changed in xdg-utils (Ubuntu):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
tags: added: rls-cc-incoming
Will Cooke (willcooke)
Changed in xdg-utils (Ubuntu):
assignee: Canonical Desktop Team (canonical-desktop-team) → Iain Lane (laney)
tags: added: rls-cc-tracking
removed: rls-cc-incoming
Iain Lane (laney)
Changed in perl (Ubuntu Cosmic):
status: Confirmed → Invalid
Changed in xdg-utils (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → Iain Lane (laney)
Iain Lane (laney)
description: updated
Iain Lane (laney)
description: updated
Revision history for this message
Iain Lane (laney) wrote :

OK, I think I understood it properly and these uploads (which are waiting in the queues currently) should fix it.

Changed in xdg-utils (Ubuntu Cosmic):
status: Confirmed → In Progress
affects: perl (Debian) → xdg-utils (Debian)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-utils - 1.1.3-1ubuntu2

---------------
xdg-utils (1.1.3-1ubuntu2) cosmic; urgency=medium

  * Use perl's decode() to ensure we don't pass invalid UTF-8 to D-Bus, as
    doing so triggers an assertion from libdbus which makes us crash. LP:
    #1743216 (Debian #910070, Upstream #108121)

 -- Iain Lane <email address hidden> Tue, 02 Oct 2018 11:11:16 +0100

Changed in xdg-utils (Ubuntu Cosmic):
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Carlos, or anyone else affected,

Accepted xdg-utils into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/xdg-utils/1.1.2-1ubuntu2.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in xdg-utils (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in perl (Ubuntu Bionic):
status: New → Confirmed
Revision history for this message
Iain Lane (laney) wrote :

Would somebody like to verify this upload?

Revision history for this message
Brian Murray (brian-murray) wrote :

Normally I would query the Error Tracker database to figure out if this is resolved but information about the version of xdg-utils installed does not appear in the crash reports there.

Revision history for this message
Hans Deragon (deragon) wrote :

I installed xdg-utils 1.1.2-1ubuntu2.3 from Ubuntu:18.04/bionic-proposed. We will see if it still crashes or not. Thank you Iain for your work.

Mathew Hodson (mhodson)
Changed in xdg-utils (Ubuntu Bionic):
importance: Undecided → High
no longer affects: perl (Ubuntu)
no longer affects: perl (Ubuntu Bionic)
no longer affects: perl (Ubuntu Cosmic)
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I performed the verification with xdg-utils 1.1.2-1ubuntu2.3 from bionic-proposed and the test case in the description. I get the same crash (https://errors.ubuntu.com/oops/8f6e9f06-e19e-11e8-a0af-fa163e6cac46)

Marking as verification-failed.

tags: added: verification-failed-bionic
removed: verification-needed-bionic
tags: added: verification-failed
removed: verification-needed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Actually I did a mistake when I updated xdg-screensaver. with $window_name set at the right location there is no more crash with the version from proposed.
Marking as verification-done

tags: added: verification-done verification-done-bionic
removed: verification-failed verification-failed-bionic
Revision history for this message
Hans Deragon (deragon) wrote :

I confirm that since I installed xdg-utils 1.1.2-1ubuntu2.3 from Ubuntu:18.04/bionic-proposed, I have not gotten any crashes.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-utils - 1.1.2-1ubuntu2.3

---------------
xdg-utils (1.1.2-1ubuntu2.3) bionic; urgency=medium

  * Use perl's decode() to ensure we don't pass invalid UTF-8 to D-Bus, as
    doing so triggers an assertion from libdbus which makes us crash. LP:
    #1743216 (Debian #910070, Upstream #108121)

 -- Iain Lane <email address hidden> Tue, 02 Oct 2018 11:15:48 +0100

Changed in xdg-utils (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for xdg-utils has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in xdg-utils (Debian):
status: Unknown → Confirmed
Changed in xdg-utils (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.