Bug 1754

Summary: Missing GIL lock in generated callback destructor
Product: ns-3 Reporter: Alex Afanasyev <alexander.afanasyev>
Component: python bindingsAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: patch

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