OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000802OMNeT++command line toolspublic2014-12-19 21:322017-02-13 12:37
paolinux 
rhornig 
urgentmajoralways
resolvedunable to reproduce 
x86Windows8.1
4.6 
5.0 
0000802: Compilation error for files generated by message compiler (MSGC) when field is re-assigned
I was unable to compile the INET suite on Windows as I was getting the following error

MSGC: transport/rtp/RTPInterfacePacket.msg
MSGC: transport/rtp/RTPSenderControlMessage.msg
MSGC: transport/rtp/RTPSenderStatusMessage.msg

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
omnetpp-4.6/tools/win32/mingw32/include/c++/4.9.2/bits/basic_string.h:857: std::basic_string<_CharT, _Traits, _Alloc>::reference std::basic_string<_CharT, _Traits, _Alloc>::operator[](std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::basic_string<_CharT, _Traits, _Alloc>::size_type = unsigned int]: Assertion '__pos <= size()' failed.
Makefile:944: recipe for target 'transport/rtp/RTPInterfacePacket_m.h' failed
make[1]: *** [transport/rtp/RTPInterfacePacket_m.h] Error 3

Looking more into this, I managed to reproduce with a very simple file (attached). Basically, the issue seems to occur when in a packet definition a field of the parent class (e.g., kind) is redefined like in

packet Foobar {
    kind = 15;
    int someField;
}

omnetpp-4.6/tools/win32/mingw32/include/c++/4.9.2/bits/basic_string.h:857: std::basic_string<_CharT, _Traits, _Alloc>::reference std::basic_string<_CharT, _Traits, _Alloc>::operator[](std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::basic_string<_CharT, _Traits, _Alloc>::size_type = unsigned int]: Assertion '__pos <= size()' failed.
Please contact the application's support team for more information.
Makefile:99: recipe for target 'Foobar_m.cc' failed
make[1]: *** [Foobar_m.cc] Error 3
If I remove "kind = 15", everything works fine. Otherwise I got the following error (similar to the INET case)

This code works fine in omnet++ 4.5 and prior version.

Can you please look into this?

Thanks a lot,

P.

No tags attached.
msg Foobar.msg (782) 2014-12-19 21:32
https://dev.omnetpp.org/bugs/file_download.php?file_id=152&type=bug
Issue History
2014-12-19 21:32paolinuxNew Issue
2014-12-19 21:32paolinuxFile Added: Foobar.msg
2014-12-20 19:46paolinuxNote Added: 0000967
2014-12-23 21:53paolinuxNote Edited: 0000967bug_revision_view_page.php?bugnote_id=967#r8
2015-10-12 09:28ammmar1988Issue cloned: 0000866
2017-02-13 12:37rhornigNote Added: 0001318
2017-02-13 12:37rhornigStatusnew => resolved
2017-02-13 12:37rhornigFixed in Version => 5.0
2017-02-13 12:37rhornigResolutionopen => unable to reproduce
2017-02-13 12:37rhornigAssigned To => rhornig

Notes
(0000967)
paolinux   
2014-12-20 19:46   
(edited on: 2014-12-23 21:53)
Hi,

I've been looking more into this and I realized that the problem only occurs if I add -D_GLIBCXX_DEBUG to CFLAGS_DEBUG when compiling omnet. I have -D_GLIBCXX_DEBUG enabled in my project but this does not create any issue.

Given this, I feel the bug is less serious than I had though but still I think it would be worth investigating the root cause.

Thanks
P.

(0001318)
rhornig   
2017-02-13 12:37   
As the compiler toolchain was updated fot OMNeT++ 5 this is no longer relevant.