OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000007OMNeT++IDE / NED editorpublic2008-11-26 08:122008-11-27 21:27
baumgart 
rhornig 
normalcrashrandom
resolvedfixed 
4.0b8 
4.0rc1 
0000007: IDE crash when opening ned file
IDE crashed with SEGV when trying to open a ned file:

#0 0xb7f63410 in __kernel_vsyscall ()
0000001 0xb7e05085 in raise () from /lib/tls/i686/cmov/libc.so.6
0000002 0xb7e06a01 in abort () from /lib/tls/i686/cmov/libc.so.6
0000003 0xb7e3db7c in ?? () from /lib/tls/i686/cmov/libc.so.6
0000004 0xb7e45a85 in ?? () from /lib/tls/i686/cmov/libc.so.6
0000005 0xb7e494f0 in free () from /lib/tls/i686/cmov/libc.so.6
0000006 0xb5003b11 in operator delete () from /usr/lib/libstdc++.so.6
0000007 0xb4fdf79d in std::string::_Rep::_M_destroy () from /usr/lib/libstdc++.so.6
0000008 0xb4fe1571 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string () from /usr/lib/libstdc++.so.6
0000009 0xb1ef7b6c in NED2Generator::generate ()
   from /home/baumgart/scalenet/svn/Entwicklung/omnetpp-4.0b8/ide/plugins/org.omnetpp.ide.nativelibs.linux.x86_4.0.0.0811141943-9959/libopplibs.so
0000010 0xb1e44f8a in Java_org_omnetpp_ned_engine_nedxmlJNI_NED2Generator_1generate_1_1SWIG_11 ()
   from /home/baumgart/scalenet/svn/Entwicklung/omnetpp-4.0b8/ide/plugins/org.omnetpp.ide.nativelibs.linux.x86_4.0.0.0811141943-9959/libopplibs.so
0000011 0xb5c02e9d in ?? ()
0000012 0xb5bfbd77 in ?? ()
0000013 0xb5bfbd77 in ?? ()
0000014 0xb5bfbd77 in ?? ()
0000015 0xb5bfc253 in ?? ()
0000016 0xb5bfbd77 in ?? ()
0000017 0xb5bfc253 in ?? ()
0000018 0xb5bfbedd in ?? ()
0000019 0xb5bfbedd in ?? ()
0000020 0xb5bfbedd in ?? ()
0000021 0xb5bfc3b9 in ?? ()
0000022 0xb5bfbedd in ?? ()
0000023 0xb5bfbedd in ?? ()
0000024 0xb5bfbedd in ?? ()
0000025 0xb5bfbedd in ?? ()
0000026 0xb5bfc3b9 in ?? ()
0000027 0xb5bfbedd in ?? ()
0000028 0xb5bfbedd in ?? ()
0000029 0xb5bfbedd in ?? ()
0000030 0xb5bfbedd in ?? ()
0000031 0xb5bfc3b9 in ?? ()
0000032 0xb5bfbedd in ?? ()
0000033 0xb5bfc3b9 in ?? ()
0000034 0xb5bfbedd in ?? ()
0000035 0xb5bfc3b9 in ?? ()
0000036 0xb5bfbedd in ?? ()
0000037 0xb5bfc3b9 in ?? ()
0000038 0xb5bfbd77 in ?? ()
0000039 0xb5bfbd77 in ?? ()
0000040 0xb5bfbedd in ?? ()
0000041 0xb5bfc3b9 in ?? ()
0000042 0xb5f16188 in ?? ()
0000043 0xb5bfbedd in ?? ()
0000044 0xb5bfbedd in ?? ()
0000045 0xb5bfbedd in ?? ()
0000046 0xb5bfbedd in ?? ()
0000047 0xb5bfbedd in ?? ()
0000048 0xb5bfbedd in ?? ()
0000049 0xb5bfbedd in ?? ()
0000050 0xb5bfbedd in ?? ()
0000051 0xb5bfbedd in ?? ()
0000052 0xb5bfbedd in ?? ()
0000053 0xb5bfbedd in ?? ()
0000054 0xb5bfbd77 in ?? ()
0000055 0xb5bfbd77 in ?? ()
0000056 0xb5bfbd77 in ?? ()
0000057 0xb5bfc3b9 in ?? ()
0000058 0xb5bfbedd in ?? ()
0000059 0xb5bfbd77 in ?? ()
---Type <return> to continue, or q <return> to quit---
0000060 0xb5bfbd77 in ?? ()
0000061 0xb5bfc253 in ?? ()
0000062 0xb5bfbd77 in ?? ()
0000063 0xb5bfc3b9 in ?? ()
0000064 0xb5bfc3b9 in ?? ()
0000065 0xb5bfbedd in ?? ()
0000066 0xb5bfbd77 in ?? ()
0000067 0xb5bfbd77 in ?? ()
0000068 0xb5bfbd77 in ?? ()
0000069 0xb5bfbd77 in ?? ()
0000070 0xb5bfbd77 in ?? ()
0000071 0xb5bfbd77 in ?? ()
0000072 0xb5bfc3b9 in ?? ()
0000073 0xb5bfbedd in ?? ()
0000074 0xb5bfbd77 in ?? ()
0000075 0xb5bfbd77 in ?? ()
0000076 0xb5bfc253 in ?? ()
0000077 0xb5bfbd77 in ?? ()
0000078 0xb5bfbd77 in ?? ()
0000079 0xb5bfbd77 in ?? ()
0000080 0xb5bfc3b9 in ?? ()
0000081 0xb5bfc253 in ?? ()
0000082 0xb5bfbd77 in ?? ()
0000083 0xb5bfbd77 in ?? ()
0000084 0xb5bfc253 in ?? ()
0000085 0xb5bfbcb1 in ?? ()
0000086 0xb5bfbcb1 in ?? ()
0000087 0xb5bfbedd in ?? ()
0000088 0xb5bfbedd in ?? ()
0000089 0xb5bfbedd in ?? ()
0000090 0xb5dc3e33 in ?? ()
0000091 0xb6093d8b in ?? ()
0000092 0xb5bfbedd in ?? ()
0000093 0xb5bfbedd in ?? ()
0000094 0xb5bfbcb1 in ?? ()
0000095 0xb5bfbdb9 in ?? ()
0000096 0xb5bfbdb9 in ?? ()
0000097 0xb5f1a466 in ?? ()
0000098 0xb601629a in ?? ()
0000099 0xb5fa2111 in ?? ()
0000100 0xb5bf9249 in ?? ()
0000101 0x0621c63d in JavaCalls::call_helper () from /usr/lib/jvm/java-6-sun-1.6.0.07/jre/bin/../lib/i386/client/libjvm.so
0000102 0x063107b8 in os::os_exception_wrapper () from /usr/lib/jvm/java-6-sun-1.6.0.07/jre/bin/../lib/i386/client/libjvm.so
0000103 0x0621c4d0 in JavaCalls::call () from /usr/lib/jvm/java-6-sun-1.6.0.07/jre/bin/../lib/i386/client/libjvm.so
#104 0x06245d67 in jni_invoke_nonstatic () from /usr/lib/jvm/java-6-sun-1.6.0.07/jre/bin/../lib/i386/client/libjvm.so
0000105 0x0622a7aa in jni_CallIntMethodV () from /usr/lib/jvm/java-6-sun-1.6.0.07/jre/bin/../lib/i386/client/libjvm.so
0000106 0xb48ca45f in callback () from /home/baumgart/scalenet/svn/Entwicklung/omnetpp-4.0b8/ide/configuration/org.eclipse.osgi/bundles/113/1/.cp/libswt-gtk-3449.so
0000107 0xb486c295 in ?? ()
0000108 0xb4cd38d4 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
0000109 0xb54aa749 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
0000110 0xb54bef7b in ?? () from /usr/lib/libgobject-2.0.so.0
0000111 0xb54c0937 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#112 0xb54c0f59 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
0000113 0xb4df2667 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
0000114 0xb4e03df0 in gtk_window_propagate_key_event () from /usr/lib/libgtk-x11-2.0.so.0
0000115 0xb4e06f5c in ?? () from /usr/lib/libgtk-x11-2.0.so.0
0000116 0xb4cd38d4 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
0000117 0xb54a9069 in ?? () from /usr/lib/libgobject-2.0.so.0
0000118 0xb54aa749 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
0000119 0xb54bf10a in ?? () from /usr/lib/libgobject-2.0.so.0
0000120 0xb54c0937 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
0000121 0xb54c0f59 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
Ubuntu 8.04
No tags attached.
has duplicate 0000006closed andras IDE crash when opening complex ini file 
Issue History
2008-11-26 08:12baumgartNew Issue
2008-11-26 08:12baumgartStatusnew => assigned
2008-11-26 08:12baumgartAssigned To => rhornig
2008-11-26 15:55andrasNote Added: 0000020
2008-11-27 02:50rhornigNote Added: 0000021
2008-11-27 14:56baumgartNote Added: 0000023
2008-11-27 16:02andrasNote Added: 0000024
2008-11-27 21:19andrasRelationship addedhas duplicate 0000006
2008-11-27 21:27andrasStatusassigned => resolved
2008-11-27 21:27andrasFixed in Version => 4.0b9
2008-11-27 21:27andrasResolutionopen => fixed
2008-11-27 21:27andrasNote Added: 0000026

Notes
(0000020)
andras   
2008-11-26 15:55   
How often does this occur? With which NED files? What else do I need to do in addition to opening the files?

In a 4.0b8+ snapshot I have been unable to reproduce this so far. I imported the INET and OverSim projects, then randomly opened a few dozen NED/ini files -- no crash. Then opened all NED and ini files in the two projects (Search|File, *.ned, OK; then Select All in the search results view, and right-click Open; ditto for ini files); 321 NED files and 81 ini files were opened, and no crash.

My guess is libstdc++.so incompatibility. What version do you have exactly?
(0000021)
rhornig   
2008-11-27 02:50   
This is strange. The libopplibs.so library in b8 was statically linked with libstdc++, however from the stactrace it semes that the library dinamically loaded libstdc++.so (see stck frame 8). Here is the output from 'ldd libopplibs.so' (executed in ide/plugins/org.omnetpp.ide.nativelibs.linux.x86_4.0.0.0811141943-9959)
        linux-gate.so.1 => (0xb80cc000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7cbb000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7b5d000)
        /lib/ld-linux.so.2 (0xb80cd000)

Could you run the same command and post the result?
(0000023)
baumgart   
2008-11-27 14:56   
liboppslibs.so is indeed linked statically here, too:

        linux-gate.so.1 => (0xb7f3f000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7b2f000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb79e0000)
        /lib/ld-linux.so.2 (0xb7f40000)

But there are several shared library which are linked statically to libstdc++.so, like e.g. configuration/org.eclipse.osgi/bundles/113/1/.cp/libswt-gnome-gtk-3449.so

The local libstdc++ is version libstdc++.so.6.0.9.

I've had crashes for several times when editing ini or ned files, but unfortunately can't reproduce them right now. BTW, I've been working with pure Eclipse+CDT without problems on the same machine for several months - so I think this must be related to the OMNeT++-plugin.
(0000024)
andras   
2008-11-27 16:02   
Thanks. We weren't aware that other libs (like xulrunner) load libstdc++.so dynamically. Using this info, at last we managed to find a reproducible crash scenario [Ubuntu 8.10]:

  1. start omnetpp, and close the News view, Welcome view, Browser view, then exit
  2. restart omnetpp, then open a NED file. libopplibs.so gets loaded, but libstdc++ does NOT, so libopplibs.so uses its own statically linked libstdc++. The fact that libstdc++.so is not loaded can be checked with the command: less /proc/<omnetpp-pid>/maps
  3. open the Welcome view or an Internal Web Browser view. This loads libstdc++.so (can be verified in /proc/<pid>/maps)
  4. open an ini file ==> crash

What likely happens is that calls to the two instances of libstdc++ get mixed up in the memory, hence it crashes in trivial places like std::string destructor. It is weird that calls to the static libstdc++ instance within libopplibs.so get re-written by the dynamic linker to point to the shared libstdc++.so! (unless I'm missing something)

Looks like we must not link libstdc++ statically. (We originally did that because some people complained that the IDE didn't work -- the reason was the libopplibs.so could not be loaded because the required libstdc++.so was not present on their system).
(0000026)
andras   
2008-11-27 21:27   
Reverting to dynamic linking of libopplibs.so