Bug 355 - Python scripts may crash on shutdown
Python scripts may crash on shutdown
Status: RESOLVED INVALID
Product: ns-3
Classification: Unclassified
Component: python bindings
ns-3.2
All All
: P3 minor
Assigned To: Mathieu Lacage
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-18 07:01 UTC by Gustavo J. A. M. Carneiro
Modified: 2008-10-16 06:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2008-09-18 07:01:17 UTC
#0  0x00007f233619e095 in raise () from /lib/libc.so.6
#1  0x00007f233619faf0 in abort () from /lib/libc.so.6
#2  0x00007f23361972df in __assert_fail () from /lib/libc.so.6
#3  0x00007f2337392cb8 in PyGILState_Ensure () at Python/pystate.c:497
#4  0x00007f2335bec8ce in PyNs3Application__PythonHelper::DoDispose (this=0xed7360)
    at debug/bindings/python/ns3_module_node.cc:6984
#5  0x00007f23351a23e9 in ns3::Object::Dispose (this=0xed7360) at ../src/core/object.cc:136
#6  0x00007f233529a4a4 in ns3::Node::DoDispose (this=0x702e70) at ../src/node/node.cc:155
#7  0x00007f23351a23e9 in ns3::Object::Dispose (this=0x702e70) at ../src/core/object.cc:136
#8  0x00007f23352b8a62 in ~NodeListPriv (this=0x7aa990) at ../src/node/node-list.cc:110
#9  0x00007f23351a1d9d in ns3::Object::MaybeDelete (this=0x7aa990) at ../src/core/object.cc:246
#10 0x00007f2335b8efa6 in ns3::Object::Unref (this=0x7aa990) at debug/ns3/object.h:346
#11 0x00007f23352baa57 in ~Ptr (this=0x7f23359190e0) at debug/ns3/ptr.h:407
#12 0x00007f23352b891a in __tcf_1 () at ../src/node/node-list.cc:81
#13 0x00007f23361a1110 in exit () from /lib/libc.so.6
#14 0x00007f233618a1cb in __libc_start_main () from /lib/libc.so.6
#15 0x0000000000400699 in _start ()

This is a harmless problem, but ugly.  It happens because NS-3 keeps references to nodes.  Calling ns3.Simulator.Destroy() in the Python script fixes this problem, though.
Comment 1 Mathieu Lacage 2008-09-18 12:12:58 UTC
I don't really understand the problem. A script _must_ call Destroy before shutdown to ensure correct program shutdown. Not doing so can lead to unpredictable results. I will mark as invalid unless you provide more information about the context
Comment 2 Gustavo J. A. M. Carneiro 2008-10-16 06:49:46 UTC
OK, I guess you can mark as invalid. Although perhaps registering an atexit function with the Python atexit module could perhaps mitigate the problem.  But it's not an important problem, as indicated by the Severity of the bug report.