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

Segfault #4506

Closed
DorpsGek opened this issue Feb 13, 2011 · 3 comments
Closed

Segfault #4506

DorpsGek opened this issue Feb 13, 2011 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

dhaval opened the ticket and wrote:

https://bugzilla.redhat.com/show_bug.cgi?id=677068 has all the details and the saved game.

gdb backtrace follows

(gdb) bt
# 0 0x0000003d2dc6cbc5 in std::_Rb_tree_rebalance_for_erase (__z=, __header=...) at ../../../../libstdc++-v3/src/tree.cc:363
# 1 0x0000000000512a71 in erase (this=0x3b24c48, __first=..., __last=...) at /usr/include/c++/4.5.1/bits/stl_tree.h:1366
# 2 std::_Rb_tree<int, std::pair<int const, int>, std::_Select1st<std::pair<int const, int> >, std::less, std::allocator<std::pair<int const, int> > >::erase (this=0x3b24c48, __first=..., __last=...) at /usr/include/c++/4.5.1/bits/stl_tree.h:1449
# 3 0x0000000000512afa in std::_Rb_tree<int, std::pair<int const, int>, std::_Select1st<std::pair<int const, int> >, std::less, std::allocator<std::pair<int const, int> > >::erase (this=0x3b24c48, __x=) at /usr/include/c++/4.5.1/bits/stl_tree.h:1428
# 4 0x0000000000510854 in erase (this=0x3b24c20, item=1714579) at /usr/include/c++/4.5.1/bits/stl_map.h:604
# 5 AIAbstractList::RemoveItem (this=0x3b24c20, item=1714579) at /usr/src/debug/openttd-1.0.5/src/ai/api/ai_abstractlist.cpp:428
# 6 0x000000000051099d in AIAbstractList::KeepValue (this=0x3b24c20, value=1) at /usr/src/debug/openttd-1.0.5/src/ai/api/ai_abstractlist.cpp:691
# 7 0x00000000005081ba in SQCall (vm=0x370f350) at /usr/src/debug/openttd-1.0.5/src/script/squirrel_helper.hpp:263
# 8 SQConvert::DefSQNonStaticCallback<AIAbstractList, void (AIAbstractList::*)(int)> (vm=0x370f350) at /usr/src/debug/openttd-1.0.5/src/script/squirrel_helper.hpp:782
# 9 0x00000000004d401a in SQVM::CallNative (this=0x370f350, nclosure=0x3719cd0, nargs=, stackbase=41, retval=..., suspend=@0x7fffffffc90c) at /usr/src/debug/openttd-1.0.5/src/3rdparty/squirrel/squirrel/sqvm.cpp:1171
# 10 0x00000000004d5155 in SQVM::Execute (this=0x370f350, closure=, target=, nargs=, stackbase=, outres=..., raiseerror=1, et=SQVM::ET_RESUME_OPENTTD)
at /usr/src/debug/openttd-1.0.5/src/3rdparty/squirrel/squirrel/sqvm.cpp:782
# 11 0x00000000004a6d96 in sq_resumecatch (v=, suspend=) at /usr/src/debug/openttd-1.0.5/src/3rdparty/squirrel/squirrel/sqapi.cpp:1017
# 12 0x000000000065975c in Squirrel::Resume (this=0x36c63c0, suspend=) at /usr/src/debug/openttd-1.0.5/src/script/squirrel.cpp:193
# 13 0x00000000004f111f in AIInstance::GameLoop (this=0x36a42f0) at /usr/src/debug/openttd-1.0.5/src/ai/ai_instance.cpp:381
# 14 0x00000000004df173 in AI::GameLoop () at /usr/src/debug/openttd-1.0.5/src/ai/ai_core.cpp:75
# 15 0x00000000005f1cab in StateGameLoop () at /usr/src/debug/openttd-1.0.5/src/openttd.cpp:1267
# 16 0x00000000005f2230 in GameLoop () at /usr/src/debug/openttd-1.0.5/src/openttd.cpp:1343
# 17 0x00000000006c7931 in VideoDriver_SDL::MainLoop (this=) at /usr/src/debug/openttd-1.0.5/src/video/sdl_v.cpp:578
# 18 0x00000000005f107e in ttd_main (argc=, argv=0x7fffffffdf98) at /usr/src/debug/openttd-1.0.5/src/openttd.cpp:760
# 19 0x0000003d29c1ee5d in __libc_start_main (main=0x5fc690 <main(int, char**)>, argc=1, ubp_av=0x7fffffffdf98, init=, fini=, rtld_fini=, stack_end=0x7fffffffdf88) at libc-start.c:226
# 20 0x00000000004a1599 in _start ()
(gdb)

Reported version: 1.0.5
Operating system: Linux


This issue was imported from FlySpray: https://bugs.openttd.org/task/4506
@DorpsGek
Copy link
Member Author

Rubidium wrote:

Can you reliably reproduce the crash with the given savegame?

What version of the AI are you using?


This comment was imported from FlySpray: https://bugs.openttd.org/task/4506#comment9674

@DorpsGek
Copy link
Member Author

Rubidium wrote:

Interestingly the bug does not show itself anymore after applying the fix for #4324 (r21605).

That can only mean that the memory of the company that was just removed (the one you merged with) was reused by the AI. Then the cargopayment tried to modify some memory that it assumed to be a company, but that was already used by the AI. That eventually caused the AI to crash as the state of the list got corrupted.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4506#comment9675

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Duplicate

Of #4324


This comment was imported from FlySpray: https://bugs.openttd.org/task/4506

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) duplicate labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant