public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* mi/2309: Internal error (Assertion failure) on "-var-update" command
@ 2007-08-31 15:38 Nils.Hagge
0 siblings, 0 replies; 5+ messages in thread
From: Nils.Hagge @ 2007-08-31 15:38 UTC (permalink / raw)
To: gdb-gnats
>Number: 2309
>Category: mi
>Synopsis: Internal error (Assertion failure) on "-var-update" command
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Aug 31 15:38:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator: Nils Hagge
>Release: version 6.5
>Organization:
>Environment:
- Windows/Cygwin AND
- SuSE Linux 10.2
>Description:
How to reproduce:
Take the following program:
#include <stdio.h>
struct {
struct { int secondA; int secondB; } firstA;
int firstB;
} *p;
int main(void) { // line 18
int i = 20; // line 19
printf("!!!Hello World!!!\n");
printf("i = %d\n", ++i);
p = 0;
return 0;
}
compile with debug info.
Start gdb as follows:
gdb -q -nw -i mi Debug/TestLocalDebug.exe
---------------
The following MI dialog
- starts the program and stops in main (line 19)
- create two watch expression
- "p" and
- "p->firstA.secondB"
- the second of which cannot be evaluated since p is not sensibly initialized.
- the command -var-expression-evaluate works and an error is indicated.
- the command -var-update brings gdb to crash on the "bad expression, see below:
-----------------------------------------------------
adhani1@ad026663nb$ gdb -q -nw -i mi Debug/TestLocalDebug.exe
(gdb)
break main
&"break main\n"
~"Breakpoint 1 at 0x401075: file ../src/TestLocalDebug.c, line 18.\n"
^done
(gdb)
2-exec-run
2^running
(gdb)
2*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x004010
75",func="main",args=[],file="../src/TestLocalDebug.c",fullname="/cygdrive/d/workspaces/rtpdebugger-devel-runtime/TestLocalDebug/src/TestLocalDebug.c", line="18"}
(gdb)
3 info program
&"info program\n"
~"\tUsing the running image of child thread 1924.0x14bc.\n"
~"Program stopped at 0x401075.\n"
~"It stopped at breakpoint 1.\n"
3^done
(gdb)
4 info threads
&"info threads\n"
~" 2 thread 1924.0xc8 0x7c90eb94 in ntdll!LdrAccessResource ()\n"
~" from /cygdrive/c/WINNT/system32/ntdll.dll\n"
~"* 1 thread 1924.0x14bc main () at ../src/TestLocalDebug.c:18\n"
4^done
(gdb)
5-var-create - * p
5^done,name="var1",numchild="2",type="struct {...} *"
(gdb)
6-var-create - * p->firstA.secondB
6^done,name="var2",numchild="0",type="int"
(gdb)
8-var-evaluate-expression var1
8^done,value="0x0"
(gdb)
9-var-evaluate-expression var2
&"Cannot access memory at address 0x4\n"
9^error,msg="Cannot access memory at address 0x4"
(gdb)
11-data-evaluate-expression p->firstA.secondB
&"Cannot access memory at address 0x4\n"
11^error,msg="Cannot access memory at address 0x4"
(gdb)
12-exec-next 1
12^running
(gdb)
12*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x0040107a", func="main",args=[],file="../src/TestLocalDebug.c",fullname="/cygdrive/d/workspaces/rtpdebugger-devel-runtime/TestLocalDebug/src/TestLocalDebug.c",line="19"}
(gdb)
13-var-update var1
13^done,changelist=[]
(gdb)
14-var-update var2
~"/netrel/src/gdb-20060706-2/gdb/varobj.c:1471: internal-error: my_value_equal:
Assertion `!value_lazy (val1)' failed.\n"
~"A problem internal to GDB has been detected,\n"
~"further debugging may prove unreliable.\n"
~"Quit this debugging session? (y or n) "
>How-To-Repeat:
replay the dialog
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mi/2309: Internal error (Assertion failure) on "-var-update" command
@ 2008-01-10 22:18 Aleksandar Ristovski
0 siblings, 0 replies; 5+ messages in thread
From: Aleksandar Ristovski @ 2008-01-10 22:18 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR mi/2309; it has been noted by GNATS.
From: Aleksandar Ristovski <ARistovski@qnx.com>
To: gdb-gnats@sources.redhat.com
Cc:
Subject: Re: mi/2309: Internal error (Assertion failure) on "-var-update"
command
Date: Thu, 10 Jan 2008 17:16:05 -0500
Please check if this patch resolves the problem:
http://sourceware.org/ml/gdb-patches/2008-01/msg00250.html
---
Aleksandar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mi/2309: Internal error (Assertion failure) on "-var-update" command
@ 2008-01-10 20:58 Aleksandar Ristovski
0 siblings, 0 replies; 5+ messages in thread
From: Aleksandar Ristovski @ 2008-01-10 20:58 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR mi/2309; it has been noted by GNATS.
From: Aleksandar Ristovski <ARistovski@qnx.com>
To: gdb-gnats@sources.redhat.com
Cc:
Subject: Re: mi/2309: Internal error (Assertion failure) on "-var-update"
command
Date: Thu, 10 Jan 2008 15:51:45 -0500
Another test case where this happens:
NOTE: The problem occurs on both current snapshot from CVS and gdb 6.7
NOTE2: gdb 6.6 seems to not have this issue.
Compilers tried: 4.1.1, 4.2.1
Sample code:
============= main.cc ====================
class B {
public:
int b;
virtual ~B() {};
};
class A: public B {
public:
int a;
};
int main(int argc, char **argv) {
B * b = new A();
b->b = 2;
A * a = dynamic_cast<A*>(b);
a->a = 1;
}
========================================
====== initcrash =======================
file test
-break-insert main
-exec-run
-var-create - * b
-var-list-children var1
-var-list-children var1.public
========================================
To compile:
g++ -g main.cc -o test
To reproduce assertion:
gdb -i=mi < initcrash
gdb version:
gdb --version
GNU gdb 6.7.50.20080110-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
---
Aleksandar Ristovski
QNX Software Systems
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mi/2309: Internal error (Assertion failure) on "-var-update" command
@ 2008-01-04 6:18 Nick Roberts
0 siblings, 0 replies; 5+ messages in thread
From: Nick Roberts @ 2008-01-04 6:18 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR mi/2309; it has been noted by GNATS.
From: Nick Roberts <nickrob@snap.net.nz>
To: gdb-gnats@sources.redhat.com, nobody@sources.redhat.com,
Nils.Hagge@siemens.com, gdb-prs@sources.redhat.com
Cc:
Subject: Re: mi/2309: Internal error (Assertion failure) on "-var-update" command
Date: Fri, 4 Jan 2008 19:09:58 +1300
http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=2309
This has been fixed for GDB in the CVS repository. It fails in GDB 6.6 but can
you see if it works for GDB 6.7 too?
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mi/2309: Internal error (Assertion failure) on "-var-update" command
@ 2007-08-31 15:58 Daniel Jacobowitz
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-08-31 15:58 UTC (permalink / raw)
To: nobody; +Cc: gdb-prs
The following reply was made to PR mi/2309; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@false.org>
To: Nils.Hagge@siemens.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: mi/2309: Internal error (Assertion failure) on "-var-update"
command
Date: Fri, 31 Aug 2007 11:51:39 -0400
On Fri, Aug 31, 2007 at 03:35:07PM -0000, Nils.Hagge@siemens.com wrote:
> >Release: version 6.5
Please try a current GDB snapshot. I believe this is already fixed.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-01-10 22:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-31 15:38 mi/2309: Internal error (Assertion failure) on "-var-update" command Nils.Hagge
2007-08-31 15:58 Daniel Jacobowitz
2008-01-04 6:18 Nick Roberts
2008-01-10 20:58 Aleksandar Ristovski
2008-01-10 22:18 Aleksandar Ristovski
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).