__nih_abort_msg symbol cannot be read any more
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-5 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
libnih (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
libnih has a global symbol __nih_abort_msg that contains the message of the last failed nih_assert() (similar to glibc's own __abort_msg and glib's __glib_assert_msg). Apport uses these to produce a more meaningful crash report than just "/bin/foo crashed with SIGABRT", as in these case the thing you actually want to see is the assertion message.
This stopped working in yakkety/amd64. apport's report.
ERROR: test_add_
add_gdb_info() with libnih assertion
-------
Traceback (most recent call last):
File "./test_report.py", line 886, in test_add_
self.
File "/usr/lib/
raise KeyError(key)
KeyError: 'AssertionMessage'
This can be reproduced with the attached script which compiles a trivial nih_assert() C program, runs it, and runs gdb on the produced core dump. Up until xenial it looks like:
$ ./nih-assert.sh
(null):<stdin>:2: Assertion failed in main: 1 < 0
Aborted (core dumped)
[New LWP 9838]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_
Core was generated by `./nih-assert'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007f28c070d418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/
54 ../sysdeps/
$1 = 0x25400f0 "<stdin>:2: Assertion failed in main: 1 < 0"
But in yakkety/amd64 it now looks like
$ ./nih-assert.sh
(null):<stdin>:2: Assertion failed in main: 1 < 0
Aborted (core dumped)
[New LWP 10489]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_
Core was generated by `./nih-assert'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007fd303865418 in __GI_raise (sig=sig@entry=6) at ../sysdeps/
54 ../sysdeps/
$1 = 0xffffffff869400f0 <error: Cannot access memory at address 0xffffffff869400f0>
This can be reproduced easily in a schroot, you need to install "libnih-dev pkg-config gdb".
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libnih-dev 1.0.3-4.3ubuntu1
ProcVersionSign
Uname: Linux 4.4.0-22-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: i3
Date: Wed May 11 15:13:46 2016
Dependencies:
gcc-6-base 6.0.1-0ubuntu1
libc6 2.23-0ubuntu3
libgcc1 1:6.0.1-0ubuntu1
libnih1 1.0.3-4.3ubuntu1
EcryptfsInUse: Yes
SourcePackage: libnih
UpgradeStatus: No upgrade log present (probably fresh install)
Neither libnih nor glibc changed in yakkety, but what did change is that gcc now applies the PIE option by default. Maybe libnih needs to be adjusted for PIE on amd64, or this needs to be fixed in gcc, thus adding a task for both for now.