Bug 1051221 - Untraced symbols cause SIGSEGV in some PPC64 binaries
Summary: Untraced symbols cause SIGSEGV in some PPC64 binaries
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ltrace
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Petr Machata
QA Contact: Michael Petlan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-09 21:21 UTC by Petr Machata
Modified: 2015-05-05 01:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 13:19:37 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Petr Machata 2014-01-09 21:21:22 UTC
Description of problem:
I see this on my PPC64 box:

$ ltrace -f -e __libc_start_main -- /bin/true 
[pid 19908] true->__libc_start_main(1, 0xfffd4369c88, 0xfffd4369c98, 0xfffd4369de0breakpoint_on_continue 0x10003cc0 __libc_start_main
 <no return ...>
[pid 19908] --- SIGSEGV (Segmentation fault) ---
[pid 19908] +++ killed by SIGSEGV +++

But when I request tracing of all symbols that are actually called:

$ ltrace -f -e __libc_start_main+exit -- /bin/true 
[pid 19935] true->__libc_start_main(1, 0xffff1c4adf8, 0xffff1c4ae08, 0xffff1c4af50b <unfinished ...>
[pid 19935] true->exit(0, 0xffff1c4adf8, 0xffff1c4ae08, 0xffff1c4af50 <no return ...>
[pid 19935] +++ exited (status 0) +++

I think the problem might be in the part of the PPC64 backend that does unprelinking, but couldn't reproduce this on handcrafted binaries.

Version-Release number of selected component (if applicable):
0.7.91-4

Comment 1 Petr Machata 2014-01-10 19:34:39 UTC
This is now fixed in upstream as well as in Fedora.  The problem was indeed in unprelinking.

Comment 2 Petr Machata 2014-01-10 19:43:03 UTC
The problem can be reproduced as follows:

$ cat w.c
int main (void) {
  puts("ble");
}
$ gcc w.c 
$ strip a.out 
$ prelink ./a.out 

# This works:
$ ./ltrace  ~/tmp/a.out 
__libc_start_main(1, 0xfffc73b1f78, 0xfffc73b1f88, 0xfffc73b20d0 <unfinished ...>
puts(0x10000740, 0xfffc73b1f78, 0xfffc73b1f88, 0xfffc73b20d0ble
)                                    = 4
+++ exited (status 48) +++

# This doesn't:
$ ltrace -e __libc_start_main ./a.out 
a.out->__libc_start_main(1, 0xfffdf3d3368, 0xfffdf3d3378, 0xfffdf3d34c0 <no return ...>
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

Comment 4 Michael Petlan 2014-02-13 15:08:13 UTC
Tested with ltrace-0.7.91-4 (reproduced) and ltrace-0.7.91-[56] (works well).

VERIFIED.

Comment 5 Ludek Smid 2014-06-13 13:19:37 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.