public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled
@ 2014-05-29 14:55 konradsa at gmail dot com
2014-05-29 14:56 ` [Bug c++/16997] " konradsa at gmail dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: konradsa at gmail dot com @ 2014-05-29 14:55 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
Bug ID: 16997
Summary: Stepping hangs on gettimeofday with recording enabled
Product: gdb
Version: 7.7
Status: NEW
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: konradsa at gmail dot com
Consider this simple program:
#include <iostream>
#include <sys/time.h>
#include <time.h>
using namespace std;
int main() {
timeval now;
gettimeofday( &now, 0);
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
When stepping through the code with reverse debugging enabled (recording
enabled), gdb seems to hang on the gettimeofday call. Here some sample output:
(gdb) run
Starting program: /home12/skonrad/workspace-luna/gdbTest/Debug/gdbTest
Breakpoint 1, main () at ../src/gdbTest.cpp:18
18 gettimeofday( &now, 0);
(gdb) record
(gdb) n
Do you want to auto delete previous execution log entries when record/replay
buffer becomes full (record full stop-at-limit)?([y] or n) y
...
Waited for several minutes, step never completed. Without recording, no issue.
This was tested on RedHat Linux with g++ (GCC) 4.4.7 20120313 (Red Hat
4.4.7-3).
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16997] Stepping hangs on gettimeofday with recording enabled
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
@ 2014-05-29 14:56 ` konradsa at gmail dot com
2014-05-29 15:06 ` palves at redhat dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: konradsa at gmail dot com @ 2014-05-29 14:56 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
konradsa <konradsa at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |konradsa at gmail dot com
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16997] Stepping hangs on gettimeofday with recording enabled
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
2014-05-29 14:56 ` [Bug c++/16997] " konradsa at gmail dot com
@ 2014-05-29 15:06 ` palves at redhat dot com
2014-05-29 17:13 ` konradsa at gmail dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: palves at redhat dot com @ 2014-05-29 15:06 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
Pedro Alves <palves at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
CC| |palves at redhat dot com
--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
Try with "set debug lin-lwp 1" and "set debug infrun 1", which enables relevant
logging.
gettimeofday lives in the vDSO nowadays. Maybe it's something to do with
single-stepping in the vDSO. Recording behind the scenes single-steps the
programs one instruction at a time.
Can you do that manually, with "si", and confirm whether you can single-step
all the way across the vDSO (in and out) ?
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16997] Stepping hangs on gettimeofday with recording enabled
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
2014-05-29 14:56 ` [Bug c++/16997] " konradsa at gmail dot com
2014-05-29 15:06 ` palves at redhat dot com
@ 2014-05-29 17:13 ` konradsa at gmail dot com
2014-05-29 17:14 ` konradsa at gmail dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: konradsa at gmail dot com @ 2014-05-29 17:13 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
--- Comment #2 from konradsa <konradsa at gmail dot com> ---
It seems to get stuck in some sort of loop:
Here the tail end of the output I see when stepping with si:
...
(gdb) si
infrun: clear_proceed_status_thread (process 45441)
infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread
[process 45441] at 0x3181609d56
LLR: Preparing to step process 45441, 0, inferior_ptid process 45441
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
sigchld
infrun: wait_for_inferior ()
linux_nat_wait: [process -1], []
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
infrun: target_wait (-1, status) =
infrun: 45441 [process 45441],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x3181609d59
infrun: stepi/nexti
infrun: stop_stepping
0x0000003181609d59 in _dl_lookup_symbol_x () from /lib64/ld-linux-x86-64.so.2
(gdb) si
infrun: clear_proceed_status_thread (process 45441)
infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread
[process 45441] at 0x3181609d59
LLR: Preparing to step process 45441, 0, inferior_ptid process 45441
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
sigchld
infrun: wait_for_inferior ()
linux_nat_wait: [process -1], []
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
infrun: target_wait (-1, status) =
infrun: 45441 [process 45441],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x3181609d5b
infrun: stepi/nexti
infrun: stop_stepping
0x0000003181609d5b in _dl_lookup_symbol_x () from /lib64/ld-linux-x86-64.so.2
(gdb) si
infrun: clear_proceed_status_thread (process 45441)
infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread
[process 45441] at 0x3181609d5b
LLR: Preparing to step process 45441, 0, inferior_ptid process 45441
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
sigchld
infrun: wait_for_inferior ()
linux_nat_wait: [process -1], []
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
infrun: target_wait (-1, status) =
infrun: 45441 [process 45441],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x3181609d40
infrun: stepi/nexti
infrun: stop_stepping
0x0000003181609d40 in _dl_lookup_symbol_x () from /lib64/ld-linux-x86-64.so.2
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16997] Stepping hangs on gettimeofday with recording enabled
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
` (2 preceding siblings ...)
2014-05-29 17:13 ` konradsa at gmail dot com
@ 2014-05-29 17:14 ` konradsa at gmail dot com
2014-05-29 18:37 ` konradsa at gmail dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: konradsa at gmail dot com @ 2014-05-29 17:14 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
--- Comment #3 from konradsa <konradsa at gmail dot com> ---
If I just continue, here is what I continuously see:
...
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
LLR: Preparing to step process -1, 0, inferior_ptid process -1
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
linux_nat_wait: [process -1], []
sigchld
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
LLR: Preparing to step process -1, 0, inferior_ptid process -1
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
linux_nat_wait: [process -1], []
sigchld
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
LLR: Preparing to step process -1, 0, inferior_ptid process -1
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
linux_nat_wait: [process -1], []
sigchld
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
LLR: Preparing to step process -1, 0, inferior_ptid process -1
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
linux_nat_wait: [process -1], []
sigchld
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
LLR: Preparing to step process -1, 0, inferior_ptid process -1
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
linux_nat_wait: [process -1], []
sigchld
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
^CLLW: waitpid 45441 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: trap ptid is process 45441.
LLW: exit
LLR: Preparing to step process -1, 0, inferior_ptid process -1
RC: Not resuming sibling process 45441 (not stopped)
LLR: PTRACE_SINGLESTEP process 45441, 0 (resume event thread)
sigchld
linux_nat_wait: [process -1], []
LLW: enter
LNW: waitpid(-1, ...) returned 45441, No child processes
LLW: waitpid 45441 received Interrupt (stopped)
LLW: Candidate event Interrupt (stopped) in process 45441.
SEL: Select single-step process 45441
LLW: exit
infrun: target_wait (-1, status) =
infrun: 45441 [process 45441],
infrun: status->kind = stopped, signal = GDB_SIGNAL_INT
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0xffffffffff600144
infrun: random signal (GDB_SIGNAL_INT)
Program received signal SIGINT, Interrupt.
infrun: stop_stepping
0xffffffffff600144 in ?? ()
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16997] Stepping hangs on gettimeofday with recording enabled
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
` (3 preceding siblings ...)
2014-05-29 17:14 ` konradsa at gmail dot com
@ 2014-05-29 18:37 ` konradsa at gmail dot com
2014-05-29 18:58 ` [Bug c++/16997] vDSO call to gettimeofday hangs " konradsa at gmail dot com
2015-02-10 0:01 ` guillaume at morinfr dot org
6 siblings, 0 replies; 8+ messages in thread
From: konradsa at gmail dot com @ 2014-05-29 18:37 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
--- Comment #4 from konradsa <konradsa at gmail dot com> ---
I think vDSO really is the culprit here. When I replace
gettimeofday( &now, 0);
with a direct system call
syscall(SYS_gettimeofday, &now, 0);
it works fine, even with recording enabled.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16997] vDSO call to gettimeofday hangs with recording enabled
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
` (4 preceding siblings ...)
2014-05-29 18:37 ` konradsa at gmail dot com
@ 2014-05-29 18:58 ` konradsa at gmail dot com
2015-02-10 0:01 ` guillaume at morinfr dot org
6 siblings, 0 replies; 8+ messages in thread
From: konradsa at gmail dot com @ 2014-05-29 18:58 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
konradsa <konradsa at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Stepping hangs on |vDSO call to gettimeofday
|gettimeofday with recording |hangs with recording
|enabled |enabled
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/16997] vDSO call to gettimeofday hangs with recording enabled
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
` (5 preceding siblings ...)
2014-05-29 18:58 ` [Bug c++/16997] vDSO call to gettimeofday hangs " konradsa at gmail dot com
@ 2015-02-10 0:01 ` guillaume at morinfr dot org
6 siblings, 0 replies; 8+ messages in thread
From: guillaume at morinfr dot org @ 2015-02-10 0:01 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=16997
Guillaume Morin <guillaume at morinfr dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |guillaume at morinfr dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-02-09 18:59 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29 14:55 [Bug c++/16997] New: Stepping hangs on gettimeofday with recording enabled konradsa at gmail dot com
2014-05-29 14:56 ` [Bug c++/16997] " konradsa at gmail dot com
2014-05-29 15:06 ` palves at redhat dot com
2014-05-29 17:13 ` konradsa at gmail dot com
2014-05-29 17:14 ` konradsa at gmail dot com
2014-05-29 18:37 ` konradsa at gmail dot com
2014-05-29 18:58 ` [Bug c++/16997] vDSO call to gettimeofday hangs " konradsa at gmail dot com
2015-02-10 0:01 ` guillaume at morinfr dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).