Bugzilla – Bug 40
Samples/Examples linked shared sometimes do nothing or hang
Last modified: 2008-07-01 13:32:15 UTC
One symptom is that programs appear to run, but don't do anything. When run with a debugger, you see something like the following, (gdb) run Starting program: /usr/craigdo/repos/ns-3-devx/build-dir/dbg-shared/bin/sample-ptr.exe gdb: unknown target exception 0xc0000135 at 0x7c964ed1 Program received signal ?, Unknown signal. Program exited with code 030000000465. You can't do that without a process to debug. (gdb) The "signal" is a Microsoft HRESULT which corresponds to the error "The application failed to initialize properly (0xc0000135)." This turned out in this case to mean that the (Cygwin) system could find the ns-3 DLLs but (Windows) couldn't load them. This happened because the Windows environment needs to be pointed to the lib directory as well as the Cygwin environment. I added ;C:/cygwin/usr/craigdo/repos/ns-3-devx/build-dir/dbg-shared/bin to the windows $PATH and the simpler samples started working correctly. Unfortunately, sample-simple.exe and simple-p2p.exe now hang while trying to initialize DLLs.
Why do we even have to support cygwin if ns-3 builds and runs fine with mingw? mingw is better because it doesn't use a fake libc and therefore produces native exe that requires no dll.
*** Bug 31 has been marked as a duplicate of this bug. ***
Is this is fixed already? I mean, this is the problem of the DLLs not having the ns3 prefix, right? If so, should be fixed now. If it's another problem then by all means leave it open.
The prefix fix led to the discovery of another problem with shared libraries in Cygwin, where Craig initiated a small private thread on the topic: "The problem is that a lot of other code relies on this specific c++ usage pattern where a class static member method contains a function-scope static variable and we really cannot convert these function-scope static variables to class static member variables because of the initialization ordering problems I alluded to earlier. And even if we did this, we would have to do this dreadful macro game to avoid multiple definitions." Mathieu told me that he is looking at solutions to this problem.
I think this is fixed already?
this was fixed in previous release by Mathieu.