Summary: | usymbols.exp 64-bit test failing on ppc64 | ||
---|---|---|---|
Product: | systemtap | Reporter: | David Smith <dsmith> |
Component: | runtime | Assignee: | Unassigned <systemtap> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | mark, phan, wcohen |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
David Smith
2011-03-10 19:42:47 UTC
Here's some additional information. In the 32-bit case (which works): # eu-readelf -s usymbols-m32 | fgrep main_handler 62: 1000059c 4 FUNC GLOBAL DEFAULT 12 main_handler # fgrep main_handler /tmp/stapVlnORz/stap-symbols.h { 0x1000059c, "main_handler" }, The above is good, stap's value of the symbol matches up with eu-readelf's value. When run under gdb, (gdb) p &main_handler $2 = (void (*)(int)) 0x1000059c <main_handler> That's good, gdb's idea of the symbol value also matches. # fgrep /usymbols-m32 /proc/9161/maps 10000000-10010000 r-xp 00000000 fd:00 2239275 /root/ppc64/testsuite/usymbols-m32 10010000-10020000 rw-p 00000000 fd:00 2239275 /root/ppc64/testsuite/usymbols-m32 That's good, 0x1000059c exists within that first executable vma. In the 64-bit case (which fails): # eu-readelf -s usymbols-m64 | fgrep main_handler 63: 0000000010010c48 16 FUNC GLOBAL DEFAULT 22 main_handler # fgrep main_handler /tmp/stapImPRwN/stap-symbols.h { 0x10010c48, "main_handler" }, That's good, the eu-readelf and stap values match. When run under gb, (gdb) p &main_handler $1 = (void (*)(int)) 0x10000700 <main_handler> That's bad - when run, somehow the address has changed. # fgrep /usymbols-m64 /proc/9183/maps 10000000-10010000 r-xp 00000000 fd:00 2239236 /root/ppc64/testsuite/usymbols-m64 10010000-10020000 rw-p 00000000 fd:00 2239236 /root/ppc64/testsuite/usymbols-m64 The 0x10010c48 address exists within that 2nd non-executable vma (the code in vma.c only looks at executable vmas), which is why the symbol lookup code fails. The gdb address (0x10000700) does exist within the 1st executable vma. Perhaps there is some relocation going on that systemtap needs to know about. (In reply to comment #1) > In the 64-bit case (which fails): > > # eu-readelf -s usymbols-m64 | fgrep main_handler > 63: 0000000010010c48 16 FUNC GLOBAL DEFAULT 22 main_handler > # fgrep main_handler /tmp/stapImPRwN/stap-symbols.h > { 0x10010c48, "main_handler" }, > > That's good, the eu-readelf and stap values match. > > When run under gb, > (gdb) p &main_handler > $1 = (void (*)(int)) 0x10000700 <main_handler> > > That's bad - when run, somehow the address has changed. > > # fgrep /usymbols-m64 /proc/9183/maps > 10000000-10010000 r-xp 00000000 fd:00 2239236 > /root/ppc64/testsuite/usymbols-m64 > 10010000-10020000 rw-p 00000000 fd:00 2239236 > /root/ppc64/testsuite/usymbols-m64 > > The 0x10010c48 address exists within that 2nd non-executable vma (the code in > vma.c only looks at executable vmas), which is why the symbol lookup code > fails. The gdb address (0x10000700) does exist within the 1st executable vma. > > Perhaps there is some relocation going on that systemtap needs to know about. The 0x10010c48 address is a pointer into the .odp table. So it is an indirect address to the real function address. We had a little discussion on making systemtap deal with that better on the mailinglist: http://sourceware.org/ml/systemtap/2011-q1/threads.html#00082 This is currently working on RHEL8 andRHEL9 for both ppc64le and s390x. |