This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/6871] uprobes $context values often wrong
- From: "jkenisto at us dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 10 Sep 2008 23:27:08 -0000
- Subject: [Bug translator/6871] uprobes $context values often wrong
- References: <20080906145153.6871.fche@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From jkenisto at us dot ibm dot com 2008-09-10 23:27 -------
Here's some evidence that it's NOT a uprobes problem. I noticed it while
testing my version of uprobes that's modified to work with the new utrace. This
was on i386.
Here's a program to probe:
----- probeme.c -----
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#define noinline __attribute__((noinline))
noinline static int add(int n1, int n2)
{
asm volatile("");
return n1 + n2;
}
main()
{
int n1, n2;
fprintf(stderr, "pid=%d vaddr=%p\n", getpid(), add);
while (scanf("%d %d", &n1, &n2) == 2) {
printf("%d + %d = %d\n", n1, n2, add(n1, n2));
}
exit(0);
}
-----
The following script reports incorrect values:
----- ustap4.stp -----
probe process("/home/jimk/.../probeme").function("add") {
printf("%d + %d\n", $n1, $n2)
}
-----
... while the following script reports correct values:
----- ustap5.stp -----
probe process("/home/jimk/.../probeme").function("add") {
printf("%d + %d\n", int_arg(1), int_arg(2))
}
-----
Similarly, if I recompile probeme.c with -mregparm=3, $n1 and $n2 yield
incorrect values, but int_arg(1) and int_arg(2) yield correct values if I stick
a "regparm(3)" call in front of the printf in the script.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6871
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.