From: David Griffiths <dgriffiths@undo.io>
To: gdb@sourceware.org
Subject: "finish" command leads to SIGTRAP
Date: Thu, 21 Feb 2019 11:21:00 -0000 [thread overview]
Message-ID: <CA++j6c7bhP7=AWWdzBajC7KUah1gwj25-Bpoqd1-Xs_67z5kVw@mail.gmail.com> (raw)
I have a strange situation where issuing the "finish" command always leads
to a SIGTRAP (this is gdb 8.1 on Ubuntu 16.04). Once this SIGTRAP occurs
every continue also produces SIGTRAP. Completely reproducible. In the run
up to the finish I'm doing single steps from a previous breakpoint:
=====
(gdb) display/i $pc
1: x/i $pc
=> 0x7fffe1923b84: movabs $0x7ffff6d33b00,%r10
(gdb) si
0x00007fffe1923b8e in ?? ()
1: x/i $pc
=> 0x7fffe1923b8e: callq *%r10
(gdb)
0x00007ffff6d33b00 in os::javaTimeMillis() () from
/mnt/hgfs/david/jdk8u/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
1: x/i $pc
=> 0x7ffff6d33b00 <_ZN2os14javaTimeMillisEv>: push %rbp
(gdb) finish
Run till exit from #0 0x00007ffff6d33b00 in os::javaTimeMillis() () from
/mnt/hgfs/david/jdk8u/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
Thread 2 "java" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff6d33b01 in os::javaTimeMillis() () from
/mnt/hgfs/david/jdk8u/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
1: x/i $pc
=> 0x7ffff6d33b01 <_ZN2os14javaTimeMillisEv+1>: xor %esi,%esi
(gdb) c
Continuing.
Thread 2 "java" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff6d33b03 in os::javaTimeMillis() () from
/mnt/hgfs/david/jdk8u/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
1: x/i $pc
=> 0x7ffff6d33b03 <_ZN2os14javaTimeMillisEv+3>: mov %rsp,%rbp
=====
Even more strangely I can execute finish on that function in general, e.g.
if I set a breakpoint on it:
=====
(gdb) br os::javaTimeMillis
Breakpoint 1 at 0x7ffff6d33b00
(gdb) c
Continuing.
[Switching to Thread 0x7ffff7fd8700 (LWP 12502)]
Thread 2 "java" hit Breakpoint 1, 0x00007ffff6d33b00 in
os::javaTimeMillis() () from
/mnt/hgfs/david/jdk8u/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
(gdb) finish
Run till exit from #0 0x00007ffff6d33b00 in os::javaTimeMillis() () from
/mnt/hgfs/david/jdk8u/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
0x00007fffe1b4f75c in ?? ()
(gdb)
=====
So there must be something about the environment when it occurs but I don't
know what. And by the way the code runs fine without the finish/single
steps/etc.
I need it to work because I'm trying to automate something via gdb/MI. Any
suggestions as to how to debug this would be very welcome.
Thanks,
David
--
David Griffiths, Senior Software Engineer
Undo <https://undo.io> | Resolve even the most challenging software defects
with software flight recorder technology
Software reliability report: optimizing the software supplier and customer
relationship
<https://info.undo.io/software-reliability-report-optimizing-supplier-and-customer-relationship>
next reply other threads:[~2019-02-21 11:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-21 11:21 David Griffiths [this message]
2019-02-21 11:24 ` Pedro Alves
2019-02-21 12:13 ` David Griffiths
2019-02-21 12:17 ` David Griffiths
2019-02-21 13:12 ` Pedro Alves
2019-02-21 15:55 ` David Griffiths
2019-02-21 17:50 ` Pedro Alves
2019-02-21 18:03 ` Pedro Alves
2019-02-21 18:22 ` David Griffiths
2019-02-21 18:50 ` John Baldwin
2019-02-21 19:34 ` Pedro Alves
2019-02-21 20:50 ` John Baldwin
2019-02-22 15:09 ` Pedro Alves
2019-02-22 16:42 ` John Baldwin
2019-02-22 17:38 ` David Griffiths
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='CA++j6c7bhP7=AWWdzBajC7KUah1gwj25-Bpoqd1-Xs_67z5kVw@mail.gmail.com' \
--to=dgriffiths@undo.io \
--cc=gdb@sourceware.org \
/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