segfault scanner dump objects when nameless modules are loaded

Bug #1080843 reported by trbs
6
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.dump_all_objects('filename.json')"
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

Revision history for this message
trbs (trbs) wrote :
Revision history for this message
trbs (trbs) wrote :

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]}

Revision history for this message
John A Meinel (jameinel) wrote :

Thanks for the patch, I applied it to trunk, and the test case nicely showed the failure.

Changed in meliae:
importance: Undecided → High
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.