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

Segmentation fault while running several AIs #3566

Closed
DorpsGek opened this issue Jan 25, 2010 · 6 comments
Closed

Segmentation fault while running several AIs #3566

DorpsGek opened this issue Jan 25, 2010 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

jeremybennett opened the ticket and wrote:

I am repeatedly getting a segmentation fault when running 0.7.5. This occurs when running my own NoAI AI (JeremyAI), and the problem has only started since I introduced code using AIGroup.StartAutoReplace.

I've tried running under GDB to capture a backtrace as follows:

(gdb) bt
# 0 std::_Rb_tree_increment (__x=0x19)
at ../../../../libstdc++-v3/src/tree.cc:63
# 1 0x0015f13d in std::_Rb_tree_increment (__x=0x8d0d760)
at ../../../../libstdc++-v3/src/tree.cc:83
# 2 0x080b7eab in ftell () at ioftell.c:37
# 3 0x08096d45 in ftell () at ioftell.c:37
# 4 0x08077998 in ftell () at ioftell.c:37
# 5 0x0807a6f1 in ftell () at ioftell.c:37
# 6 0x0804d572 in ftell () at ioftell.c:37
# 7 0x081c020a in ftell () at ioftell.c:37
# 8 0x08086ada in ftell () at ioftell.c:37
# 9 0x080811a3 in ftell () at ioftell.c:37
# 10 0x08180116 in ftell () at ioftell.c:37
# 11 0x08181060 in ftell () at ioftell.c:37
# 12 0x0821de55 in ftell () at ioftell.c:37
# 13 0x08182071 in ftell () at ioftell.c:37
# 14 0x0820ec13 in ftell () at ioftell.c:37
# 15 0x00782a86 in __libc_start_main (main=0x820ebd0 <ftell+1846508>, argc=1,
ubp_av=0xbffff104, init=0x8253790 <ftell+2128044>,
fini=0x8253780 <ftell+2128028>, rtld_fini=0x7587e0 <_dl_fini>,
stack_end=0xbffff0fc) at libc-start.c:220
# 16 0x0804bf21 in ftell () at ioftell.c:37
(gdb)

It seems the tree being processed when the fault has occurred is corrupt - 0x19 seems an unlikely valid pointer value:

(gdb) print __x
$2 = (std::_Rb_tree_node_base *) 0x19
(gdb)

I attach the most recent autosave session and the main.nut and info.nut (the only files) from JeremyAI.

Let me know if I can add more diagnostics to help track the problem.

Attachments

Reported version: 0.7.5
Operating system: All


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

Rubidium wrote:

The stack trace you posted looks very wrong; ioftell shouldn't be nested like that.

Can you make an OpenTTD binary with debug symbols and optimisations disabled (./configure --enable-debug=3) and get a stack trace from there? If you can't reproduce the issue you can try it with debug levels 2 or even 1, but the traces become less precise with lower numbers.

Could you also test whether this still happens in the last beta (1.0.0-beta3)?

Finally, can you give more information about the used compiler/platform? Can be done by attaching the crash.log that 1.0.0-beta3 will produce on crashes.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3566#comment7459

@DorpsGek
Copy link
Member Author

frosch wrote:

Similar issue was fixed in r18931. Maybe this one is a different one nevertheless.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3566#comment7469

@DorpsGek
Copy link
Member Author

jeremybennett wrote:

Apologies for the delay in follow up. I can reproduce this reliably in 1.0.0-RC1.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3566#comment7636

@DorpsGek
Copy link
Member Author

Rubidium wrote:

Can you post the crashlog and the full backtrace, i.e. ./configure --enable-debug=3 && make run-gdb and then 'bt full' once crashed.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3566#comment7637

@DorpsGek
Copy link
Member Author

jeremybennett wrote:

Rebuild in progress using --enable-debug=3. In the meantime, here is a run from standard openttd with a GDB backtrace.

One of the problems with reproducing is that the AI causing the trouble was before I had implemented save and restore. So you have to run for approx 10-15 years from 1950 until the crash occurs.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3566#comment7638

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r19293


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

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) 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