From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: Joel Brobecker <brobecker@adacore.com>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH V4 5/9] New probe type: DTrace USDT probes.
Date: Tue, 31 Mar 2015 17:29:00 -0000 [thread overview]
Message-ID: <87y4mdjcie.fsf@oracle.com> (raw)
In-Reply-To: <20150326175028.GA13867@adacore.com> (Joel Brobecker's message of "Thu, 26 Mar 2015 10:50:28 -0700")
Hi Joel.
> And once I had that fixed, the next issue that I looked at was:
>
> (gdb) b adainit
> Breakpoint 1 at 0x8051f03
> (gdb) run
> Starting program: /[...]/a
> [Thread debugging using libthread_db enabled]
> zsh: 12378 segmentation fault (core dumped) /[...]/gdb -q a
>
> This is where I'm getting even more out of my league, here.
> The SEGV happens on the following line:
>
> 377 uint32_t enabler_offset
> 378 = ((uint32_t *) eofftab)[DOF_UINT (dof, probe->dofpr_enoffidx) + i];
>
> I will debug that SIGSEGV in solaris, but the problem seems to be
> related to the DOF program embedded in your program, more than to the
> platform.
>
> Could you please send me your sparc-solaris reproducer?
Thanks for the offer to help! Sadly, the SEGV doesn't seem to
happen on sparc-solaris, it seems. Once I apply the patch above,
I pretty much get normal results back (yay!).
So, the problem appears to be specific to x86-solaris. I didn't know
the DOF program was embedded in the executable, but I suspect there is
a problem in its contents.
I just tried the following in a x86-solaris machine, using todays git
GDB:
$ uname -a
SunOS solaris-x86 5.11 11.1 i86pc i386 i86pc
$ cat > foo.d <<EOF
provider test {
probe progress__counter (char *, int);
};
EOF
$ cat > foo.c <<EOF
#include "foo.h"
int
main ()
{
char *name = "application";
int i = 0;
while (i < 10)
{
i++;
if (TEST_PROGRESS_COUNTER_ENABLED())
TEST_PROGRESS_COUNTER (name, i);
}
return 0;
}
EOF
$ dtrace -h -s foo.d -o foo.h
$ gcc -c foo.c
$ dtrace -G -s foo.d -o foo-p.o foo.o
$ gcc -o foo foo.o foo-p.o
$ gdb foo
[...]
(gdb) info probes
Type Provider Name Where Enabled Object
dtrace test progress-counter 0x08051024 unknown /export/home/jose/binutils-gdb/build/foo
(gdb) disas main
Dump of assembler code for function main:
0x08050fec <+0>: push %ebp
0x08050fed <+1>: mov %esp,%ebp
0x08050fef <+3>: and $0xfffffff0,%esp
0x08050ff2 <+6>: sub $0x20,%esp
0x08050ff5 <+9>: movl $0x80514f0,0x18(%esp)
0x08050ffd <+17>: movl $0x0,0x1c(%esp)
0x08051005 <+25>: jmp 0x8051029 <main+61>
0x08051007 <+27>: addl $0x1,0x1c(%esp)
0x0805100c <+32>: xor %eax,%eax
0x0805100e <+34>: nop
0x0805100f <+35>: nop
0x08051010 <+36>: nop
0x08051011 <+37>: test %eax,%eax
0x08051013 <+39>: je 0x8051029 <main+61>
0x08051015 <+41>: mov 0x1c(%esp),%eax
0x08051019 <+45>: mov %eax,0x4(%esp)
0x0805101d <+49>: mov 0x18(%esp),%eax
0x08051021 <+53>: mov %eax,(%esp)
0x08051024 <+56>: nop
0x08051025 <+57>: nop
0x08051026 <+58>: nop
0x08051027 <+59>: nop
0x08051028 <+60>: nop
0x08051029 <+61>: cmpl $0x9,0x1c(%esp)
0x0805102e <+66>: jle 0x8051007 <main+27>
0x08051030 <+68>: mov $0x0,%eax
0x08051035 <+73>: leave
0x08051036 <+74>: ret
End of assembler dump.
(gdb)
In this system DTrace generates little-endian DOF data, and it looks
like GDB handles it just fine. I still think the problem you observed
is related to endianness, but I cannot be sure without looking at the
contents of the DOF program embedded in your binaries...
next prev parent reply other threads:[~2015-03-31 17:29 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 10:57 [PATCH V4 0/9] Add support for DTrace USDT probes to gdb Jose E. Marchesi
2015-02-02 10:57 ` [PATCH V4 7/9] Simple testsuite for DTrace USDT probes Jose E. Marchesi
2015-02-02 11:18 ` Jose E. Marchesi
2015-02-17 1:53 ` Sergio Durigan Junior
2015-02-17 1:58 ` Sergio Durigan Junior
2015-02-17 11:32 ` Pedro Alves
2015-02-02 10:57 ` [PATCH V4 9/9] Announce the DTrace USDT probes support in NEWS Jose E. Marchesi
2015-02-02 16:03 ` Eli Zaretskii
2015-02-02 10:57 ` [PATCH V4 1/9] Adapt `info probes' to support printing probes of different types Jose E. Marchesi
2015-02-17 1:12 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 3/9] New commands `enable probe' and `disable probe' Jose E. Marchesi
2015-02-02 16:01 ` Eli Zaretskii
2015-02-17 1:54 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 2/9] Move `compute_probe_arg' and `compile_probe_arg' to probe.c Jose E. Marchesi
2015-02-17 1:13 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 8/9] Documentation for DTrace USDT probes Jose E. Marchesi
2015-02-02 16:03 ` Eli Zaretskii
2015-02-02 19:47 ` Jose E. Marchesi
2015-02-02 10:57 ` [PATCH V4 5/9] New probe type: " Jose E. Marchesi
2015-02-17 1:35 ` Sergio Durigan Junior
2015-03-25 19:14 ` Joel Brobecker
2015-03-26 16:15 ` Jose E. Marchesi
2015-03-26 17:50 ` Joel Brobecker
2015-03-26 18:43 ` Joel Brobecker
2015-03-26 18:53 ` Sergio Durigan Junior
2015-03-26 21:00 ` Joel Brobecker
2015-03-27 9:47 ` gdb fails to compile with GCC 4.4.7 (was: [PATCH V4 5/9] New probe type: DTrace USDT probes.) Tobias Burnus
2015-03-27 13:42 ` Joel Brobecker
2015-03-27 15:18 ` Tobias Burnus
2015-03-27 15:27 ` [pushed] " Joel Brobecker
2015-03-27 16:58 ` H.J. Lu
2015-03-26 23:39 ` [PATCH V4 5/9] New probe type: DTrace USDT probes Jose E. Marchesi
2015-03-31 17:29 ` Jose E. Marchesi [this message]
2015-03-31 18:47 ` Joel Brobecker
2015-03-31 19:54 ` Jose E. Marchesi
2015-08-06 21:31 ` Joel Brobecker
2015-08-07 2:03 ` Sergio Durigan Junior
2015-08-07 15:20 ` Joel Brobecker
2015-08-07 13:05 ` Jose E. Marchesi
2015-08-07 13:14 ` Jose E. Marchesi
2015-08-07 14:11 ` Jose E. Marchesi
2015-08-07 15:12 ` Joel Brobecker
2015-08-10 3:21 ` Sergio Durigan Junior
2015-08-10 14:31 ` Jose E. Marchesi
2015-02-02 10:57 ` [PATCH V4 4/9] New gdbarch functions: dtrace_parse_probe_argument, dtrace_probe_is_enabled, dtrace_enable_probe, dtrace_disable_probe Jose E. Marchesi
2015-02-17 1:14 ` Sergio Durigan Junior
2015-02-02 10:57 ` [PATCH V4 6/9] Support for DTrace USDT probes in x86_64 targets Jose E. Marchesi
2015-02-17 1:37 ` Sergio Durigan Junior
2015-02-16 13:20 ` [PATCH V4 0/9] Add support for DTrace USDT probes to gdb Jose E. Marchesi
2015-02-17 1:57 ` Sergio Durigan Junior
2015-02-17 11:56 ` Jose E. Marchesi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y4mdjcie.fsf@oracle.com \
--to=jose.marchesi@oracle.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox