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

Bot Waypoint (A*) Crash #189

Open
ruler501 opened this issue Aug 23, 2015 · 10 comments
Open

Bot Waypoint (A*) Crash #189

ruler501 opened this issue Aug 23, 2015 · 10 comments
Assignees
Milestone

Comments

@ruler501
Copy link
Contributor

When playing on longhorn CTF(confirm, hardcore modifiers) with bots(I tested with 8v1 and 12v1 so far) the game crashes within two minutes.

stacktrace:
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0x137ac0) [0x7f15418a8ac0]
/lib64/libc.so.6(+0x35000) [0x7f153f1df000]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0xc3839) [0x7f1541834839]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0xc404c) [0x7f154183504c]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0xcab6d) [0x7f154183bb6d]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0xcd47a) [0x7f154183e47a]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0xbd1fc) [0x7f154182e1fc]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0xc1bba) [0x7f1541832bba]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0xada73) [0x7f154181ea73]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(main+0xa83) [0x7f1541787223]
/lib64/libc.so.6(__libc_start_main+0x114) [0x7f153f1ca1e4]
/run/media/devon/Share/C++/ACR/acr/bin_unix/native_client(+0x1d7ac) [0x7f154178e7ac]
ACR error (11) (Couldn't open packages/maps/preview/warroom.jpg)

That's the relevant stacktrace without debugging enabled. I'll test with debugging and see if I can figure out where in the code this is occurring.

EDIT: Doesn't appear to happen when debugging is enabled and optimization is turned off. I'll keep looking into it.

@theonlypwner
Copy link
Member

It would be much easier if the stacktrace had debug symbols.

@ruler501
Copy link
Contributor Author

I tried duplicating with debugging turned on and couldn't. I'm still trying
to find out what's going on in between classes.

On Sun, Aug 23, 2015 at 10:11 PM Victor notifications@github.com wrote:

It would be much easier if the stacktrace had debug symbols.


Reply to this email directly or view it on GitHub
#189 (comment).

@theonlypwner
Copy link
Member

Is it possible to duplicate this with debug mode off but symbols on?

@ruler501
Copy link
Contributor Author

I'll try that when I get the chance.

On Mon, Aug 24, 2015 at 4:54 PM Victor notifications@github.com wrote:

Is it possible to duplicate this with debug mode off but symbols on?


Reply to this email directly or view it on GitHub
#189 (comment).

@theonlypwner
Copy link
Member

For me, it seems to crash within a minute (similar to what you described) on ac_complex.

I was able to get a stack trace, but I couldn't use the debugger: the mouse wasn't working (probably related to how the game hides the mouse cursor).

debugger crash

It looks like bots have memory leaks when heading to some item pickups.

@theonlypwner
Copy link
Member

Compiling in Release mode, I get a dialog box saying something about Couldn't open packages/maps/preview/acr_recreation.jpg, and the debugger breaks at main.cpp:21

void cleanup(char *msg)         // single program exit point;
{
    if(!msg)
    {
        cleanupclient();
        audiomgr.soundcleanup();
        cleanupserver();

        extern void cleargamma();
        cleargamma();
    }
    SDL_ShowCursor(1);
    if(msg)
    {
        #ifdef WIN32
        MessageBox(NULL, msg, "ACR fatal error", MB_OK|MB_SYSTEMMODAL|MB_ICONERROR);
        #else // <-- the debugger points here
        printf("%s", msg);
        #endif
    }
    SDL_Quit();
}

But if I break before that happens, I find that memory usage spikes up and the debugger points to the same place as in Debug mode.
The trick is to set the map (for me, to ac_complex, but you might be able to use longhorn) and use /sleep 2000 "botbalance 256". Then quickly ALT+TAB out of the game so that it doesn't lock up your mouse.
Also, in cube > Properties > Configuration Properties > Debugging, change Working Directory to ../.. and Command Arguments to --home=home --mod=acr --init.

release crash

Note that the this pointer is NULL this time, but I manually pressed break in the debugger. In the Debug version, it did an automatic break and the this pointer was not NULL.

I'm going to see if I can find the cause of this memory leak.

theonlypwner added a commit that referenced this issue Dec 31, 2015
@theonlypwner
Copy link
Member

I temporarily fixed it by checking the linked lists for cycles before copying them.
The real source of the bug needs to be found though.

The linked lists are probably built incorrectly (there is a cycle when there should not be), or a flag (maybe bIsClosed) is not set properly.

I use this command before I ALT+TAB to the debugger:
/sleep 2000 "dm ac_complex;botbalance 256;gamespeed 1000"

@theonlypwner theonlypwner changed the title Crash on longhorn CTF Bot Waypoint (A*) Crash Dec 31, 2015
theonlypwner added a commit that referenced this issue Jan 2, 2016
@theonlypwner
Copy link
Member

Commit b31602a fixes the crashes before addressing this issue (in 28ab7c0 before 9203225)

I tested on longhorn, but I couldn't get crashes like on ac_complex.

Not fixed yet: 28ab7c0
Temporarily fixed: 9203225
...
Better temporary fix: b31602a

@theonlypwner theonlypwner modified the milestones: 2.6.4/2.7.1, 2.6.3 (2.7 Beta 3) Jan 11, 2016
@theonlypwner
Copy link
Member

This is temporarily fixed, but the actual fix is postponed to 2.6.4.

@theonlypwner theonlypwner modified the milestones: 2.6.4, 2.7/2.6.5 Sep 2, 2018
@theonlypwner
Copy link
Member

The actual fix is postponed again.

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

No branches or pull requests

2 participants