Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* MI pretty printing -var-list-children segfaults
@ 2015-11-30 21:18 Xavier de Gaye
  2015-11-30 22:32 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Xavier de Gaye @ 2015-11-30 21:18 UTC (permalink / raw)
  To: gdb

gdb 7.10 segfaults after deleting the varobj child of a vector with one
element.  Does that mean children must no be deleted ?

The last part of the debugging session:

(gdb)
~"8\t    v.push_back(3);\n"
*stopped,reason="end-stepping-range",frame={addr="0x0000000000400b35",func="main",args=[],file="pret
ty-printing.cc",fullname="/home/xavier/src/pyclewn/pyclewn-hg-working/testsuite/pretty-printing.cc",
line="8"},thread-id="1",stopped-threads="all",core="1"
(gdb)
-enable-pretty-printing
^done
(gdb)
-var-create var1 * "v"
^done,name="var1",numchild="0",value="{...}",type="std::vector<int, std::allocator<int> >",thread-id
="1",displayhint="array",dynamic="1",has_more="1"
(gdb)
-var-list-children var1
^done,numchild="1",displayhint="array",children=[child={name="var1.[0]",exp="[0]",numchild="0",type=
"int",thread-id="1"}],has_more="0"
(gdb)
-var-delete var1.[0]
^done,ndeleted="1"
(gdb)
-var-list-children var1
Segmentation fault (core dumped)


And the source code:

#include <vector>
#include <string>

int main()
{
     std::vector<int> v;
     v.push_back(2);
     v.push_back(3);
     return 0;
}


Xavier


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

* Re: MI pretty printing -var-list-children segfaults
  2015-11-30 21:18 MI pretty printing -var-list-children segfaults Xavier de Gaye
@ 2015-11-30 22:32 ` Simon Marchi
  2015-12-01 14:49   ` Xavier de Gaye
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2015-11-30 22:32 UTC (permalink / raw)
  To: Xavier de Gaye, gdb

On 15-11-30 04:18 PM, Xavier de Gaye wrote:
> gdb 7.10 segfaults after deleting the varobj child of a vector with one
> element.  Does that mean children must no be deleted ?
> 
> The last part of the debugging session:
> 
> (gdb)
> ~"8\t    v.push_back(3);\n"
> *stopped,reason="end-stepping-range",frame={addr="0x0000000000400b35",func="main",args=[],file="pret
> ty-printing.cc",fullname="/home/xavier/src/pyclewn/pyclewn-hg-working/testsuite/pretty-printing.cc",
> line="8"},thread-id="1",stopped-threads="all",core="1"
> (gdb)
> -enable-pretty-printing
> ^done
> (gdb)
> -var-create var1 * "v"
> ^done,name="var1",numchild="0",value="{...}",type="std::vector<int, std::allocator<int> >",thread-id
> ="1",displayhint="array",dynamic="1",has_more="1"
> (gdb)
> -var-list-children var1
> ^done,numchild="1",displayhint="array",children=[child={name="var1.[0]",exp="[0]",numchild="0",type=
> "int",thread-id="1"}],has_more="0"
> (gdb)
> -var-delete var1.[0]
> ^done,ndeleted="1"
> (gdb)
> -var-list-children var1
> Segmentation fault (core dumped)
> 
> 
> And the source code:
> 
> #include <vector>
> #include <string>
> 
> int main()
> {
>      std::vector<int> v;
>      v.push_back(2);
>      v.push_back(3);
>      return 0;
> }
> 
> 
> Xavier

Hi Xavier,

One thing is sure, gdb should not segfault when you do something that
you are not supposed to do.  If you shouldn't delete varobj children,
then gdb should return an error.  So that's a bug in gdb for sure.

If you could file a bug with as much details as possible on how to
reproduce it, it would be greatly appreciated:

https://sourceware.org/bugzilla/enter_bug.cgi?product=gdb

I don't have the required background to answer your actual question, so
I'll let others do it.

Thanks!

Simon


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

* Re: MI pretty printing -var-list-children segfaults
  2015-11-30 22:32 ` Simon Marchi
@ 2015-12-01 14:49   ` Xavier de Gaye
  0 siblings, 0 replies; 3+ messages in thread
From: Xavier de Gaye @ 2015-12-01 14:49 UTC (permalink / raw)
  To: Simon Marchi, gdb

 > If you could file a bug with as much details as possible on how to
 > reproduce it, it would be greatly appreciated:

Bug entered at https://sourceware.org/bugzilla/show_bug.cgi?id=19321

Xavier


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

end of thread, other threads:[~2015-12-01 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30 21:18 MI pretty printing -var-list-children segfaults Xavier de Gaye
2015-11-30 22:32 ` Simon Marchi
2015-12-01 14:49   ` Xavier de Gaye

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