Bug Mafia randomly thinking I'm naked

Terrabull

Member
Didn't get a debug log, last one is from last week, and not a stripping incident. (and not a bug, my own dumbness)
So this was weird. I went beach combing, and noticed my equipment was empty in chit and mafia. After the adventure, I used the (use) links in the results to equip the driftwood pants and hat.
I adventured several times and it didn't strip me. But then I got the Observational Gasses and clicked the (visit mourn) link, and it removed everything except the hat and pants.

EDIT: Adventure count 181
 

Attachments

  • terrabull_20200217.txt
    10.4 KB · Views: 15

Terrabull

Member
Hey, I actually got a debug log this time. I used my latte lover's mug and noticed chit said I was naked. Which was really frustrating because I was manually giving myself sleaze equipment since the modifier won't do specific elements.
I did some beach combing and other stuff, but then went to adventure and couldn't because the plumber needs items to adventure.
Adventure 613 - Mob of Zeppelin Protesters.
 

Attachments

  • DEBUG_20200220.txt
    6.1 KB · Views: 18
  • terrabull_20200220.txt
    47.3 KB · Views: 15

fronobulax

Developer
Staff member
Hey, I actually got a debug log this time. I used my latte lover's mug and noticed chit said I was naked. Which was really frustrating because I was manually giving myself sleaze equipment since the modifier won't do specific elements.
I did some beach combing and other stuff, but then went to adventure and couldn't because the plumber needs items to adventure.
Adventure 613 - Mob of Zeppelin Protesters.

I'm really good at baseless speculation. I wonder how the Maximizer differentiates between what is actually equipped and what it is considering equipping?
 

Terrabull

Member
Another strip show, this time it was extra spicy cause I was at the beach combing it.
Oddly, it let me adventure for several turns thinking I was naked before it fully stripped me.
Encounter=1519

EDIT: I found more debugs of this that I don't remember the circumstances of. Old files are 19 and 18.
 

Attachments

  • terrabull_20200225.txt
    129.8 KB · Views: 16
  • DEBUG_20200225.txt
    5.1 KB · Views: 16
  • DEBUG_20200219.txt
    2.2 KB · Views: 15
  • DEBUG_20200218.txt
    10.7 KB · Views: 15
Last edited:

Veracity

Developer
Staff member
Unsurprisingly, your checkpoints are done during between battle checks in the Relay Browser:

Code:
Created an empty implicit checkpoint
class java.lang.Exception: Created an empty implicit checkpoint
java.lang.Exception: Created an empty implicit checkpoint
	at net.sourceforge.kolmafia.StaticEntity.printStackTrace(StaticEntity.java:386)
	at net.sourceforge.kolmafia.SpecialOutfit.createImplicitCheckpoint(SpecialOutfit.java:508)
	at net.sourceforge.kolmafia.moods.RecoveryManager.runBetweenBattleChecks(RecoveryManager.java:145)
	at net.sourceforge.kolmafia.request.RelayRequest.sendWarnings(RelayRequest.java:3749)
	at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:3643)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:286)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:249)
	at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:596)
	at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:162)
	at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:135)
Created an empty implicit checkpoint
The first and second ones in your session log:

Code:
[1518] Mer-kin Library
Created an empty implicit checkpoint
> In mallmode, best MP restorative is: carbonated water lily @ 7476.0 meat total.
> In mallmode, best HP restorative is: scroll of drastic healing @ 633.3333333333334 meat total.
> In mallmode, best MP restorative is: carbonated water lily @ 7476.0 meat total.
> In mallmode, best HP restorative is: scroll of drastic healing @ 633.3333333333334 meat total.

[1518] Mer-kin Library
Encounter: Silent Strolling
Took choice 344/1: Tame it
choice.php?pwd&whichchoice=344&option=1
You acquire an item: ballast turtle
Created an empty implicit checkpoint
> In mallmode, best MP restorative is: carbonated water lily @ 7476.0 meat total.
> In mallmode, best HP restorative is: scroll of drastic healing @ 633.3333333333334 meat total.
> In mallmode, best MP restorative is: carbonated water lily @ 7476.0 meat total.
> In mallmode, best HP restorative is: scroll of drastic healing @ 633.3333333333334 meat total.
I assume that output is from your recovery script? Universal Recovery?

That first one is weird:

[1518] Mer-kin Library

But no encounter? And after printing that, we run "between battle" checks.

I wonder if you double clicked - which could cause a threading issue with the implicit checkpoint stack.

I'm going to look more at that code. Try and figure out, yet again, how we could end up setting equipment to empty.

The solution is probably to synchronize around every example of the following:

create checkpoint
... do arbitrary stuff...
restore checkpoint
 

Veracity

Developer
Staff member
Sigh.

Code:
./textui/command/BurnMpCommand.java:73:			SpecialOutfit.createImplicitCheckpoint();
./textui/command/BurnMpCommand.java:99:		SpecialOutfit.createImplicitCheckpoint();
./textui/command/CrossStreamsCommand.java:127:				SpecialOutfit.createImplicitCheckpoint();
./textui/command/CreateItemCommand.java:60:		SpecialOutfit.createImplicitCheckpoint();
./textui/command/UseSkillCommand.java:62:			SpecialOutfit.createImplicitCheckpoint();
./textui/command/BuyCommand.java:64:		SpecialOutfit.createImplicitCheckpoint();
./textui/command/MayoMinderCommand.java:123:				SpecialOutfit.createImplicitCheckpoint();
./textui/command/AcquireCommand.java:63:			SpecialOutfit.createImplicitCheckpoint();
./textui/command/AsdonMartinCommand.java:200:			SpecialOutfit.createImplicitCheckpoint();
./textui/command/MoodCommand.java:86:			SpecialOutfit.createImplicitCheckpoint();
./textui/command/MoodCommand.java:106:			SpecialOutfit.createImplicitCheckpoint();
./textui/command/RecoverCommand.java:58:			SpecialOutfit.createImplicitCheckpoint();
./textui/command/UseItemCommand.java:80:		SpecialOutfit.createImplicitCheckpoint();
./textui/RuntimeLibrary.java:4972:			SpecialOutfit.createImplicitCheckpoint();
./textui/RuntimeLibrary.java:4991:			SpecialOutfit.createImplicitCheckpoint();
./moods/MPRestoreItemList.java:526:				SpecialOutfit.createImplicitCheckpoint();
./moods/HPRestoreItemList.java:525:					SpecialOutfit.createImplicitCheckpoint();
./moods/RecoveryManager.java:145:		SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateSpecialPanel.java:153:			SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateSpecialPanel.java:196:			SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateItemPanel.java:141:				SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateItemPanel.java:185:			SpecialOutfit.createImplicitCheckpoint();
./swingui/FamiliarTrainingFrame.java:802:		SpecialOutfit.createImplicitCheckpoint();
./swingui/FamiliarTrainingFrame.java:964:		SpecialOutfit.createImplicitCheckpoint();
./swingui/SkillBuffFrame.java:455:			SpecialOutfit.createImplicitCheckpoint();
./swingui/MallSearchFrame.java:296:			SpecialOutfit.createImplicitCheckpoint();
./persistence/ConcoctionDatabase.java:916:		SpecialOutfit.createImplicitCheckpoint();
./SpecialOutfit.java:492:	public static final void createImplicitCheckpoint()
./request/MomRequest.java:122:			SpecialOutfit.createImplicitCheckpoint();
./request/UntinkerRequest.java:144:			SpecialOutfit.createImplicitCheckpoint();
./request/UseItemRequest.java:1664:			SpecialOutfit.createImplicitCheckpoint();
./request/SkateParkRequest.java:149:			SpecialOutfit.createImplicitCheckpoint();
./request/CoinMasterRequest.java:243:			SpecialOutfit.createImplicitCheckpoint();
./request/UseSkillRequest.java:1614:				SpecialOutfit.createImplicitCheckpoint();
./request/CreateItemRequest.java:463:		SpecialOutfit.createImplicitCheckpoint();
./request/GenericRequest.java:1518:			SpecialOutfit.createImplicitCheckpoint();
./request/MindControlRequest.java:135:					SpecialOutfit.createImplicitCheckpoint();
./request/FamiliarRequest.java:251:					SpecialOutfit.createImplicitCheckpoint();
./request/FamiliarRequest.java:282:					SpecialOutfit.createImplicitCheckpoint();
./request/SewerRequest.java:282:			SpecialOutfit.createImplicitCheckpoint();
./KoLAdventure.java:1386:			SpecialOutfit.createImplicitCheckpoint();
./KoLmafia.java:1365:					SpecialOutfit.createImplicitCheckpoint();
./session/BreakfastManager.java:136:		SpecialOutfit.createImplicitCheckpoint();
./session/QuestManager.java:1814:		SpecialOutfit.createImplicitCheckpoint();
./session/ResultProcessor.java:1836:					SpecialOutfit.createImplicitCheckpoint();
 

Veracity

Developer
Staff member
No. Best way to do this is to not keep a stack of checkpoints but have each place that wants a checkpoint save and restore a Checkpoint object which it owns. No need to synchronize on a static class field. Working on it.
 

Veracity

Developer
Staff member
Revision 19776 gets rid of the static SpecialOutfit.implicitPoints field. Now, any code that wants to save/restore an equipment checkpoint creates a Checkpoint object and either calls restore() or close() on it, to restore equipment or simply get rid of the object.

I could have kept the stack of checkpoints and done all the synchronization within those methods, but I saw no need to keep a stack; every place we created a checkpoint restored/disposed of it a few lines later in the same method.

So, it should now be thread-safe to manipulate checkpoints, thereby removing one source of complication.

Still not seeing how we ever saved an empty checkpoint. The stack traces indicated that we tried do so during between battle mood or restoration - and a corresponding session log indicated a possible double click in the relay browser - but I did not identify how that could result in an empty checkpoint. Since the stack traces did not help with that, they no longer happen. Perhaps I should have kept the empty checksum detection/print code so that we can see things in session logs, at least. I may put that back.

As I said, this eliminates a whole mess of thread-unsaafeness, but the root cause has still not been identified.

(If/when we update to Java 8, I will make an additional iteration over this and use the "try with resources" mechanism to save/restore checkpoints with even less code. But this was a necessary precursor; every place we create a checkpoint is now in a try/finally pattern.)
 

Veracity

Developer
Staff member
Revision 19777 prints a line to gCLI and session log when you create an empty session log. No stack trace, since that's not helpful; we want to see what happened (shortly) before that left us thinking equipment was empty. THAT is the root cause of this issue.
 

fronobulax

Developer
Staff member
Thank you. I am somewhat awed by your ability to both move towards a solution and explain what you are doing and why.
 

Terrabull

Member
Hello,
It happened again. I didn't catch exactly when it stripped me this time. I was using deck of every card, beach comb, and a tale of spelunking. All in the relay browser.
The checkpoint was made at the end of the logs. I don't have an adventure count.

Veracity: Yes I use Universal Recovery for my recovery script, the In mallmode text is from that. I don't know how to stop it. If you want me to adventure w/o UR for testing purposes I'm okay with that.

One thing that's weird is getting the implicit checkpoint error. I've had a few instances of stripping, but no debug log was created, and I was only partially stripped or something. It seems that adventuring is a sure-fire way to trigger it, but I'm not sure about any others.

Also I couldn't follow everything you said Veracity, but it's still really impressive. Sounds like this lead to a lot of code cleanup.
 

Attachments

  • DEBUG_20200304.txt
    2.6 KB · Views: 11
  • terrabull_20200304.txt
    152.2 KB · Views: 10

Veracity

Developer
Staff member
I was using ... a tale of spelunking. All in the relay browser.
Ha ha. Well, that is a special case: Spelunky has its own gear which is valid only while you in the game. We do clear out your gear when you start the game and adjust it as you play and then (supposedly) refresh your normal gear after you exit the game. Perhaps we are failing to do that? I'll haven't spelunked in a long time. I'll look at it.

Veracity: Yes I use Universal Recovery for my recovery script, the In mallmode text is from that. I don't know how to stop it. If you want me to adventure w/o UR for testing purposes I'm okay with that.
No, that's fine. There is nothing in normal adventuring that affects inventory - except certain items breaking after battle, say - but between-battle actions. can do whatever they want.
I do not make an outfit checkpoint around the betweenBattleScript - it is allowed to change your equipment - but I do around subsequent actions - moods, built-in hp & mp restoration, mana burning.

One thing that's weird is getting the implicit checkpoint error. I've had a few instances of stripping, but no debug log was created, and I was only partially stripped or something. It seems that adventuring is a sure-fire way to trigger it, but I'm not sure about any others.
I took away the debug log on making an empty checkpoint. I don't recall hearing about partial stripping. If adventuring causes it, my suspicion is the between battle script.

I'll stick in checkpointing around the betweenBattleScript, but will not restore the checkpoint. Instead, I'll make it compare current equipment to the saved checkpoint and log (to gCLI and session log) any differences. I expect we (somebody) will see things like automatically equipping protonic accelerator for ghost busting, and so on, but perhaps we can detect unexpected stuff as well.
 

Terrabull

Member
Partial stripping is a new phenomenon, I haven't worked it out yet. Sometimes Chit will say I'm naked, but mafia will say I'm fine, but if I equip something after it showing blank, Mafia will take off everything BUT that at some point (usually not the first adventure, which is very weird.)
I don't have anything solid, and it doesn't show up in the logs the same way the empty checkpoint does (with the Mafia thinks this is nothing lines), so I haven't been able to give you anything about it.

EDIT: Just got a partial strip. No debug log was printed, but here are the session results. The only thing I had done today, was load the main page, run breakfast, run clipart.ash (which prices and sells clip art), and gone to the Chateau. All of these were done through Daily Deeds.

EDIT2: Another empty checkpoint minutes later, still no debug.
 

Attachments

  • terrabull_20200305.txt
    22.1 KB · Views: 11
  • terrabull_20200305.txt
    22.3 KB · Views: 10
Last edited:

Terrabull

Member
No debug log, but an implicit checkpoint.. It really doesn't like beach combing, I feel like every time I use it, it strips me.
 

Attachments

  • terrabull_20200305.txt
    7.7 KB · Views: 11

fronobulax

Developer
Staff member
It really doesn't like beach combing, I feel like every time I use it, it strips me.

Stop frequenting nude beaches? Define an outfit named Bathing Suit?

Is character status, including equipment, read only to Chit or are their circumstances where Chit might try and change outfits?

What slots get emptied in a partial strip? My hypothesis is that something tries to change to a non-custom outfit and items get removed but the new outfit does not get worn. Anything to support or refute that?
 

Terrabull

Member
Stop frequenting nude beaches?

No, Don't be unreasonable.

Is character status, including equipment, read only to Chit or are their circumstances where Chit might try and change outfits?

What slots get emptied in a partial strip? My hypothesis is that something tries to change to a non-custom outfit and items get removed but the new outfit does not get worn. Anything to support or refute that?

Chit has the ability to change outfit pieces if you click on them (it provides a small list of context choices). I know ChiT customizable, maybe that feature is what's causing this. I can try figuring out how to disable that and see if it stops happening.
Something I just found out: If Chit and mafia are blank but it hasn't stripped me, sometimes hitting refresh will fix mafia (which fixes chit.)
Partial strip usually removes everything except for whatever outfit I last equipped, or something I equipped since noticed chit/mafia was blank. For example. I went beach combing once, and got a piece of driftwood gear, in the after adventures scree, I used the equip link on it. Next time I adventured, it took off everything except that.
 

Terrabull

Member
Okay so this was a really weird one, It happens at 163 which is the mushroom garden. I didn't have boots or a fire flower, so I couldn't adventure. I equipped stuff, decided to do the Daily Dungeon first, and then when I was clicking through my inventory for a mushroom I noticed I was naked. It hasn't stopped me from adventuring because I'm still wearing all my clothes in game (mafia and Chit both thing I'm naked.)

No debug data generated.


EDIT: Okay, bought a mushroom and ate it using mafia, it stripped me before purchasing, and cast the blessing of the bird probably because it was burning mana. Lots of checkpoints for... some reason. Still no debug.
 

Attachments

  • terrabull_20200307.txt
    11.5 KB · Views: 10
Last edited:

Terrabull

Member
Just another random strip. Didn't even do anything special, I figured it would happen when I combed the beach, but no, that was fine. Just randomly.
Adventure number 921.
The strangest part is, that even after it stripped me, it put everything back on.
 

Attachments

  • terrabull_20200312.txt
    52.4 KB · Views: 9

Veracity

Developer
Staff member
Heh. I just got stripped when I was experimenting with the "fold" command.
It didn't actually fold the item it needed to do, but it equipped an item and when I unequipped it:

Code:
Use 1 mushroom slab
You acquire an item: mushroom cap

Use 1 mushroom slab
You acquire an item: mushroom cap

Use 1 mushroom slab
You acquire an item: mushroom cap

Use 1 mushroom slab
You acquire an item: mushroom cap

equip hat mushroom cap
unequip hat
*** slot weapon: KoL has Fourth of May Cosplay Saber but KoLmafia has (none)
*** slot off-hand: KoL has latte lovers member's mug but KoLmafia has (none)
*** slot back: KoL has vampyric cloake but KoLmafia has (none)
*** slot acc2: KoL has World's Best Adventurer sash but KoLmafia has (none)
*** slot acc3: KoL has Nouveau nosering but KoLmafia has (none)
*** slot familiar: KoL has astral pet sweater but KoLmafia has (none)

First time this has happened to me.
 
Top