Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*** Error in `./stratagus-dbg': double free or corruption (!prev): 0x000000000c16b480 *** #11

Closed
Szunti opened this issue May 24, 2015 · 5 comments

Comments

@Szunti
Copy link
Contributor

Szunti commented May 24, 2015

This is a debug build. Tried to replay the 3rd mission,
Also in CUnit::Release like in #10, but it wasn't at the end.

Backtrace:

#0  0x00007febd7d4b0eb in __lll_lock_wait_private ()
   from /usr/lib/libc.so.6
#1  0x00007febd7cd18ac in malloc () from /usr/lib/libc.so.6
#2  0x00007febd8df3a86 in ?? () from /usr/lib/libX11.so.6
#3  0x00007febd8df46a8 in _XReply () from /usr/lib/libX11.so.6
#4  0x00007febd8df011d in XSync () from /usr/lib/libX11.so.6
#5  0x00007febda370928 in ?? () from /usr/lib/libSDL-1.2.so.0
#6  0x00007febda360f4e in SDL_VideoQuit () from /usr/lib/libSDL-1.2.so.0
#7  0x00007febda33ae45 in SDL_QuitSubSystem ()
   from /usr/lib/libSDL-1.2.so.0
#8  0x00007febda33aeee in SDL_Quit () from /usr/lib/libSDL-1.2.so.0
#9  0x0000000000719fdc in CleanExit ()
    at Wyrmgus/src/video/sdl.cpp:345
#10 <signal handler called>
#11 0x00007febd7cce225 in malloc_consolidate () from /usr/lib/libc.so.6
#12 0x00007febd7ccef30 in _int_free () from /usr/lib/libc.so.6
#13 0x00007febd8e1c643 in _XimLocalIMFree () from /usr/lib/libX11.so.6
#14 0x00007febd8e1c8b4 in ?? () from /usr/lib/libX11.so.6
#15 0x00007febd8e01920 in XCloseIM () from /usr/lib/libX11.so.6
#16 0x00007febda370971 in ?? () from /usr/lib/libSDL-1.2.so.0
#17 0x00007febda360f4e in SDL_VideoQuit () from /usr/lib/libSDL-1.2.so.0
#18 0x00007febda33ae45 in SDL_QuitSubSystem ()
   from /usr/lib/libSDL-1.2.so.0
#19 0x00007febda33aeee in SDL_Quit () from /usr/lib/libSDL-1.2.so.0
#20 0x0000000000719fdc in CleanExit ()
    at Wyrmgus/src/video/sdl.cpp:345
#21 <signal handler called>
#22 0x00007febd7c8a528 in raise () from /usr/lib/libc.so.6
#23 0x00007febd7c8b93a in abort () from /usr/lib/libc.so.6
#24 0x00007febd7cc8bb2 in __libc_message () from /usr/lib/libc.so.6
#25 0x00007febd7cce0fe in malloc_printerr () from /usr/lib/libc.so.6
#26 0x00007febd7cce8db in _int_free () from /usr/lib/libc.so.6
#27 0x00000000006daf36 in CUnit::Release (this=0xc16aa50, final=false)
    at Wyrmgus/src/unit/unit.cpp:607
#28 0x000000000056709d in COrder_Die::Execute (this=0xc1a7660, unit=...)
    at Wyrmgus/src/action/action_die.cpp:119
#29 0x000000000057c6b9 in HandleUnitAction (unit=...)
    at Wyrmgus/src/action/actions.cpp:396
#30 0x000000000057cd4a in UnitActionsEachCycle<__gnu_cxx::__normal_iterator<CUnit**, std::vector<CUnit*> > > (begin=, end=)
    at Wyrmgus/src/action/actions.cpp:487
#31 0x000000000057ca28 in UnitActions ()
    at Wyrmgus/src/action/actions.cpp:517
#32 0x000000000065c133 in GameLogicLoop ()
    at Wyrmgus/src/stratagus/mainloop.cpp:256
#33 0x000000000065c398 in SingleGameLoop ()
    at Wyrmgus/src/stratagus/mainloop.cpp:390
#34 0x000000000065c431 in GameMainLoop ()
    at Wyrmgus/src/stratagus/mainloop.cpp:427
#35 0x00000000005bf5d2 in StartMap (filename="maps/earth/jutland.smp", 
    clean=true) at Wyrmgus/src/game/game.cpp:164
#36 0x0000000000736072 in tolua_stratagus_StartMap00 (tolua_S=0xe20c20)
    at Wyrmgus/debug/tolua.cpp:1055
#37 0x00007febdaa241e8 in ?? () from /usr/lib/liblua5.1.so.5.1
#38 0x00007febdaa2e92f in ?? () from /usr/lib/liblua5.1.so.5.1
#39 0x00007febdaa2462d in ?? () from /usr/lib/liblua5.1.so.5.1
#40 0x00007febdaa2391b in ?? () from /usr/lib/liblua5.1.so.5.1
#41 0x00007febdaa247ba in ?? () from /usr/lib/liblua5.1.so.5.1
#42 0x00007febdaa2057d in lua_pcall () from /usr/lib/liblua5.1.so.5.1
#43 0x000000000065b99d in LuaCallback::run (this=0x4a5f9a8, results=0)
    at Wyrmgus/src/stratagus/luacallback.cpp:149
#44 0x00000000006ac1c5 in LuaActionListener::action (this=0x4a5f9a0, 
    eventId="") at Wyrmgus/src/ui/widgets.cpp:214
#45 0x00000000005d87e8 in gcn::Widget::generateAction (this=0x4a5f7e0)
    at Wyrmgus/src/guichan/widget.cpp:594
#46 0x00000000005db9d7 in gcn::Button::mouseClick (this=0x4a5f7e0, 
    button=1)
    at Wyrmgus/src/guichan/widgets/button.cpp:269
#47 0x00000000005d82cc in gcn::Widget::_mouseInputMessage (
    this=0x4a5f7e0, mouseInput=...)
    at Wyrmgus/src/guichan/widget.cpp:480
#48 0x00000000005dd25e in gcn::Container::_mouseInputMessage (
    this=0x4f05610, mouseInput=...)
    at Wyrmgus/src/guichan/widgets/container.cpp:369
#49 0x00000000005d081c in gcn::Gui::logic (this=0xf5c460)
    at Wyrmgus/src/guichan/gui.cpp:155
#50 0x00000000006ac021 in handleInput (event=0x0)
    at Wyrmgus/src/ui/widgets.cpp:169
#51 0x000000000071cc00 in WaitEventsOneFrame ()
    at Wyrmgus/src/video/sdl.cpp:981
#52 0x00000000006b6ab4 in MenuScreen::run (this=0x4f05610, loop=true)
    at Wyrmgus/src/ui/widgets.cpp:2734
#53 0x000000000076181a in tolua_stratagus_CMenuScreen_run00 (
    tolua_S=0xe20c20) at Wyrmgus/debug/tolua.cpp:20868
#54 0x00007febdaa241e8 in ?? () from /usr/lib/liblua5.1.so.5.1
#55 0x00007febdaa2e92f in ?? () from /usr/lib/liblua5.1.so.5.1
#56 0x00007febdaa2462d in ?? () from /usr/lib/liblua5.1.so.5.1
#57 0x00007febdaa2391b in ?? () from /usr/lib/liblua5.1.so.5.1
#58 0x00007febdaa247ba in ?? () from /usr/lib/liblua5.1.so.5.1
#59 0x00007febdaa2057d in lua_pcall () from /usr/lib/liblua5.1.so.5.1
#60 0x000000000065b99d in LuaCallback::run (this=0x5094b08, results=0)
    at Wyrmgus/src/stratagus/luacallback.cpp:149
#61 0x00000000006ac1c5 in LuaActionListener::action (this=0x5094b00, 
    eventId="") at Wyrmgus/src/ui/widgets.cpp:214
#62 0x00000000005d87e8 in gcn::Widget::generateAction (this=0x5094880)
    at Wyrmgus/src/guichan/widget.cpp:594
---Type <return> to continue, or q <return> to quit---
#63 0x00000000005db9d7 in gcn::Button::mouseClick (this=0x5094880, 
    button=1)
    at Wyrmgus/src/guichan/widgets/button.cpp:269
#64 0x00000000005d82cc in gcn::Widget::_mouseInputMessage (
    this=0x5094880, mouseInput=...)
    at Wyrmgus/src/guichan/widget.cpp:480
#65 0x00000000005dd25e in gcn::Container::_mouseInputMessage (
    this=0x4820c70, mouseInput=...)
    at Wyrmgus/src/guichan/widgets/container.cpp:369
#66 0x00000000005d081c in gcn::Gui::logic (this=0xf5c460)
    at Wyrmgus/src/guichan/gui.cpp:155
#67 0x00000000006ac021 in handleInput (event=0x0)
    at Wyrmgus/src/ui/widgets.cpp:169
#68 0x000000000071cc00 in WaitEventsOneFrame ()
    at Wyrmgus/src/video/sdl.cpp:981
#69 0x00000000006b6ab4 in MenuScreen::run (this=0x4820c70, loop=true)
    at Wyrmgus/src/ui/widgets.cpp:2734
#70 0x000000000076181a in tolua_stratagus_CMenuScreen_run00 (
    tolua_S=0xe20c20) at Wyrmgus/debug/tolua.cpp:20868
#71 0x00007febdaa241e8 in ?? () from /usr/lib/liblua5.1.so.5.1
#72 0x00007febdaa2e92f in ?? () from /usr/lib/liblua5.1.so.5.1
#73 0x00007febdaa2462d in ?? () from /usr/lib/liblua5.1.so.5.1
#74 0x00007febdaa2391b in ?? () from /usr/lib/liblua5.1.so.5.1
#75 0x00007febdaa247ba in ?? () from /usr/lib/liblua5.1.so.5.1
#76 0x00007febdaa2057d in lua_pcall () from /usr/lib/liblua5.1.so.5.1
#77 0x000000000065b99d in LuaCallback::run (this=0x487da28, results=0)
    at Wyrmgus/src/stratagus/luacallback.cpp:149
#78 0x00000000006ac1c5 in LuaActionListener::action (this=0x487da20, 
    eventId="") at Wyrmgus/src/ui/widgets.cpp:214
#79 0x00000000005d87e8 in gcn::Widget::generateAction (this=0x487d840)
    at Wyrmgus/src/guichan/widget.cpp:594
#80 0x00000000005db9d7 in gcn::Button::mouseClick (this=0x487d840, 
    button=1)
    at Wyrmgus/src/guichan/widgets/button.cpp:269
#81 0x00000000005d82cc in gcn::Widget::_mouseInputMessage (
    this=0x487d840, mouseInput=...)
    at Wyrmgus/src/guichan/widget.cpp:480
#82 0x00000000005dd25e in gcn::Container::_mouseInputMessage (
    this=0x39baeb0, mouseInput=...)
    at Wyrmgus/src/guichan/widgets/container.cpp:369
#83 0x00000000005d081c in gcn::Gui::logic (this=0xf5c460)
    at Wyrmgus/src/guichan/gui.cpp:155
#84 0x00000000006ac021 in handleInput (event=0x0)
    at Wyrmgus/src/ui/widgets.cpp:169
#85 0x000000000071cc00 in WaitEventsOneFrame ()
    at Wyrmgus/src/video/sdl.cpp:981
#86 0x00000000006b6ab4 in MenuScreen::run (this=0x39baeb0, loop=true)
    at Wyrmgus/src/ui/widgets.cpp:2734
#87 0x000000000076181a in tolua_stratagus_CMenuScreen_run00 (
    tolua_S=0xe20c20) at Wyrmgus/debug/tolua.cpp:20868
#88 0x00007febdaa241e8 in ?? () from /usr/lib/liblua5.1.so.5.1
#89 0x00007febdaa2e899 in ?? () from /usr/lib/liblua5.1.so.5.1
#90 0x00007febdaa2462d in ?? () from /usr/lib/liblua5.1.so.5.1
#91 0x00007febdaa2391b in ?? () from /usr/lib/liblua5.1.so.5.1
#92 0x00007febdaa247ba in ?? () from /usr/lib/liblua5.1.so.5.1
#93 0x00007febdaa2057d in lua_pcall () from /usr/lib/liblua5.1.so.5.1
#94 0x000000000065b99d in LuaCallback::run (this=0x4f0a6b8, results=0)
    at Wyrmgus/src/stratagus/luacallback.cpp:149
#95 0x00000000006ac1c5 in LuaActionListener::action (this=0x4f0a6b0, 
    eventId="") at Wyrmgus/src/ui/widgets.cpp:214
#96 0x00000000005d87e8 in gcn::Widget::generateAction (this=0x4e6c680)
    at Wyrmgus/src/guichan/widget.cpp:594
#97 0x00000000005db9d7 in gcn::Button::mouseClick (this=0x4e6c680, 
    button=1)
    at Wyrmgus/src/guichan/widgets/button.cpp:269
#98 0x00000000005d82cc in gcn::Widget::_mouseInputMessage (
    this=0x4e6c680, mouseInput=...)
    at Wyrmgus/src/guichan/widget.cpp:480
#99 0x00000000005dd25e in gcn::Container::_mouseInputMessage (
    this=0x41a4b90, mouseInput=...)
    at Wyrmgus/src/guichan/widgets/container.cpp:369
#100 0x00000000005d081c in gcn::Gui::logic (this=0xf5c460)
    at Wyrmgus/src/guichan/gui.cpp:155
#101 0x00000000006ac021 in handleInput (event=0x0)
    at Wyrmgus/src/ui/widgets.cpp:169
#102 0x000000000071cc00 in WaitEventsOneFrame ()
    at Wyrmgus/src/video/sdl.cpp:981
#103 0x00000000006b6ab4 in MenuScreen::run (this=0x41a4b90, loop=true)
    at Wyrmgus/src/ui/widgets.cpp:2734
#104 0x000000000076181a in tolua_stratagus_CMenuScreen_run00 (
    tolua_S=0xe20c20) at Wyrmgus/debug/tolua.cpp:20868
#105 0x00007febdaa241e8 in ?? () from /usr/lib/liblua5.1.so.5.1
#106 0x00007febdaa2e899 in ?? () from /usr/lib/liblua5.1.so.5.1
#107 0x00007febdaa2462d in ?? () from /usr/lib/liblua5.1.so.5.1
#108 0x00007febdaa2391b in ?? () from /usr/lib/liblua5.1.so.5.1
#109 0x00007febdaa247ba in ?? () from /usr/lib/liblua5.1.so.5.1
#110 0x00007febdaa2057d in lua_pcall () from /usr/lib/liblua5.1.so.5.1
#111 0x000000000065b99d in LuaCallback::run (this=0x4ec60d8, results=0)
    at Wyrmgus/src/stratagus/luacallback.cpp:149
#112 0x00000000006ac1c5 in LuaActionListener::action (this=0x4ec60d0, 
    eventId="") at Wyrmgus/src/ui/widgets.cpp:214
#113 0x00000000005d87e8 in gcn::Widget::generateAction (this=0x4b4b350)
    at Wyrmgus/src/guichan/widget.cpp:594
#114 0x00000000005db9d7 in gcn::Button::mouseClick (this=0x4b4b350, 
    button=1)
    at Wyrmgus/src/guichan/widgets/button.cpp:269
#115 0x00000000005d82cc in gcn::Widget::_mouseInputMessage (
    this=0x4b4b350, mouseInput=...)
    at Wyrmgus/src/guichan/widget.cpp:480
#116 0x00000000005dd25e in gcn::Container::_mouseInputMessage (
    this=0x4ec9830, mouseInput=...)
    at Wyrmgus/src/guichan/widgets/container.cpp:369
#117 0x00000000005d081c in gcn::Gui::logic (this=0xf5c460)
    at Wyrmgus/src/guichan/gui.cpp:155
#118 0x00000000006ac021 in handleInput (event=0x0)
    at Wyrmgus/src/ui/widgets.cpp:169
#119 0x000000000071cc00 in WaitEventsOneFrame ()
    at Wyrmgus/src/video/sdl.cpp:981
#120 0x00000000006b6ab4 in MenuScreen::run (this=0x4ec9830, loop=true)
    at Wyrmgus/src/ui/widgets.cpp:2734
#121 0x000000000076181a in tolua_stratagus_CMenuScreen_run00 (
    tolua_S=0xe20c20) at Wyrmgus/debug/tolua.cpp:20868
#122 0x00007febdaa241e8 in ?? () from /usr/lib/liblua5.1.so.5.1
#123 0x00007febdaa2e899 in ?? () from /usr/lib/liblua5.1.so.5.1
#124 0x00007febdaa2462d in ?? () from /usr/lib/liblua5.1.so.5.1
#125 0x00007febdaa2391b in ?? () from /usr/lib/liblua5.1.so.5.1
#126 0x00007febdaa247ba in ?? () from /usr/lib/liblua5.1.so.5.1
#127 0x00007febdaa2057d in lua_pcall () from /usr/lib/liblua5.1.so.5.1
#128 0x00000000006631bd in LuaCall (narg=0, clear=1, exitOnError=true)
    at Wyrmgus/src/stratagus/script.cpp:165
#129 0x00000000006634cb in LuaLoadFile (
    file="Wyrmsun//scripts/guichan.lua")
    at Wyrmgus/src/stratagus/script.cpp:222
#130 0x000000000067a95b in MenuLoop ()
    at Wyrmgus/src/stratagus/stratagus.cpp:302
#131 0x000000000067b276 in stratagusMain (argc=3, argv=0x7ffe3f11a5f8)
    at Wyrmgus/src/stratagus/stratagus.cpp:780
#132 0x000000000065ba82 in main (argc=3, argv=0x7ffe3f11a5f8)
    at Wyrmgus/src/stratagus/main.cpp:37
@Andrettin
Copy link
Owner

Thanks, this helps a lot. So the issue wasn't with "final" being true, and the line the report points to is this one in unit.cpp (607):

delete[] Variable;

@Szunti
Copy link
Contributor Author

Szunti commented May 24, 2015

The memory in #10 looks different though, so maybe it's two different bug.

in #10:

0x48ff130:  0x59000000  0x59000000  0x00000021  0x00000000
0x48ff140:  0x0c4e5d60  0x00000000  0x5d9fbb78  0x00007fc4
0x48ff150:  0x00000000  0x00000000  0x0488ccd0  0x00000000
0x48ff160:  0x04ec5670  0x00000000  0x04eca210  0x00000000
0x48ff170:  0x04ec74b0  0x00000000  0x04ec83d0  0x00000000
0x48ff180:  0x0c4fbee0  0x00000000  0x04ec92f0  0x00000000
0x48ff190:  0x0c4f6070  0x00000000  0x04852cb0  0x00000000
0x48ff1a0:  0x0c5678f0  0x00000000  0x0594bca0  0x00000000
0x48ff1b0:  0x04851670  0x00000000  0x0502d000  0x00000000
0x48ff1c0:  0x0502ecd0  0x00000000  0x04ec6590  0x00000000

And here:

0xc16b480:  0x0000014e  0x00000000  0xff2f0100  0x00000000
0xc16b490:  0x00000000  0xff2e0000  0x000000ff  0x00000054
0xc16b4a0:  0xff2f0001  0x00000000  0x00000000  0xff2c0000
0xc16b4b0:  0x00000000  0x00000000  0xff2b0000  0x00000000
0xc16b4c0:  0x00000000  0xff2a0000  0x00000000  0x00000000
0xc16b4d0:  0xff290000  0x00000000  0x00000000  0xff2a0000
0xc16b4e0:  0x00000000  0x00000000  0xff280000  0x00000000
0xc16b4f0:  0x00000000  0xff270000  0x00000000  0x00000000
0xc16b500:  0xff260000  0x00000009  0x00000000  0xff160000
0xc16b510:  0x00000007  0x00000000  0xff250000  0x00000005

@Szunti
Copy link
Contributor Author

Szunti commented May 24, 2015

It seems that #10 is the delete[] Variable line too. (Using the disassembly).

@Szunti
Copy link
Contributor Author

Szunti commented May 31, 2015

May I ask how was it fixed, or was it?

@Andrettin
Copy link
Owner

Instead of copying variables, I copied their attributes (Enable, Value, etc.) instead, when inheriting from a parent. This should fix the bug, but let me know if it persists and I will reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants