Please backport fix for bugs.debian.org/827015

Bug #1748597 reported by David Bartley
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libunwind (Debian)
Fix Released
Unknown
libunwind (Ubuntu)
Medium
Unassigned
Trusty
Medium
Unassigned
Xenial
Medium
Unassigned

Bug Description

[Impact]
When a C++ exception is thrown with libunwind linked in, the signal mask is corrupted.

For MongoDB, if the CPU profiler is enabled (which requires linking libunwind), any exception that is raised within the server may cause random signals to become unblocked on a thread. If SIGTERM becomes unblocked on any thread but the main thread, the server won't exit cleanly (this is particularly evident when running the MongoDB test suite, which starts/stops servers repeatedly).

This also seems to impact Pyston: https://lab.nexedi.com/Daetalus/Pyston/commit/1bac7510861a112a9023f821bf3e857a6fb45037

[Test Case]
I've attached the test case from the upstream Debian bug (https://bugs.debian.org/827015).

$ g++ sigtest.cpp -lpthread
$ ./a.out
Signals blocked: 1 (Hangup) 65 (Unknown signal 65)
Throw exception
Signals blocked: 1 (Hangup) 65 (Unknown signal 65)

$ g++ sigtest.cpp -lpthread -lunwind
$ ./a.out
Signals blocked: 1 (Hangup) 65 (Unknown signal 65)
Throw exception
Signals blocked: 7 (Bus error) 8 (Floating point exception) 10 (User defined signal 1) 12 (User defined signal 2) 13 (Broken pipe) 15 (Terminated) 17 (Child exited) 20 (Stopped)21 (Stopped (tty input)) 25 (File size limit exceeded) 26 (Virtual timer expired) 27 (Profiling timer expired) 28 (Window changed) 29 (I/O possible) 30 (Power failure) 31 (Bad system call) 32 (Unknown signal 32) 33 (Unknown signal 33) 34 (Real-time signal 0) 35 (Real-time signal 1) 36 (Real-time signal 2) 37 (Real-time signal 3) 38 (Real-time signal 4) 39 (Real-time signal 5) 40 (Real-time signal 6) 41 (Real-time signal 7) 42 (Real-time signal 8) 43 (Real-time signal 9) 44 (Real-time signal 10) 45 (Real-time signal 11) 46 (Real-time signal 12) 47 (Real-time signal 13) 65 (Unknown signal 65)

[Regression Potential]
This fix is already present in bionic and Debian testing, and has been for a couple months. The upstream fix has existed for over a year.

David Bartley (dtbartle)
description: updated
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for taking your time to report this issue and help making Ubuntu better.

Could you take a look at the steps for Stable Release Updates ( https://wiki.ubuntu.com/StableReleaseUpdates#Procedure) and update the description? :)

Revision history for this message
David Bartley (dtbartle) wrote :
Revision history for this message
David Bartley (dtbartle) wrote :
description: updated
Revision history for this message
David Bartley (dtbartle) wrote :
Revision history for this message
David Bartley (dtbartle) wrote :

Thanks, I've updated the description to outline the impact, and attached the two patches from the upstream Debian package that should be applied.

Changed in libunwind (Debian):
status: Unknown → Fix Released
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-x86_64-Use-sigprocmask-from-signal-frames.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
David Bartley (dtbartle)
description: updated
Revision history for this message
David Bartley (dtbartle) wrote :
Revision history for this message
David Bartley (dtbartle) wrote :

I've attached debdiff's for trusty and xenial, if that's helpful.

Revision history for this message
David Bartley (dtbartle) wrote :
James Page (james-page)
Changed in libunwind (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
status: Triaged → Fix Released
Changed in libunwind (Ubuntu Xenial):
status: New → Triaged
Changed in libunwind (Ubuntu Trusty):
importance: Undecided → Medium
Changed in libunwind (Ubuntu Xenial):
importance: Undecided → Medium
Changed in libunwind (Ubuntu Trusty):
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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