[Ns-bugs] [Bug 816] New: tap-creator deadlock when python bindings enabled

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Sun Feb 14 17:37:29 PST 2010


http://www.nsnam.org/bugzilla/show_bug.cgi?id=816

           Summary: tap-creator deadlock when python bindings enabled
           Product: ns-3
           Version: ns-3-dev
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: devices
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: tgoff at tgoff.net
   Estimated Hours: 0.0


The backtrace below shows a situation where trying to exec tap-creator
in src/devices/tap-bridge/tap-bridge.cc leads to deadlock when trying
to acquire the python GIL.  This might be due to trying to access
python objects after fork() without calling PyOS_AfterFork() to
properly reset python state (including the GIL).


#0  0x00ca1422 in __kernel_vsyscall ()
#1  0x00b8ef75 in sem_wait@@GLIBC_2.1 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0x081047a8 in PyThread_acquire_lock ()
#3  0x080d74fc in PyEval_RestoreThread ()
#4  0x080f83c8 in PyGILState_Ensure ()
#5  0x0100ac75 in PyNs3Node__PythonHelper::GetInstanceTypeId (this=0x9c05bc8)
    at debug/bindings/python/ns3_module_node.cc:38580
#6  0x01aa4847 in ns3::Object::DoGetObject (this=0x9c05bc8, tid=...)
    at ../src/core/object.cc:142
#7  0x01d52a2d in ns3::Object::GetObject<ns3::Ipv4> (this=0x9c05bc8)
    at debug/ns3/object.h:394
#8  0x01ebb4d5 in ns3::TapBridge::CreateTap (this=0x9bf5638)
    at ../src/devices/tap-bridge/tap-bridge.cc:373
#9  0x01eba163 in ns3::TapBridge::StartTapDevice (this=0x9bf5638)
    at ../src/devices/tap-bridge/tap-bridge.cc:220


The included patch is a workaround that moves GetObject() to before
the fork().  Creating a new ns3::fork() function would probably be a
better way to handle things more transparently.

There is also a fork() in src/devices/emu/emu-net-device.cc, but
without any python interaction before calling exec().

-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Ns-bugs mailing list