Bug - Fixed Breakfast infinite loop

illarion

Member
17849 (but has existed for two weeks or more, I believe)

With one multi, on login, with the "breakfast" box checked, Mafia gets stuck in an infinite loop. Esc does not stop it, only "exit KoLMafia".

Leaving the breakfast box unchecked, I can login fine. Calling "breakfast" from the CLI gets stuck in the loop.

Does not happen with other multi, or main. Only obvious difference I can think of is different clans.

I have deleted all files relating to that character from /settings and /data, no difference.

CLI output looks like this:

Executing request...
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
Unexpected error, debug log printed.
Executing request...
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
Unexpected error, debug log printed.
Executing request...
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
Unexpected error, debug log printed.
<repeat>

The character *is* in a clan with a Mr Klaw game, and clicking it manually shows the 'already used this' text.

I am not able to upload the debug log - website fails to upload with fairly unhelpful "DEBUG_20170224.txt: Upload of file failed." - but it looks like this:
I can of course provide it by email or whatever if needed.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Sat Feb 25 00:31:50 GMT 2017
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


class java.lang.NullPointerException: null
java.lang.NullPointerException
at net.sourceforge.kolmafia.request.ClanRumpusRequest.parseResponse(ClanRumpusRequest.java:487)
at net.sourceforge.kolmafia.request.ClanRumpusRequest.processResults(ClanRumpusRequest.java:441)
at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:2586)
at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:2464)
at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:2054)
at net.sourceforge.kolmafia.request.GenericRequest.externalExecute(GenericRequest.java:1618)
at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1601)
at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1321)
at net.sourceforge.kolmafia.request.ClanRumpusRequest.run(ClanRumpusRequest.java:435)
at net.sourceforge.kolmafia.request.ClanRumpusRequest.getBreakfast(ClanRumpusRequest.java:634)
at net.sourceforge.kolmafia.session.BreakfastManager.checkRumpusRoom(BreakfastManager.java:164)
at net.sourceforge.kolmafia.session.BreakfastManager.getBreakfast(BreakfastManager.java:130)
at net.sourceforge.kolmafia.session.LoginManager.doLogin(LoginManager.java:125)
at net.sourceforge.kolmafia.session.LoginManager.login(LoginManager.java:81)
at net.sourceforge.kolmafia.request.LoginRequest.processLoginRequest(LoginRequest.java:409)
at net.sourceforge.kolmafia.request.GenericRequest.handleServerRedirect(GenericRequest.java:2185)
at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:2064)
at net.sourceforge.kolmafia.request.GenericRequest.externalExecute(GenericRequest.java:1618)
at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1601)
at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1321)
at net.sourceforge.kolmafia.request.LoginRequest.run(LoginRequest.java:270)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:286)
at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:249)
at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.doLogin(LoginFrame.java:344)
at net.sourceforge.kolmafia.swingui.LoginFrame$LoginPanel.actionConfirmed(LoginFrame.java:300)
at net.sourceforge.kolmafia.swingui.panel.GenericPanel$ConfirmedListener.execute(GenericPanel.java:626)
at net.sourceforge.kolmafia.swingui.listener.ThreadedListener.run(ThreadedListener.java:239)
at net.sourceforge.kolmafia.RequestThread$SequencedRunnable.run(RequestThread.java:418)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

<repeat, with slightly later timestamp>
 

lostcalpolydude

Developer
Staff member
That debug log posted there is sufficient.

I don't understand why there's an error. The rumpus room was parsed (it has the Klaw Game listed to make the request to begin with). The last value of getClanRumpus() would have to be null I guess? That would mean recognizing that there is a ballpit, but failing to parse how many balls it has. I see that having 1 ball would fail to match (fixed in 17857), but I doubt that was the cause of illarion's error.
 

illarion

Member
Ooh, you're good :) That clan's ballpit did indeed have a single ball. 17858 however still exhibits the infinite loop.

By the way, clearing the "visit clan rumpus room" checkbox in preferences->automation->In/After Ronin works around it, as you'd expect.
 

Veracity

Developer
Staff member
Code:
		if ( ClanManager.getClanRumpus().contains( "Mr. Klaw \"Skill\" Crane Game" ) )
		{
			request.visitEquipment( 3, 3 );

			while ( Preferences.getInteger( "_klawSummons" ) < 3 )
			{
				request.run();
			}
		}
If _klawSummons never increments, that loop will never terminate. I would have expected it to abort on that exception, however.
Studying...
 

lostcalpolydude

Developer
Staff member
Ooh, you're good :) That clan's ballpit did indeed have a single ball. 17858 however still exhibits the infinite loop.

By the way, clearing the "visit clan rumpus room" checkbox in preferences->automation->In/After Ronin works around it, as you'd expect.

Now that I've read the wiki, I see that there is a special message for a single ball. That shouldn't be too hard to fix then.
 

lostcalpolydude

Developer
Staff member
Code:
		if ( ClanManager.getClanRumpus().contains( "Mr. Klaw \"Skill\" Crane Game" ) )
		{
			request.visitEquipment( 3, 3 );

			while ( Preferences.getInteger( "_klawSummons" ) < 3 )
			{
				request.run();
			}
		}
If _klawSummons never increments, that loop will never terminate. I would have expected it to abort on that exception, however.
Studying...

I thought about fixing that, but I didn't want to just band-aid over the bug reported here. It's probably a good idea to handle that though.
 

lostcalpolydude

Developer
Staff member
Looks like 17859 (from Veracity) should have fixed the bug. 17860 should properly recognize a single ball in a ballpit.

I have some code to prevent infinite looping if _klawSummons doesn't increment, but I want to run it through at least one fresh breakfast before committing.
 

illarion

Member
Probably redundant to say so, but I have just had the opportunity to test, and can confirm that the problem character is no longer experiencing the issue (17870). Thanks again!
 
Top