qprof sends wrong values to addr2line on amd64

Bug #368292 reported by Walter
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qprof (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: qprof

On my Ubuntu/Hardy-AMD64 on a Pentium D, qprof reports invalid values that do not map to a real location.

Example:

walter@ananas:0:~/src/qprof-0.5.2$ /usr/bin/qprof ./tests/dumb_test
qprof: /home/walter/src/qprof-0.5.2/tests/dumb_test: 16 samples, 16 counts
[0x7fff3b347858] 16 (100%)

That should be:

walter@ananas:0:~/src/qprof-0.5.2$ /usr/local/bin/qprof ./tests/dumb_test
qprof: /home/walter/src/qprof-0.5.2/tests/dumb_test: 16 samples, 16 counts
main 16 (100%)

I've played around a bit with the sigcontext pointer, and it seems like I got it right by replacing (&si) with (scv + 40). I have too little knowledge of CPUs, ABI's and binary files in general to know why scv+40 is right, but in my preliminary tests, I got valuable output similar to that which I get on a i686 system (also Hardy).

Attached are:
qprof_bug_fix.patch - The one line patch that works for me
qprof_bug_cpuinfo.txt - cat /proc/cpuinfo
qprof_bug_gcc_dM_E.txt - gcc -dM -E - </dev/null

walter@ananas:0:~/src/qprof-0.5.2$ uname -a
Linux ananas.wjd.nu 2.6.24-23-generic #1 SMP Wed Apr 1 21:43:24 UTC 2009 x86_64 GNU/Linux
walter@ananas:0:~/src/qprof-0.5.2$ dpkg -l qprof | grep ii
ii qprof 0.5.2-5 Profiling utilities for Linux

That's about all the information I can think of. Please let me know if there's anything I can assist with.

Greetings,
Walter Doekes

Revision history for this message
Walter (wdoekes) wrote :
Revision history for this message
Walter (wdoekes) wrote :
Revision history for this message
Walter (wdoekes) wrote :
Revision history for this message
Walter (wdoekes) wrote :

The 40 makes sense now as well:

walter@ananas:0:~/srcelf/ucontext$ gcc qprof_bug_ucontext.c -g
walter@ananas:0:~/srcelf/ucontext$ ./a.out | addr2line
gregs is at extra + 40
/home/walter/srcelf/ucontext/main.c:18

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qprof (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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