Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* "finish" command leads to SIGTRAP
@ 2019-02-21 11:21 David Griffiths
  2019-02-21 11:24 ` Pedro Alves
  0 siblings, 1 reply; 15+ messages in thread
From: David Griffiths @ 2019-02-21 11:21 UTC (permalink / raw)
  To: gdb

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>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-02-22 17:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 11:21 "finish" command leads to SIGTRAP David Griffiths
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox