Comments (2)
Yes, the dict implementation has changed. I patched things enough at https://github.com/edmcman/gdb-heap to avoid crashing, though I didn't fully iterate through the new data structures.
from gdb-heap.
After digging further, it looks like the gdb python interface has changed, more precisely native _gdb
and its Value
has changed and it no longer provides str
:
(gdb) set python print-stack full
(gdb) heap
Blocks retrieved 10000
Blocks retrieved 20000
Blocks retrieved 30000
Traceback (most recent call last):
File "/usr/share/gdb-heap/heap/commands.py", line 34, in g
return f(self, args, from_tty)
File "/usr/share/gdb-heap/heap/commands.py", line 56, in invoke
usage_list = list(lazily_get_usage_list())
File "/usr/share/gdb-heap/heap/__init__.py", line 503, in lazily_get_usage_list
categorize_usage_list(usage_list)
File "/usr/share/gdb-heap/heap/__init__.py", line 528, in categorize_usage_list
if u.obj.categorize_refs(usage_set):
File "/usr/share/gdb-heap/heap/cpython.py", line 280, in categorize_refs
m_str = int(self.field('str'))
File "/usr/share/gdb-heap/heap/__init__.py", line 117, in field
return self._gdbval[attr]
gdb.error: There is no member named str.
Error occurred in Python: There is no member named str.
I patched the corresponding part:
Lines 279 to 284 in b0a6efc
And provided an alternative implementation:
def categorize_refs(self, usage_set, level=0, detail=None):
usage_set.set_addr_category(self.as_address(), # << directly obtain as an address
Category('cpython', 'PyUnicodeObject buffer', detail),
level)
return True
That lead to another issue spotted:
(gdb) heap
Blocks retrieved 10000
Blocks retrieved 20000
Blocks retrieved 30000
Traceback (most recent call last):
File "/usr/share/gdb-heap/heap/commands.py", line 34, in g
return f(self, args, from_tty)
File "/usr/share/gdb-heap/heap/commands.py", line 56, in invoke
usage_list = list(lazily_get_usage_list())
File "/usr/share/gdb-heap/heap/__init__.py", line 504, in lazily_get_usage_list
categorize_usage_list(usage_list)
File "/usr/share/gdb-heap/heap/__init__.py", line 529, in categorize_usage_list
if u.obj.categorize_refs(usage_set):
File "/usr/share/gdb-heap/heap/cpython.py", line 286, in categorize_refs
level)
File "/usr/share/gdb-heap/heap/__init__.py", line 365, in set_addr_category
if level <= u.level:
TypeError: '<=' not supported between instances of 'int' and 'NoneType'
Error occurred in Python: '<=' not supported between instances of 'int' and 'NoneType'
(gdb)
After changing the condition:
Lines 364 to 365 in b0a6efc
to:
if u.level is not None and level <= u.level:
I obtained the following error:
(gdb) heap
Blocks retrieved 10000
Blocks retrieved 20000
Blocks retrieved 30000
Blocks analyzed 10000
Traceback (most recent call last):
File "/usr/share/gdb-heap/heap/commands.py", line 34, in g
return f(self, args, from_tty)
File "/usr/share/gdb-heap/heap/commands.py", line 56, in invoke
usage_list = list(lazily_get_usage_list())
File "/usr/share/gdb-heap/heap/__init__.py", line 503, in lazily_get_usage_list
categorize_usage_list(usage_list)
File "/usr/share/gdb-heap/heap/__init__.py", line 528, in categorize_usage_list
if u.obj.categorize_refs(usage_set):
File "/usr/share/gdb-heap/heap/cpython.py", line 297, in categorize_refs
ma_table = int(self.field('ma_table'))
File "/usr/share/gdb-heap/heap/__init__.py", line 117, in field
return self._gdbval[attr]
gdb.error: There is no member named ma_table.
Error occurred in Python: There is no member named ma_table.
To my understanding, gdb-heap is not compatible with dict implementation provided by cpython interpreter version I'm running (Python 3.6).
Any pointers or comments welcomed.
from gdb-heap.
Related Issues (12)
- SyntaxError: HOT 2
- Don't read /proc/$PID/maps for core files HOT 5
- Error on using heap command. HOT 3
- heap command returns "unorderable types: int() <= NoneType()" error HOT 3
- No module named 'cpython' HOT 1
- Unable to install & use 'gdb-heap' on Ubuntu for post-debugging with coredump HOT 9
- Change README to stop saying "forked from..." HOT 3
- There is no member named size HOT 7
- First impression: No module named 'glib', TypeError: must use keyword argument for key function HOT 2
- heap command is giving error HOT 1
- No symbol "main_arena" in current context. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdb-heap.