Bug 1754 - Missing GIL lock in generated callback destructor
Missing GIL lock in generated callback destructor
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: python bindings
ns-3-dev
All All
: P5 normal
Assigned To: Gustavo J. A. M. Carneiro
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-13 01:53 UTC by Alex Afanasyev
Modified: 2013-08-14 01:57 UTC (History)
2 users (show)

See Also:


Attachments
patch (1.21 KB, application/octet-stream)
2013-08-13 01:53 UTC, Alex Afanasyev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Afanasyev 2013-08-13 01:53:43 UTC
Created attachment 1659 [details]
patch

The callback destructor is calling Py_DECREF on the python object, which may ultimately lead to destruction of the python object.  Without GIL locking, this can miserably fail with mysterious segfault.

The attached patch solves the problem.
Comment 1 Gustavo J. A. M. Carneiro 2013-08-13 05:52:16 UTC
Thank you, the patch looks great.
Comment 2 Tom Henderson 2013-08-14 01:57:56 UTC
committed as: 3dc19f3ac5a7