我正在omnet ++和静脉(v2.0-rc1)下进行网络仿真,为此目的,我对4个场景进行了实验,两个场景都有20次重复。
在第3和第4种场景的仿真过程中,我遇到了一些错误(我想这是内存分配错误),它们共享一个共同的功能(ack)。
对于相关的模拟,它可以正常启动并执行几次重复,但是此后失败(例如,它在第四种情况的第五次重复中失败),这是输出:
0: *** glibc detected *** ./veins: free(): invalid next size (fast): 0x00007fff74bff590 ***
0: ======= Backtrace: =========
0: /lib/x86_64-linux-gnu/libc.so.6(+0x76aa6)[0x2aeb29d1faa6]
0: /lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x2aeb29d2484c]
0: /nfs/homes/hc.arslan90/mixim/mixim/examples/veins/../../out/gcc-release/src/modules/libmiximmodules.so(_ZN9ProphetV220executeInitiatorRoleEsP7Prophetl+0x6f4)[0x2aeb287ce334]
0: /nfs/homes/hc.arslan90/mixim/mixim/examples/veins/../../out/gcc-release/src/modules/libmiximmodules.so(_ZN9ProphetV214handleLowerMsgEP8cMessage+0x4b6)[0x2aeb287d0996]
0: /home/dist/hc.arslan90/omnetpp-4.2/lib/liboppsim.so(_ZN11cSimulation10doOneEventEP13cSimpleModule+0xb0)[0x2aeb290135a0]
0: /home/dist/hc.arslan90/omnetpp-4.2/lib/liboppcmdenv.so(_ZN6Cmdenv8simulateEv+0x170)[0x2aeb28a6f620]
0: /home/dist/hc.arslan90/omnetpp-4.2/lib/liboppcmdenv.so(_ZN6Cmdenv3runEv+0x360)[0x2aeb28a6fba0]
0: /home/dist/hc.arslan90/omnetpp-4.2/lib/liboppenvir.so(_ZN9EnvirBase3runEiPPcP14cConfiguration+0x13c)[0x2aeb28ca763c]
0: /home/dist/hc.arslan90/omnetpp-4.2/lib/liboppenvir.so(_Z18setupUserInterfaceiPPc+0x55f)[0x2aeb28ca507f]
0: /home/dist/hc.arslan90/omnetpp-4.2/lib/liboppenvir.so(evMain+0x50)[0x2aeb28ca5d30]
0: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x2aeb29cc7eed]
0: ./veins[0x402f21]
为了调试错误,我在此命令中使用了valgrind:
valgrind --tool=memecheck ./veins (with veins is the current binary of my simulation)
但似乎所有返回的错误都与我的代码无关(因为我对以前工作正常的代码做了同样的操作,并且得到相同的输出)
编辑这里是Valgrind的输出
==7454== Memcheck, a memory error detector
==7454== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==7454== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==7454== Command: ./veins
==7454== OMNeT++ Discrete Event Simulation (C) 1992-2011 Andras Varga, OpenSim Ltd. Version: 4.2, build: 111116-7631e2d, edition: Academic Public License -- NOT FOR COMMERCIAL USE See the license for distribution terms and warranty disclaimer Setting up Tkenv... Loading NED files from /media/DATA/DoctoratTlemcen/Git/mixim/mixim/src/base: 17 Loading NED files from /media/DATA/DoctoratTlemcen/Git/mixim/mixim/src/modules: 85 Loading NED files from /media/DATA/DoctoratTlemcen/Git/mixim/mixim/examples: 45
==7454== Invalid read of size 4
==7454== at 0x4CFD4A2: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFFB09: FcConfigFilename (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09188: FcInitLoadConfigAndFonts (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D0940C: FcInit (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFDCE4: FcConfigGetCurrent (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFF87F: FcConfigSubstituteWithPat (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFF8C6: FcConfigSubstitute (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x492DBD1: ??? (in /usr/lib/libtk8.5.so.0)
==7454== by 0x492E0E1: ??? (in /usr/lib/libtk8.5.so.0)
==7454== by 0x4877A40: Tk_AllocFontFromObj (in /usr/lib/libtk8.5.so.0)
==7454== Address 0x500cbbc is 20 bytes inside a block of size 22 alloc'd
==7454== at 0x402D5A9: malloc (vg_replace_malloc.c:296)
==7454== by 0x4CFD407: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFFB09: FcConfigFilename (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09188: FcInitLoadConfigAndFonts (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D0940C: FcInit (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFDCE4: FcConfigGetCurrent (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFF87F: FcConfigSubstituteWithPat (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFF8C6: FcConfigSubstitute (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x492DBD1: ??? (in /usr/lib/libtk8.5.so.0)
==7454== by 0x492E0E1: ??? (in /usr/lib/libtk8.5.so.0)
==7454==
==7454== Invalid read of size 4
==7454== at 0x4CFD4B6: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFFB09: FcConfigFilename (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09188: FcInitLoadConfigAndFonts (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== Address 0x5031690 is 16 bytes inside a block of size 18 alloc'd
==7454== at 0x402D5A9: malloc (vg_replace_malloc.c:296)
==7454== by 0x4CFD407: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFFB09: FcConfigFilename (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454==
==7454== Invalid read of size 4
==7454== at 0x4CFD4B6: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09188: FcInitLoadConfigAndFonts (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== Address 0x5007a40 is 40 bytes inside a block of size 42 alloc'd
==7454== at 0x402D5A9: malloc (vg_replace_malloc.c:296)
==7454== by 0x4CFD407: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454==
==7454== Invalid read of size 4
==7454== at 0x4CFD4A2: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09188: FcInitLoadConfigAndFonts (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== Address 0x4ff0314 is 36 bytes inside a block of size 39 alloc'd
==7454== at 0x402D5A9: malloc (vg_replace_malloc.c:296)
==7454== by 0x4CFD407: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D09065: FcInitLoadConfig (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454==
==7454== Invalid read of size 4
==7454== at 0x4CFD4B6: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== Address 0x4fbe790 is 24 bytes inside a block of size 26 alloc'd
==7454== at 0x402D5A9: malloc (vg_replace_malloc.c:296)
==7454== by 0x4CFD407: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454==
==7454== Invalid read of size 4
==7454== at 0x4CFD4A2: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFFB09: FcConfigFilename (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== Address 0x4fc7164 is 20 bytes inside a block of size 22 alloc'd
==7454== at 0x402D5A9: malloc (vg_replace_malloc.c:296)
==7454== by 0x4CFD407: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4CFFB09: FcConfigFilename (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D141EB: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D14A63: ??? (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4F58D5A: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F59A81: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F568F0: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F58331: ??? (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4F5B74A: XML_ParseBuffer (in /lib/i386-linux-gnu/libexpat.so.1.5.2)
==7454== by 0x4D14384: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454== by 0x4D146A8: FcConfigParseAndLoad (in /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4)
==7454==
Loading images from /media/DATA/DoctoratTlemcen/Git/mixim/mixim/examples/veins/bitmaps: *: 0 Loading images from ./bitmaps: *: 0 Loading images from ./images: *: 0 Loading images from /home/arslan/Bureau/Doctorat/SIM_Tools_Arslan/omnetpp-4.2/images: *: 0 abstract/*: 90 background/*: 4 block/*: 320 device/*: 195 maps/*: 9 misc/*: 70 msg/*: 55 old/*: 111 status/*: 28
Plugin path: ./plugins
RUNTIME ERROR. A cRuntimeError exception is about to be thrown, and you requested (by setting debug-on-errors=true in the ini file) that errors abort execution and break into the debugger.
You should now probably be running the simulation under gdb or another debugger. The simulation kernel will now raise a SIGABRT signal which will get you into the debugger. If you are not running under a debugger, you can still use the core dump for post-mortem debugging. Once in the debugger, view the call stack (in gdb: "bt" command) to see the context of the runtime error.
<!> Error in module (cCompoundModule) scenario (id=1) during network setup: Class "ObstacleControl" not found -- perhaps its code was not linked in, or the class wasn't registered with Register_Class(), or in the case of modules and channels, with Define_Module()/Define_Channel().
TRAPPING on the exception above, due to a debug-on-errors=true configuration option. Is your debugger ready?
==7454==
==7454== HEAP SUMMARY:
==7454== in use at exit: 29,804,879 bytes in 31,424 blocks
==7454== total heap usage: 475,694 allocs, 444,270 frees, 682,975,656 bytes allocated
==7454==
==7454== LEAK SUMMARY:
==7454== definitely lost: 3,828 bytes in 85 blocks
==7454== indirectly lost: 15,079 bytes in 473 blocks
==7454== possibly lost: 28,326,958 bytes in 19,505 blocks
==7454== still reachable: 1,459,014 bytes in 11,361 blocks
==7454== suppressed: 0 bytes in 0 blocks
==7454== Rerun with --leak-check=full to see details of leaked memory
==7454==
==7454== For counts of detected and suppressed errors, rerun with: -v
==7454== ERROR SUMMARY: 22 errors from 6 contexts (suppressed: 0 from 0) Processus arrêté
我也尝试激活转储文件并使用gdb对其进行分析,得到以下输出:
Reading symbols from /nfs/homes/hc.arslan90/mixim/mixim/examples/veins/veins...(no debugging symbols found)...done.
warning: exec file is newer than core file. [New LWP 879]
warning: Can't read pathname for load map: Erreur d'entrée/sortie.
warning: .dynamic section for "/nfs/homes/hc.arslan90/mixim/mixim/examples/veins/../../out/gcc-release/src/modules/libmiximmodules.so" is not at the expected address (wrong library or version mismatch?) [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `./veins -f /home/dist/hc.arslan90/mixim/mixim/examples/veins/petite2H_Ack/proph'. Program terminated with signal 6, Aborted.
#0 0x00002ad31876c1a5 in *__GI_raise (sig=<optimized out>)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
有人可以帮助您识别错误吗?
注意:错误的代码引入了一个特定的数据结构,它是一个std :: map,其中包含一个std :: set作为值
最佳答案
您将需要使用相同的命令行参数启动仿真的调试(或内存检查)运行;否则,将不会加载任何模型库,并且模拟将不会执行。
请注意,与如何启动模拟的调试或内存检查运行无关,您应确保在Cmdenv
(命令行环境)而不是Tkenv
中运行它。不仅可以更快地执行模拟,还可以确保所有警告都与模拟模型相关,而不是与GUI和各种GUI库相关。您可以通过将-u Cmdenv
附加到命令行,或者(在IDE中)通过编辑模拟的运行配置并选择“用户界面:命令行”来实现。
如果从命令行运行模拟,只需在通常执行opp_run
或模拟二进制文件(例如./veins
)的前面加上gdb --args
(运行调试器)或valgrind --tool=memcheck
(运行内存)即可检查器)。命令行示例可能是/usr/bin/valgrind --tool=memcheck opp_run -l../../src/veins -n../../src/veins;. -u Cmdenv
(其中添加了粗体文本)。
如果要从命令行运行模拟,但是当前正在使用OMNeT ++ IDE,则可以快速检查正在使用哪些命令行参数来运行模拟。运行模拟时,请在控制台视图中观察输出。输出可能以OMNeT++ Discrete Event Simulation
开头。在输出的开始附近,您还会发现以$
开头的两行。这些是IDE用于运行模拟的确切命令。
如果要从OMNeT ++ IDE运行模拟,请注意,它还具有内置功能,可通过调试器或内存检查器运行模拟。要在其中任一模式下运行模拟,请右键单击.ini文件(例如,模拟的omnetpp.ini
,然后选择Debug As(对于gdb)或Profile As(对于valgrind),然后选择OMNeT ++ Simulation。可以在新的Valgrind视图中找到valgrind的输出。