Ticket #191 (defect)

Opened 11 months ago

Last modified 9 months ago

make check fails in usrp/host/lib/inband on Cygwin

Status: new

Reported by: dward Assigned to: nobody
Priority: normal Milestone: to-be-decided
Component: build Version: 3.0svn
Keywords: cygwin usrp Cc: don2387ward@sprynet.com

make check is fails in usrp/host/lib/inband on Cygwin with six messages like

1) test: qa_inband_usrp_server::test_open_close (E)
uncaught exception of type mbe_mblock_failed
- Message block failed: top

These come from line 40 of mb_port.cc after failure of mb_protocol_class_lookup().

It appears (to the linker, at least) that test_inband.exe depends on libusrp_inband-qa.dll but not on libusrp_inband.dll. But the code to initialize s_ALL_PROTOCOL_CLASSES (in mb_protocol_class.cc) is contained in usrp_{server,interface}_mbh.cc which is in libusrp_inband.dll. Since libusrp_inband.dll is not used (as far as the linker can determine) by test_inband.exe, s_ALL_PROTOCOL_CLASSES is never initialized.

Somehow we need to be sure that any code that relies on initializations performed in libusrp_inband.dll actually references libusrp_inband.dll in a way that the linker can recognize.

Note that adding $(BUILT_SOURCES) to libusrp_inband_qa_la_SOURCES helps but is not enough---apparently there is something else in libusrp_inband.dll that is needed.

Change History

10/11/07 20:48:35: Modified by jcorgan

  • owner changed from matt to nobody.

10/11/07 20:48:49: Modified by jcorgan

  • component changed from usrp to build.

12/03/07 19:07:20: Modified by eb

I think this has something to do with the use of global constructors (and global variables in general), and how they behave when contained in DLL's and how they are accessed from outside of the original DLL. s_ALL_PROTOCOL_CLASSES, defined in mb_protocol_class.cc is effectively a symbol table of protocol classes. Other files contain global constructors that create instances of mb_protocol_class_init. A side effect of creating those instances is to side-effect s_ALL_PROTOCOL_CLASSES.