public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/11021] New: watch foo(x) -> infinite recursion
@ 2009-11-25 21:49 ppluzhnikov at google dot com
2010-08-14 3:03 ` [Bug breakpoints/11021] " pedro at codesourcery dot com
0 siblings, 1 reply; 3+ messages in thread
From: ppluzhnikov at google dot com @ 2009-11-25 21:49 UTC (permalink / raw)
To: gdb-prs
While trying to force a non-HW watchpoint, I did something possibly
unreasonable: set a watchpoint on an expression that requires call into
inferior. But GDB did something unreasonable as well: it crashed :-(
int x;
int foo(int x) { return x; }
int main()
{
x = 1;
return 0;
}
gcc -g t.c -o t
gdb64-cvs -q ./t
(gdb) b 7
Breakpoint 1 at 0x400458: file t.c, line 7.
(gdb) r
Breakpoint 1, main () at t.c:7
7 x = 1;
(gdb) watch foo(x)
Segmentation fault (core dumped)
The crash stack trace is:
(top) bt 40
#0 0x00000000004f6f27 in update_global_location_list (should_insert=1) at
../../src/gdb/breakpoint.c:8367
#1 0x00000000004f731b in update_global_location_list_nothrow (inserting=1) at
../../src/gdb/breakpoint.c:8594
#2 0x00000000004fd533 in set_momentary_breakpoint (gdbarch=0xcf0310, sal=...,
frame_id=..., type=<value optimized out>) at ../../src/gdb/breakpoint.c:5918
#3 0x0000000000534336 in call_function_by_hand (function=0x1286be0, nargs=1,
args=0x7fffffb08bd8) at ../../src/gdb/infcall.c:740
#4 0x000000000050efda in evaluate_subexp_standard (expect_type=<value optimized
out>, exp=0xda9970, pos=0x7fffffb09104, noside=EVAL_NORMAL)
at ../../src/gdb/eval.c:1574
#5 0x00000000005a41d0 in evaluate_subexp_c (expect_type=0xd200d0, exp=0x400390,
pos=0x7fffffb09104, noside=EVAL_NORMAL) at ../../src/gdb/c-lang.c:1037
#6 0x000000000050d5ed in evaluate_expression (exp=0x400390) at
../../src/gdb/eval.c:165
#7 0x00000000004f4aac in fetch_watchpoint_value (exp=0xda9970,
valp=0x7fffffb091d8, resultp=0x7fffffb091d0, val_chain=0x7fffffb091e0)
at ../../src/gdb/breakpoint.c:950
#8 0x00000000004f5270 in update_watchpoint (b=0xd9e3b0, reparse=<value
optimized out>) at ../../src/gdb/breakpoint.c:1135
#9 0x00000000004f7513 in insert_breakpoints () at ../../src/gdb/breakpoint.c:1554
#10 0x00000000005421ac in proceed (addr=0, siggnal=TARGET_SIGNAL_0, step=0) at
../../src/gdb/infrun.c:1804
#11 0x00000000005337c0 in run_inferior_call (call_thread=0xd22580,
real_pc=4195400) at ../../src/gdb/infcall.c:372
#12 0x00000000005343e9 in call_function_by_hand (function=0x1286b20, nargs=1,
args=0x7fffffb095f8) at ../../src/gdb/infcall.c:794
#13 0x000000000050efda in evaluate_subexp_standard (expect_type=<value optimized
out>, exp=0xda9970, pos=0x7fffffb09b24, noside=EVAL_NORMAL)
at ../../src/gdb/eval.c:1574
#14 0x00000000005a41d0 in evaluate_subexp_c (expect_type=0xd200d0, exp=0x400390,
pos=0x7fffffb09b24, noside=EVAL_NORMAL) at ../../src/gdb/c-lang.c:1037
#15 0x000000000050d5ed in evaluate_expression (exp=0x400390) at
../../src/gdb/eval.c:165
#16 0x00000000004f4aac in fetch_watchpoint_value (exp=0xda9970,
valp=0x7fffffb09bf8, resultp=0x7fffffb09bf0, val_chain=0x7fffffb09c00)
at ../../src/gdb/breakpoint.c:950
#17 0x00000000004f5270 in update_watchpoint (b=0xd9e3b0, reparse=<value
optimized out>) at ../../src/gdb/breakpoint.c:1135
#18 0x00000000004f7513 in insert_breakpoints () at ../../src/gdb/breakpoint.c:1554
#19 0x00000000005421ac in proceed (addr=0, siggnal=TARGET_SIGNAL_0, step=0) at
../../src/gdb/infrun.c:1804
#20 0x00000000005337c0 in run_inferior_call (call_thread=0xd22580,
real_pc=4195400) at ../../src/gdb/infcall.c:372
#21 0x00000000005343e9 in call_function_by_hand (function=0x1285880, nargs=1,
args=0x7fffffb0a018) at ../../src/gdb/infcall.c:794
#22 0x000000000050efda in evaluate_subexp_standard (expect_type=<value optimized
out>, exp=0xda9970, pos=0x7fffffb0a544, noside=EVAL_NORMAL)
at ../../src/gdb/eval.c:1574
#23 0x00000000005a41d0 in evaluate_subexp_c (expect_type=0xd200d0, exp=0x400390,
pos=0x7fffffb0a544, noside=EVAL_NORMAL) at ../../src/gdb/c-lang.c:1037
#24 0x000000000050d5ed in evaluate_expression (exp=0x400390) at
../../src/gdb/eval.c:165
#25 0x00000000004f4aac in fetch_watchpoint_value (exp=0xda9970,
valp=0x7fffffb0a618, resultp=0x7fffffb0a610, val_chain=0x7fffffb0a620)
at ../../src/gdb/breakpoint.c:950
#26 0x00000000004f5270 in update_watchpoint (b=0xd9e3b0, reparse=<value
optimized out>) at ../../src/gdb/breakpoint.c:1135
#27 0x00000000004f7513 in insert_breakpoints () at ../../src/gdb/breakpoint.c:1554
#28 0x00000000005421ac in proceed (addr=0, siggnal=TARGET_SIGNAL_0, step=0) at
../../src/gdb/infrun.c:1804
#29 0x00000000005337c0 in run_inferior_call (call_thread=0xd22580,
real_pc=4195400) at ../../src/gdb/infcall.c:372
#30 0x00000000005343e9 in call_function_by_hand (function=0x12857c0, nargs=1,
args=0x7fffffb0aa38) at ../../src/gdb/infcall.c:794
#31 0x000000000050efda in evaluate_subexp_standard (expect_type=<value optimized
out>, exp=0xda9970, pos=0x7fffffb0af64, noside=EVAL_NORMAL)
at ../../src/gdb/eval.c:1574
#32 0x00000000005a41d0 in evaluate_subexp_c (expect_type=0xd200d0, exp=0x400390,
pos=0x7fffffb0af64, noside=EVAL_NORMAL) at ../../src/gdb/c-lang.c:1037
#33 0x000000000050d5ed in evaluate_expression (exp=0x400390) at
../../src/gdb/eval.c:165
#34 0x00000000004f4aac in fetch_watchpoint_value (exp=0xda9970,
valp=0x7fffffb0b038, resultp=0x7fffffb0b030, val_chain=0x7fffffb0b040)
at ../../src/gdb/breakpoint.c:950
#35 0x00000000004f5270 in update_watchpoint (b=0xd9e3b0, reparse=<value
optimized out>) at ../../src/gdb/breakpoint.c:1135
#36 0x00000000004f7513 in insert_breakpoints () at ../../src/gdb/breakpoint.c:1554
#37 0x00000000005421ac in proceed (addr=0, siggnal=TARGET_SIGNAL_0, step=0) at
../../src/gdb/infrun.c:1804
#38 0x00000000005337c0 in run_inferior_call (call_thread=0xd22580,
real_pc=4195400) at ../../src/gdb/infcall.c:372
#39 0x00000000005343e9 in call_function_by_hand (function=0x1284500, nargs=1,
args=0x7fffffb0b458) at ../../src/gdb/infcall.c:794
--
Summary: watch foo(x) -> infinite recursion
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: breakpoints
AssignedTo: unassigned at sourceware dot org
ReportedBy: ppluzhnikov at google dot com
CC: gdb-prs at sourceware dot org
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=11021
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug breakpoints/11021] watch foo(x) -> infinite recursion
2009-11-25 21:49 [Bug breakpoints/11021] New: " ppluzhnikov at google dot com
@ 2010-08-14 3:03 ` pedro at codesourcery dot com
0 siblings, 0 replies; 3+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-14 3:03 UTC (permalink / raw)
To: gdb-prs
------- Additional Comments From pedro at codesourcery dot com 2010-08-14 03:03 -------
Yeah, I saw this too today.
This is most probably gdb evaluating the expression when the call dummy
breakpoint is hit. Maybe we should skip that if we hit the call dummy
breakpoint (and we're not stopping for any other reason). May be tricky to
get right. Hmm, with software watchpoints it may even be impossible to
get right.
There's the option of detecting this at watchpoint creation time,
and just say you can't do that Dave. Better than what we have today.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
http://sourceware.org/bugzilla/show_bug.cgi?id=11021
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-02 10:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-11021-4717@http.sourceware.org/bugzilla/>
2013-08-30 14:47 ` [Bug breakpoints/11021] watch foo(x) -> infinite recursion msaleem at codesourcery dot com
2013-09-02 10:16 ` msaleem at codesourcery dot com
2009-11-25 21:49 [Bug breakpoints/11021] New: " ppluzhnikov at google dot com
2010-08-14 3:03 ` [Bug breakpoints/11021] " pedro at codesourcery dot com
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).