← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/casern_workersqueue into lp:widelands

 

Thank you both for looking at this. When looking sooner in the travis log I found these lines:

test/maps/plain.wmf/scripting/test_casern.lua ... 
  Running Widelands ... *** Error in `build/src/widelands': double free or corruption (!prev): 0x000000000670d1e0 ***
FAIL

So you are right SirVer: A double free in any case. But I would guess some memory corruption, too, since it does not appear every time.
Through running the test a lot of times I was able to get the following backtrace. Seems like the CmdQueue has problems when cleaning up on program exit.

[...]
MO(7,barbarians_barracks): Recruit leaving
MO(2,barbarians_lumberjacks_hut): Lumberjack leaving

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x00007ffff518b8c0 in _int_free (av=0x7ffff54acb00 <main_arena>, p=0x55555d89b6e0, 
    have_lock=0) at malloc.c:4049
4049	malloc.c: No such file or directory.
A debugging session is active.

	Inferior 1 [process 6294] will be killed.

Quit anyway? (y or n) n
Not confirmed.
(gdb) bt
#0  0x00007ffff518b8c0 in _int_free (av=0x7ffff54acb00 <main_arena>, p=0x55555d89b6e0, have_lock=0) at malloc.c:4049
#1  0x0000555555ff2ec4 in __gnu_cxx::new_allocator<Widelands::CmdQueue::CmdItem>::deallocate (this=0x555558b2aae0, __p=0x55555d89b6f0) at /usr/include/c++/6/ext/new_allocator.h:110
#2  0x0000555555ff2828 in std::allocator_traits<std::allocator<Widelands::CmdQueue::CmdItem> >::deallocate (__a=..., __p=0x55555d89b6f0, __n=8) at /usr/include/c++/6/bits/alloc_traits.h:442
#3  0x0000555555ff1efe in std::_Vector_base<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >::_M_deallocate (this=0x555558b2aae0, __p=0x55555d89b6f0, __n=8)
    at /usr/include/c++/6/bits/stl_vector.h:178
#4  0x0000555555ff19bd in std::_Vector_base<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >::~_Vector_base (this=0x555558b2aae0, __in_chrg=<optimized out>)
    at /usr/include/c++/6/bits/stl_vector.h:160
#5  0x0000555555ff16b9 in std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >::~vector (this=0x555558b2aae0, __in_chrg=<optimized out>)
    at /usr/include/c++/6/bits/stl_vector.h:427
#6  0x0000555555ff1658 in std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> >::~priority_queue (this=0x555558b2aae0, __in_chrg=<optimized out>) at /usr/include/c++/6/bits/stl_queue.h:397
#7  0x0000555555ff30d1 in std::_Destroy<std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> > > (__pointer=0x555558b2aae0) at /usr/include/c++/6/bits/stl_construct.h:93
#8  0x0000555555ff2c34 in std::_Destroy_aux<false>::__destroy<std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> >*> (__first=0x555558b2aae0, __last=0x555558c84ae0) at /usr/include/c++/6/bits/stl_construct.h:103
#9  0x0000555555ff21d7 in std::_Destroy<std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> >*> (__first=0x555558a84ae0, __last=0x555558c84ae0) at /usr/include/c++/6/bits/stl_construct.h:126
#10 0x0000555555ff1c27 in std::_Destroy<std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> >*, std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> > > (__first=0x555558a84ae0, __last=0x555558c84ae0) at /usr/include/c++/6/bits/stl_construct.h:151
#11 0x0000555555ff182b in std::vector<std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> >, std::allocator<std::priority_queue<Widelands::CmdQueue::CmdItem, std::vector<Widelands::CmdQueue::CmdItem, std::allocator<Widelands::CmdQueue::CmdItem> >, std::less<Widelands::CmdQueue::CmdItem> > > >::~vector (this=0x7fffffffd5a0, __in_chrg=<optimized out>) at /usr/include/c++/6/bits/stl_vector.h:426
#12 0x0000555555ff0c2e in Widelands::CmdQueue::~CmdQueue (this=0x7fffffffd590, __in_chrg=<optimized out>) at ../src/logic/cmd_queue.cc:46
#13 0x0000555555eda50e in Widelands::Game::~Game (this=0x7fffffffd3c0, __in_chrg=<optimized out>) at ../src/logic/game.cc:133
#14 0x0000555555dc3343 in WLApplication::run (this=0x555556ae3a90) at ../src/wlapplication.cc:423
#15 0x0000555555dc1a1d in main (argc=10, argv=0x7fffffffd888) at ../src/main.cc:49
-- 
https://code.launchpad.net/~widelands-dev/widelands/casern_workersqueue/+merge/309763
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/casern_workersqueue into lp:widelands.


References