Bug 40 - Samples/Examples linked shared sometimes do nothing or hang
: Samples/Examples linked shared sometimes do nothing or hang
Status: RESOLVED FIXED
: ns-3
samples
: pre-release
: PC Windows
: P1 blocker
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-06-19 17:07 EDT by
Modified: 2008-07-01 13:32 EDT (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-06-19 17:07:43 EDT
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.
------- Comment #1 From 2007-06-19 18:31:01 EDT -------
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.
------- Comment #2 From 2007-06-19 19:41:25 EDT -------
*** Bug 31 has been marked as a duplicate of this bug. ***
------- Comment #3 From 2007-08-02 10:14:30 EDT -------
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.
------- Comment #4 From 2007-08-03 14:40:19 EDT -------
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.
------- Comment #5 From 2007-09-13 05:49:22 EDT -------
I think this is fixed already?
------- Comment #6 From 2007-09-14 01:05:56 EDT -------
this was fixed in previous release by Mathieu.