Bug 1990

Summary: Python bindings tap-bridge module import error
Product: ns-3 Reporter: vsarris
Component: tap-bridgeAssignee: Tom Henderson <tomh>
Status: CONFIRMED ---    
Severity: normal CC: ns-bugs, tomh
Priority: P5    
Version: ns-3.21   
Hardware: PC   
OS: Linux   
Attachments: initial module import test program

Description vsarris 2014-09-18 17:52:11 EDT
Hello ,

Ns3 builds fine with python bindings generated.

When trying to import ns.tap_bridge:

I get ImportError: /home/ubuntu/Desktop/ns-allinone-3.21/ns-3.21/build/libns3.21-tap-bridge.so: undefined symbol: _ZTIN3ns34Ipv4E

I use ubuntu 14.04 32 bit

I have also built this in ubuntu 12.04. 32 bit and get the same.

In previous ns3 version (3.20) it works fine.

Installed everything as presequite from http://www.nsnam.org/wiki/Installation#Ubuntu.2FDebian 

Also other modules e.g import ns.lte ,lte= ns.lte.LteHelper() work fine


Regards,

Bill
Comment 1 Tom Henderson 2014-09-18 20:02:35 EDT
I could not reproduce this with the ns-allinone-3.21 release tarball.  I added 

import.ns.tap_bridge

to examples/tutorial/first.py on both a 64-bit Fedora 19 and a 32-bit Fedora 20 system, and it didn't complain.

Can you review this and see whether it pertains to your case?

http://www.nsnam.org/wiki/Python_bindings#ImportError:_undefined_symbol
Comment 2 vsarris 2014-09-19 07:58:34 EDT
Thank you for your answer,

Well by using c++filt _ZTIN3ns34Ipv4E i get: typeinfo for ns3::Ipv4 ,which is not so clear of what is the non implemented method

I will try to figure out whether I can find it to comment it out and let you know of my results.

Regards,

Bill
Comment 3 Tom Henderson 2014-10-15 09:36:01 EDT
(In reply to vsarris from comment #2)
> Thank you for your answer,
> 
> Well by using c++filt _ZTIN3ns34Ipv4E i get: typeinfo for ns3::Ipv4 ,which
> is not so clear of what is the non implemented method
> 
> I will try to figure out whether I can find it to comment it out and let you
> know of my results.
> 
> Regards,
> 
> Bill


Checking in... were you able to learn more about this?
Comment 4 vsarris 2014-10-16 04:28:55 EDT
Hello again,

As I have seen from the wiki solution where it suggests   "  the method that exists in the class declaration but that is not implemented, and removing the declaration, and rescanning the bindings. " I couldn't find any specific thing to remove according to the c++filt output (typeinfo for ns3::Ipv4)

I've also tested importing ns.tap_bridge to several pc's of my colleagues who also have ubuntu(12.04,14.04 both 32bit,64bit with all prequisites installed) and got the same error. 

Finally I had a VM with Fedora installed and there it works fine so I kept this as a solution. I guess if it was a non declare error why should it work in Fedora?It sounds bit strange.

Regards,

Vasilis
Comment 5 Tom Henderson 2014-10-16 14:03:55 EDT
Created attachment 1906 [details]
initial module import test program

this can be enhanced further (to find the list of active modules from the build directory), but could potentially be included in bindings/python/test and run from test.py, to catch import errors on buildslaves
Comment 6 Tom Henderson 2014-10-16 14:06:13 EDT
(In reply to vsarris from comment #4)
> Hello again,
> 
> As I have seen from the wiki solution where it suggests   "  the method that
> exists in the class declaration but that is not implemented, and removing
> the declaration, and rescanning the bindings. " I couldn't find any specific
> thing to remove according to the c++filt output (typeinfo for ns3::Ipv4)
> 
> I've also tested importing ns.tap_bridge to several pc's of my colleagues
> who also have ubuntu(12.04,14.04 both 32bit,64bit with all prequisites
> installed) and got the same error. 
> 
> Finally I had a VM with Fedora installed and there it works fine so I kept
> this as a solution. I guess if it was a non declare error why should it work
> in Fedora?It sounds bit strange.
> 
> Regards,
> 
> Vasilis

I ran this program on a couple of machines (as ./waf --pyrun import-modules.py) and it worked for me, so I'd like to develop it further and add it as a regression test.

As for the problems that you encountered, it might be nice to try to figure out what is the problem on these machines, so let's leave this open for a while.
Comment 7 vsarris 2014-10-17 11:56:24 EDT
Its ok then.

In case you need any further info please let me know

Bill
Comment 8 Tom Henderson 2015-01-15 20:23:49 EST
I fixed this last week; was a wscript error (omitting 'internet' module):

http://code.nsnam.org/ns-3-dev/rev/0121c3096a89

but I'm going to keep this bug open for the module import test program, which I'd like to add and start testing each module that it can be successfully enabled by itself and causes no import errors.