public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* assertion error in pretty printing
@ 2021-07-07 18:34 Jonah Graham
  2021-07-07 21:13 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Jonah Graham @ 2021-07-07 18:34 UTC (permalink / raw)
  To: GDB Development

Hi folks.

I have an internal error in GDB that AFAICT is down to the python pretty
printers. This is being hit by CDT (reported in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=574645)

Doing a -var-update I get this internal error:

~"/scratch/gdb/binutils-gdb/gdb/c-varobj.c:516: internal-error: std::string
c_value_of_variable(const varobj*, varobj_display_formats): Assertion
`!value_lazy (var->value.get ())' failed.\nA problem internal to GDB has
been detected,\nfurther debugging may prove unreliable.\nQuit this
debugging session? (y or n) "

Steps to reproduce:

Get source from
https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726
curl
https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726
> bug574645.cpp
g++ -std=c++2a -O0 -g3 bug574645.cpp -o bug574645
gdb --interpreter=mi2

then use these commands:
6-enable-pretty-printing
8-gdb-set print object on
19-file-exec-and-symbols --thread-group i1 bug574645
26-break-insert -f bug574645.cpp:31
27-break-insert -t -f main
29-exec-run --thread-group i1
41-var-create --thread 1 --frame 0 - * data2
44-var-list-children var1 0 1
48-exec-continue --thread 1
51-var-update 1 var1

If running with a locally built GDB the python pretty printers need to be
pointed at (e.g. add  --data-directory=/usr/share/gdb to gdb command line)

Where do I start debugging this? I have reproduced with latest HEAD of
gdb + the data directory on my Ubuntu 20.04 machine.

Jonah

~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

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

* Re: assertion error in pretty printing
  2021-07-07 18:34 assertion error in pretty printing Jonah Graham
@ 2021-07-07 21:13 ` Simon Marchi
  2021-07-08  1:05   ` Jonah Graham
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2021-07-07 21:13 UTC (permalink / raw)
  To: Jonah Graham, GDB Development

On 2021-07-07 2:34 p.m., Jonah Graham wrote:
> Hi folks.
> 
> I have an internal error in GDB that AFAICT is down to the python pretty
> printers. This is being hit by CDT (reported in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=574645)
> 
> Doing a -var-update I get this internal error:
> 
> ~"/scratch/gdb/binutils-gdb/gdb/c-varobj.c:516: internal-error: std::string
> c_value_of_variable(const varobj*, varobj_display_formats): Assertion
> `!value_lazy (var->value.get ())' failed.\nA problem internal to GDB has
> been detected,\nfurther debugging may prove unreliable.\nQuit this
> debugging session? (y or n) "
> 
> Steps to reproduce:
> 
> Get source from
> https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726
> curl
> https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726
>> bug574645.cpp
> g++ -std=c++2a -O0 -g3 bug574645.cpp -o bug574645
> gdb --interpreter=mi2
> 
> then use these commands:
> 6-enable-pretty-printing
> 8-gdb-set print object on
> 19-file-exec-and-symbols --thread-group i1 bug574645
> 26-break-insert -f bug574645.cpp:31
> 27-break-insert -t -f main
> 29-exec-run --thread-group i1
> 41-var-create --thread 1 --frame 0 - * data2
> 44-var-list-children var1 0 1
> 48-exec-continue --thread 1
> 51-var-update 1 var1
> 
> If running with a locally built GDB the python pretty printers need to be
> pointed at (e.g. add  --data-directory=/usr/share/gdb to gdb command line)
> 
> Where do I start debugging this? I have reproduced with latest HEAD of
> gdb + the data directory on my Ubuntu 20.04 machine.

Hi Jonah,

First, maybe file a bug with that information.

Then, I'm not sure what to say.  You need to understand why this assert
is there, why it is failing in this case, what lead up to this.  Classic
debugging / investigative work.

I can't provide you with pointers in the code without looking at the
problem myself (which I don't really have time to do), other than "check
the backtrace at the point of the crash".  Do you need guidance / tips
on how to debug GDB with GDB?

Thanks,

Simon

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

* Re: assertion error in pretty printing
  2021-07-07 21:13 ` Simon Marchi
@ 2021-07-08  1:05   ` Jonah Graham
  0 siblings, 0 replies; 3+ messages in thread
From: Jonah Graham @ 2021-07-08  1:05 UTC (permalink / raw)
  To: Simon Marchi; +Cc: GDB Development

On Wed, 7 Jul 2021 at 17:13, Simon Marchi <simon.marchi@polymtl.ca> wrote:

> On 2021-07-07 2:34 p.m., Jonah Graham wrote:
> > Hi folks.
> >
> > I have an internal error in GDB that AFAICT is down to the python pretty
> > printers. This is being hit by CDT (reported in
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=574645)
> >
> > Doing a -var-update I get this internal error:
> >
> > ~"/scratch/gdb/binutils-gdb/gdb/c-varobj.c:516: internal-error:
> std::string
> > c_value_of_variable(const varobj*, varobj_display_formats): Assertion
> > `!value_lazy (var->value.get ())' failed.\nA problem internal to GDB has
> > been detected,\nfurther debugging may prove unreliable.\nQuit this
> > debugging session? (y or n) "
> >
> > Steps to reproduce:
> >
> > Get source from
> >
> https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726
> > curl
> >
> https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=286726
> >> bug574645.cpp
> > g++ -std=c++2a -O0 -g3 bug574645.cpp -o bug574645
> > gdb --interpreter=mi2
> >
> > then use these commands:
> > 6-enable-pretty-printing
> > 8-gdb-set print object on
> > 19-file-exec-and-symbols --thread-group i1 bug574645
> > 26-break-insert -f bug574645.cpp:31
> > 27-break-insert -t -f main
> > 29-exec-run --thread-group i1
> > 41-var-create --thread 1 --frame 0 - * data2
> > 44-var-list-children var1 0 1
> > 48-exec-continue --thread 1
> > 51-var-update 1 var1
> >
> > If running with a locally built GDB the python pretty printers need to be
> > pointed at (e.g. add  --data-directory=/usr/share/gdb to gdb command
> line)
> >
> > Where do I start debugging this? I have reproduced with latest HEAD of
> > gdb + the data directory on my Ubuntu 20.04 machine.
>
> Hi Jonah,
>
> First, maybe file a bug with that information.
>
> Then, I'm not sure what to say.  You need to understand why this assert
> is there, why it is failing in this case, what lead up to this.  Classic
> debugging / investigative work.
>
> I can't provide you with pointers in the code without looking at the
> problem myself (which I don't really have time to do), other than "check
> the backtrace at the point of the crash".  Do you need guidance / tips
> on how to debug GDB with GDB?
>

Hi Simon,

My ask was way too wooly - I spent a bunch of time learning about data
directories and python integrations before I understood what the problem
was and asked for help a little too soon. I'll create a ticket and see what
else I can figure out so I can come back with a more specific ask (or a fix
:-). Thanks for taking the time to reply.

Jonah




>
> Thanks,
>
> Simon
>

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

end of thread, other threads:[~2021-07-08  1:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 18:34 assertion error in pretty printing Jonah Graham
2021-07-07 21:13 ` Simon Marchi
2021-07-08  1:05   ` Jonah Graham

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).