This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Problems on glibc UTRACE
- From: Josh Stone <jistone at redhat dot com>
- To: systemtap at sourceware dot org
- Date: Mon, 24 Nov 2014 09:18:01 -0800
- Subject: Re: Problems on glibc UTRACE
- Authentication-results: sourceware.org; auth=none
- References: <CAAGCMMUWiK+v0p7mAEfKAFVZVD=o_8AKZqUG1tNX=52pdqdcjw at mail dot gmail dot com> <546F6AF7 dot 4080506 at redhat dot com> <CAAGCMMXrz3mQwQv6Q3U7fa4_7=qCoVWUk-dXGP9_gQrWTjfRjQ at mail dot gmail dot com> <5473512F dot 1090605 at redhat dot com>
On 11/24/2014 07:39 AM, David Smith wrote:
> So, I ran your test program and script and got similar results. So, I
> ran gdb on the test program. Here's what I get:
>
> ====
> Breakpoint 1, main () at testprog.c:10
> 10 ptr = malloc(10);
> (gdb) s
> __GI___libc_malloc (bytes=140737488347248) at malloc.c:2845
> =====
>
> Here are my breakpoints:
>
> =====
> (gdb) info b
> Num Type Disp Enb Address What
> 1 breakpoint keep y 0x00000000004005dd in main at testprog.c:10
> breakpoint already hit 1 time
> 2 breakpoint keep y 0x0000003ff7a7fca9 in __GI___libc_malloc
> at malloc.c:2849
> breakpoint already hit 2 times
> ====
>
> Also note that the 2nd breakpoint gets hit twice.
>
> So, since gdb and systemtap agree here, I think systemtap is operating
> correctly.
>
> Now, as to where the odd bytes value is coming from and why malloc is
> getting called twice, I don't really know. Perhaps some glibc oddity?
> glibc does some odd things with function wrappers, hooks, etc.
I don't know about getting called twice, but the odd value may be this:
https://bugzilla.redhat.com/show_bug.cgi?id=1151226
If so, stap -P ought to help by forcing a prologue search.