Bugzilla – Bug 41
Statically linked simple-p2p and simple-p2p.exe assert
Last modified: 2009-11-23 08:26:50 EST
The symptom while running simple-p2p (either cygwin or linux) is Invalid value: Queue=DropTailQueue Segmentation fault This is the output of an assert that fires during Bind(). The root cause is that the following (global constructor) code in drop-tail-queue.cc is not executed: const ClassId DropTailQueue::cid = MakeClassId<DropTailQueue> ("DropTailQueue", Queue::iid); This code is not executed since simple-p2p doesn't directly reference drop-tail-queue.o and therefore the linker optimizes out the calls to initialize the constructors. If I add the following code to simple-p2p.cc DropTailQueue *q = new DropTailQueue; delete q; The linker figures out that I'm interested in drop-tail-queue.o and will run the global constructor and the Bind() will succeed, but another assert fires at a later time, No Scheduler factory registered Segmentation fault Presumably due to the same "feature." Generally the answer to problems like this is to use shared libraries. Unfortunately, shared library versions don't work on Cygwin (see bug 40)
this does not seem to be a blocker because it doesn't seem that we are going to easily fix this and it doesn't seem to bother anyone. Should we change to WONTFIX?
I think that the bug could be fixed and that there are some pretty good reasons to fix this bug in the long term. It is just a matter of not enough manpower for now for such a not-so-immediately useful feature.
changed to P3; not a blocker.
This bug got fixed when we added real support for static optimized builds. i.e., -Wl,--whole-archive is the link-time option we used to deal with this.