segfault scanner dump objects when nameless modules are loaded
Bug #1080843 reported by
trbs
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Meliae |
Fix Committed
|
High
|
Unassigned |
Bug Description
Problem is reproducable (for me) when using IPython and meliae:
ipython -c "from meliae import scanner; scanner.
Segmentation fault
The cause is a nameless 'fake' module that is loaded in IPython.
In _scanner_core.c the name of the nameless module is being retrieved but this returns NULL from the Python API and thus segfaults.
This patch substitutes the standard "?" for the missing module name.
The result now looks like this in the dump/json file:
{"address": 52045648, "type": "FakeModule", "size": 64, "name": "?", "refs": [50188960, 52440512]}
Related branches
To post a comment you must log in.
Added another patch this time with tests.
As per the tests it seems like it wants to ignore the name attribute all together then no name is set.
So updated the patch accordingly.
Result in the dump now looks like this (without the "name" attribute):
{"address": 43173904, "type": "FakeModule", "size": 64, "refs": [41323584, 43572240]}