Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356940 - debugger collapses
Summary: debugger collapses
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 6.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 09:49 EDT by Jan Hranac CLA
Modified: 2020-09-04 15:20 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Hranac CLA 2011-09-07 09:49:55 EDT
The following error occurs while debugging a C++ source code (the code can't be attached because it's proprietary):

Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0x71
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 549, in to_string
    return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
OverflowError: signed integer is less than minimum
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 549, in to_string
    return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
RuntimeError: Cannot access memory at address 0x8befffffe48
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0x858d48c28900002a
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0x48535441e5894855
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 549, in to_string
    return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
RuntimeError: Cannot access memory at address 0xf0758948f87d8930
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0x3aeae8c78948
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0xf87d8948e5894855
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0x7fffffffffff
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 549, in to_string
    return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
OverflowError: signed integer is greater than maximum
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 549, in to_string
    return self.val['_M_dataplus']['_M_p'].lazy_string (length = len)
RuntimeError: Cannot access memory at address 0x48de8948f0894990
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0x58a8a0b919ebef45
Traceback (most recent call last):
  File "/usr/lib64/../share/gcc-4.5.1/python/libstdcxx/v6/printers.py", line 61, in next
    elt = self.base.cast(self.nodetype).dereference()
RuntimeError: Cannot access memory at address 0x758b4840ebef4588

-- Configuration Details --
Product: Eclipse Platform 3.6.1.r361_v20100714-0800 (org.eclipse.platform.ide)
Installed Features:
 org.eclipse.platform 3.6.1.r361_v20100909-9pF78H4oFrRqo0jLjjFxXoSz-RKIN_OZboW
Comment 1 Andrew Overholt CLA 2011-09-07 10:35:31 EDT
CC'ing Tom Tromey since this looks to be gdb Python scripting-related.
Comment 2 Phil Muldoon CLA 2011-09-07 10:49:09 EDT
Over on GDB I tend to see this from users.  There are generally two possibilities:

 - The variable has been optimized out by GCC, and GCC does not mark optimized data so we cannot pre-check it.

 - The variable is uninitialized or is corrupted. (IE printing a data-structure right after breaking at "main").

The printer is basically trying to interpret the content inside the data-structure (in this case, a C++ class).  As it tries to understand the data to give a better interpretation of what is in it (IE as in a vector: 1,2,3,4) instead of the actual class mechanics, this is what happens.

I'm not sure how to fix this. Given that the two scenarios above are something we cannot detect.

It would help if some more context was given when this trace was produced.  Was it (the variable) uninitialized? What were the optimize flags passed to the build?
Comment 3 Jan Hranac CLA 2011-09-08 02:03:33 EDT
The optimisation flag was -O0 (and the debug one was -g3 if that's any help).

The debugging had worked fine in DDD (even when I had displayed the variables involved). However, after I read the last input I tried the debugging in Eclipse as well - with the "Variables" tab closed. It worked just fine.

What troubles me is the fact that all the variables are valid and defined just before the collaps and it fails on a line that doesn't do anything extraordinary. Here is the particular piece of code (I'm sorry I can't provide more):

if (xx != yy)
{
  list_of_strings.push_back(ZZ->string_atr);  //<--HERE IT COLLAPSES
  ...

ZZ is fully defined, list_of_strings was empty at the moment.


Thank you for your help. Feel free to close this bug as "fixed-worksforme".
Comment 4 Tom Tromey CLA 2011-10-18 16:33:48 EDT
What version of gdb is this?
The presence of RuntimeError in the trace leads me to believe
this is a bug that was fixed -- well, at least partially fixed,
in a way that hopefully would cause gdb front ends to show
something nice instead of a Python trace.
Comment 5 Tom Tromey CLA 2011-10-19 11:24:00 EDT
Here's the gdb patch that fixed this:
http://sourceware.org/ml/gdb-patches/2010-10/msg00301.html