Bug #7295
closedpowertop dumps core when -c, -d or -t flags are used
100%
Description
# powertop -t1 Segmentation Fault (core dumped)
This used to work previously. The analysis from Richard Lowe:
---
We used to treat optarg as common via a copy relocation (ie, we'd copy
the contents into the executable at link-edit, then relocate everyone to
use our copy). Now we shadow. (You can confirm this via elfdump -y,
the 'C' flag)
This is because when libc is built by studio, optarg lands in .data,
initialized to "\0", so we move it to the executable common, and set up
a copy relocation to copy the initialized data at runtime, and then
relocate all references (including libc), to this copy in our bss.
When libc is built by gcc, optarg lands in .bss (automatically
initialized), none of this happens. The version in the executable
shadows the one in libc.
We decide how to do this at link-edit time. What matters is not the
libc we bind at runtime, but the libc that the link-editor sees at that
time. (ie, in this case, the one in 134, with optarg in .data)
---
Related issues
Updated by Yuri Pankov almost 6 years ago
- Has duplicate Bug #6003: powertop dumps core when given any arguments added
Updated by Electric Monk over 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 50 to 100
git commit 37706db998822da2eb5ef6e8b2a5a3dfaec268fb
commit 37706db998822da2eb5ef6e8b2a5a3dfaec268fb Author: Yuri Pankov <yuri.pankov@nexenta.com> Date: 2016-08-16T23:43:59.000Z 7295 powertop dumps core when -c, -d or -t flags are used Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Peter Tribble <peter.tribble@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com>