Crash on reload

Old bugs stored here for reference.
Locked
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Crash on reload

Post by Gangrenous » Sun May 08, 2016 7:22 pm

I noticed if you do a /reload spawns twice, the second time before the first reload is actually complete, it will crash on Window or Linux.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash on reload

Post by Gangrenous » Sun May 08, 2016 8:27 pm

Also /repop seems to crash just about every time.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Crash on reload

Post by Jabantiz » Sun May 08, 2016 9:06 pm

/sigh, this is an old bug that always seems to reappear no matter how many times we solve it. We have put in flags for when a reload is triggered so another can't be done while the first is still running but it would seem those are no longer working as intended.

As for repop, I have no clue when that broke and will have to look into that one.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash on reload

Post by Gangrenous » Mon May 09, 2016 8:59 am

I am not sure how much help I will be, but I am looking into it.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash on reload

Post by Gangrenous » Mon May 09, 2016 10:10 am

Well before I could only click it maybe 2 ~5 times and it would crash. After some changes I clicked it about 60 times, it seemed to have queued up every click and did not crash, took about 2 minutes of the server catching up with my clicks but it did every repop without crashing. The only question is if there is any other functions in the source that use this?

Under World::Process

Code: Select all

	if(reload_spawns)
	{
		LogWrite(SPAWN__INFO, 0, "Spawns", "Reload Spawns command starting...");
		int32 t_now = Timer::GetUnixTimeStamp();
		reload_spawns = false;
		ProcessReloadSpawns();
		LogWrite(SPAWN__INFO, 0, "Spawns", "Reload Spawns completed! (took %u seconds)", Timer::GetUnixTimeStamp() - t_now);
	}
I have basically moved this into it's own function that is addressed only when the button is clicked.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash on reload

Post by Gangrenous » Mon May 09, 2016 10:11 am

This does not fix /repop though, that crashed again on my first click.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash on reload

Post by Gangrenous » Mon May 09, 2016 12:07 pm

Okay I notice if you do a /depop and then a /repop there is no crash.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Crash on reload

Post by Jabantiz » Mon May 09, 2016 5:34 pm

Any process function should not be called any where else, not sure why removing that from the loop fixed it but thanks for looking into that.

/repop just seems odd as it does a depop first any way, I wonder if the repop is starting before the depop finishes completely some how.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash on reload

Post by Gangrenous » Mon May 09, 2016 5:46 pm

Jabantiz wrote:I wonder if the repop is starting before the depop finishes completely some how.
That is exactly what is happening.
Resident Dirty Hippy

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Crash on reload

Post by Jabantiz » Wed May 11, 2016 5:40 pm

provocating wrote:Under World::Process

Code: Select all

	if(reload_spawns)
	{
		LogWrite(SPAWN__INFO, 0, "Spawns", "Reload Spawns command starting...");
		int32 t_now = Timer::GetUnixTimeStamp();
		reload_spawns = false;
		ProcessReloadSpawns();
		LogWrite(SPAWN__INFO, 0, "Spawns", "Reload Spawns completed! (took %u seconds)", Timer::GetUnixTimeStamp() - t_now);
	}
I have basically moved this into it's own function that is addressed only when the button is clicked.
This is not in the code. Where did you get your source code from? It seems like it is out of date.

EDIT: testing /repop as well and no crash on my end

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Crash on reload

Post by Gangrenous » Wed May 11, 2016 6:36 pm

Yeah it was old code, I have corrected it since then and it is very solid now. I have no idea where I had some of this code, I know I did a pull from SVN, something got crossed up. But for the last few days I have been on the newer source and things are find except for crashes when on Linux.
Resident Dirty Hippy

Locked

Who is online

Users browsing this forum: No registered users and 0 guests