systemd crashes with Assertion 'current[*l + 1] == quotechars[0]' failed at ../src/shared/util.c:583 with invalid line break escapes

Bug #1447243 reported by Martin Pitt
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
High
Martin Pitt
Vivid
Fix Released
High
Martin Pitt

Bug Description

Reproducer:
 - Boot current vivid amd64 VM
 - sudo add-apt-repository ppa:maas-maintainers/experimental
 - sudo apt update
 - sudo apt install isc-dhcp-server
 - sudo apt install maas-dhcp

SRU TEST CASE (do this in a VM!)
 - Create a /lib/systemd/system/broken.service with the contents as in comment 7. Make sure that there is a trailing space after the "true \ " (Launchpad filtered that out in the comment!).
 - sudo systemctl status broken.service
 - This crashes pid 1 in vivid final, and should just complain a broken .service file with the fix.

ProblemType: Crash
DistroRelease: Ubuntu 15.04
Package: systemd 219-7ubuntu3
ProcVersionSignature: Ubuntu 3.19.0-15.15-generic 3.19.3
Uname: Linux 3.19.0-15-generic x86_64
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
Date: Wed Apr 22 17:04:42 2015
ExecutablePath: /lib/systemd/systemd
ExecutableTimestamp: 1429391580
Lsusb: Error: command ['lsusb'] failed with exit code 1: unable to initialize libusb: -99
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
ProcCmdline: /sbin/init
ProcCwd: /
ProcEnviron:
 TERM=linux
 PATH=(custom, no user)
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.19.0-15-generic root=UUID=6a708076-c5ee-4e4f-998a-4aa5ed4c3850 ro console=ttyS0
Signal: 6
SourcePackage: systemd
SystemdFailedUnits: Error: command ['systemctl', 'status', '--full', 'Error:'] failed with exit code 1: Failed to get properties: Activation of org.freedesktop.systemd1 timed out
UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: 1.7.5-20150306_163512-brownie
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.version: pc-i440fx-utopic
dmi.modalias: dmi:bvnSeaBIOS:bvr1.7.5-20150306_163512-brownie:bd04/01/2014:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-utopic:cvnQEMU:ct1:cvrpc-i440fx-utopic:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.version: pc-i440fx-utopic
dmi.sys.vendor: QEMU

Revision history for this message
Martin Pitt (pitti) wrote :
information type: Private → Public
Changed in systemd (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → High
status: New → In Progress
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 : StacktraceTop.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
tags: removed: need-amd64-retrace
Martin Pitt (pitti)
description: updated
description: updated
Revision history for this message
Martin Pitt (pitti) wrote : Re: systemd crashes with Assertion 'current[*l + 1] == quotechars[0]' failed at ../src/shared/util.c:583,

Simpler reproducer which will not cause a crash:

$ cat test.service
[Unit]
Description=test

[Service]
ExecStart=/bin/sh -ec '\
    true \
    $Y'

$ sudo systemd-analyze verify test.service
Assertion 'current[*l + 1] == quotechars[0]' failed at ../src/shared/util.c:583, function split(). Aborting.

Revision history for this message
Martin Pitt (pitti) wrote :

This happens because there is/was a space after the \ in the second line. This is invalid shell, but instead of crashing, systemd should just fail the unit because of bad syntax.

summary: systemd crashes with Assertion 'current[*l + 1] == quotechars[0]' failed
- at ../src/shared/util.c:583,
+ at ../src/shared/util.c:583 with invalid line break escapes
Revision history for this message
Martin Pitt (pitti) wrote :
Martin Pitt (pitti)
description: updated
Martin Pitt (pitti)
tags: added: systemd-boot
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Martin, or anyone else affected,

Accepted systemd into vivid-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/219-7ubuntu4 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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Changed in systemd (Ubuntu Vivid):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

I ran the test case on the package from -proposed, and it works as expected now.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 219-7ubuntu4

---------------
systemd (219-7ubuntu4) vivid; urgency=medium

  * hwdb: Fix wireless switch on Dell Latitude (LP: #1441849)
  * Fix assertion crash when reading a service file with missing ' and
    trailing space. (LP: #1447243)
  * Fix double free crash in "systemctl enable" when calling update-rc.d and
    the latter fails. (LP: #1426588)
 -- Martin Pitt <email address hidden> Thu, 23 Apr 2015 11:14:16 +0100

Changed in systemd (Ubuntu Vivid):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for systemd 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.

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.