Bug Mafia randomly thinking I'm naked

fredg1

Member
This is happening more and more recently; mafia randomly thinks that, suddenly, I have nothing equipped:

On the most recent instance, mafia clearly knew I had something equipped:
Code:
Putting on driftwood hat...
Equipment changed.
Putting on makeshift garbage shirt...
Equipment changed.
Holding latte lovers member's mug...
Equipment changed.
Putting on three-legged pants...
Equipment changed.
Putting on codpiece...
Equipment changed.
Putting on driftwood bracelet...
Equipment changed.
Putting on Eight Days a Week Pill Keeper...
Equipment changed.
Starting game with configuration BARBARIAN BARBECUE, BRUTALIST, CATAPULT, and SHARKS...

[ Bastille Battalion ]

Approaching pool table with an aggressive stance.
You acquire an effect: Billiards Belligerence (10)
Preference _poolGames changed from 0 to 1
You lost. Boo hoo.
done
Preference questG04Nemesis changed from step4 to step5
Scanning store inventories...
Search complete.
Purchasing perfect ice cube (1 @ 100)...
*** slot hat: KoL has driftwood hat but KoLmafia has (none)
*** 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 shirt: KoL has makeshift garbage shirt but KoLmafia has (none)
*** slot pants: KoL has three-legged pants but KoLmafia has (none)
*** slot acc1: KoL has codpiece but KoLmafia has (none)
*** slot acc2: KoL has driftwood bracelet but KoLmafia has (none)
*** slot acc3: KoL has Eight Days a Week Pill Keeper but KoLmafia has (none)
Purchases complete.
Taking off driftwood hat...
Equipment changed.
Taking off Fourth of May Cosplay Saber...
Equipment changed.
Taking off latte lovers member's mug...
Equipment changed.
Taking off vampyric cloake...
Equipment changed.
Taking off makeshift garbage shirt...
Equipment changed.
Taking off three-legged pants...
Equipment changed.
Taking off codpiece...
Equipment changed.
Taking off driftwood bracelet...
Equipment changed.
Taking off Eight Days a Week Pill Keeper...
Equipment changed.

When it happened before, on the 20th:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
               Player Snapshot
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[...]
 > equipment

Hat: FantasyRealm Mage's Hat
Weapon: Fourth of May Cosplay Saber
Off-hand: Kramco Sausage-o-Matic™
Shirt: shoe ad T-shirt
Pants: three-legged pants
Back: vampyric cloake

Acc. 1: (none)
Acc. 2: (none)
Acc. 3: hewn moon-rune spoon
[...] (only skipping the rest of the "snapshot")

[I buy the 3 +15% potions from the general store, cast 1 Prevent Scurvy and Sobriety, and use some of my free beach combings]

equip hat driftwood hat

equip weapon Fourth of May Cosplay Saber
*** slot hat: KoL has driftwood hat but KoLmafia has (none)
*** slot weapon: KoL has Fourth of May Cosplay Saber but KoLmafia has (none)
*** slot off-hand: KoL has Kramco Sausage-o-Matic™ but KoLmafia has (none)
*** slot back: KoL has vampyric cloake but KoLmafia has (none)
*** slot shirt: KoL has shoe ad T-shirt but KoLmafia has (none)
*** slot pants: KoL has three-legged pants but KoLmafia has (none)
*** slot acc3: KoL has hewn moon-rune spoon but KoLmafia has (none)
(this time, mafia didn't actually change my equipment)

This also happened the day right before, on the 19th:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
               Player Snapshot
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

[...]

 > equipment

Hat: psychic's circlet
Weapon: Fourth of May Cosplay Saber
Off-hand: Kramco Sausage-o-Matic™
Shirt: makeshift garbage shirt
Pants: old sweatpants
Back: vampyric cloake

Acc. 1: (none)
Acc. 2: (none)
Acc. 3: hewn moon-rune spoon

[...] (only skipping the rest of the "snapshot", this is still literally the start of the session)

main.php?action=may4
Preference lastEncounter changed from Choose a Soundtrack to Upgrade Your May the Fourth Cosplay Saber
Encounter: Upgrade Your May the Fourth Cosplay Saber
Took choice 1386/4: Empathy Chip
choice.php?whichchoice=1386&option=4&pwd
Preference _saberMod changed from 0 to 4
*** slot hat: KoL has psychic's circlet but KoLmafia has (none)
*** slot weapon: KoL has Fourth of May Cosplay Saber but KoLmafia has (none)
*** slot off-hand: KoL has Kramco Sausage-o-Matic™ but KoLmafia has (none)
*** slot back: KoL has vampyric cloake but KoLmafia has (none)
*** slot shirt: KoL has makeshift garbage shirt but KoLmafia has (none)
*** slot pants: KoL has old sweatpants but KoLmafia has (none)
*** slot acc3: KoL has hewn moon-rune spoon but KoLmafia has (none)
(didn't auto-change my equipment there either)

The most recent time it had happened, before that, was all the way back on the 4th, then the 14th of October, then in JUNE... At the very least it shouldn't happen this FREQUENTLY
 

Veracity

Developer
Staff member
I think you edited out a lot of stuff from your session log?

Code:
Preference questG04Nemesis changed from step4 to step5
I assume you visited your "same class in guild" character, but the log didn't say "Visiting XXX"?

Code:
Scanning store inventories...
Search complete.
Purchasing perfect ice cube (1 @ 100)...
*** slot hat: KoL has driftwood hat but KoLmafia has (none)
*** 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 shirt: KoL has makeshift garbage shirt but KoLmafia has (none)
*** slot pants: KoL has three-legged pants but KoLmafia has (none)
*** slot acc1: KoL has codpiece but KoLmafia has (none)
*** slot acc2: KoL has driftwood bracelet but KoLmafia has (none)
*** slot acc3: KoL has Eight Days a Week Pill Keeper but KoLmafia has (none)
Purchases complete.
What did you do? Was this done in the GUI? In the Relay Browser? In a CLI or ASH script?
via "acquire" or "retrieve_item" or via "buy"? Or what?
If via a script, what script?

Code:
Taking off driftwood hat...
Equipment changed.
...
I assume this was restoring an outfit checkpoint. But we simply don't have the context to figure out where the checkpoint was made.

Do you run Guide?
 

fredg1

Member
I think you edited out a lot of stuff from your session log?

Code:
Preference questG04Nemesis changed from step4 to step5
I assume you visited your "same class in guild" character, but the log didn't say "Visiting XXX"?

I did. Also, the first one isn't a session log, but rather the actual output from the GCLI.

Code:
Scanning store inventories...
Search complete.
Purchasing perfect ice cube (1 @ 100)...
*** slot hat: KoL has driftwood hat but KoLmafia has (none)
*** 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 shirt: KoL has makeshift garbage shirt but KoLmafia has (none)
*** slot pants: KoL has three-legged pants but KoLmafia has (none)
*** slot acc1: KoL has codpiece but KoLmafia has (none)
*** slot acc2: KoL has driftwood bracelet but KoLmafia has (none)
*** slot acc3: KoL has Eight Days a Week Pill Keeper but KoLmafia has (none)
Purchases complete.
What did you do? Was this done in the GUI? In the Relay Browser? In a CLI or ASH script?
via "acquire" or "retrieve_item" or via "buy"? Or what?
If via a script, what script?

This was simply done via the GUI; the Purchases window.

Code:
Taking off driftwood hat...
Equipment changed.
...
I assume this was restoring an outfit checkpoint. But we simply don't have the context to figure out where the checkpoint was made.

I WASN'T running a script, which is why I'm so confused; mafia had no reason to actually change my equipment, it simply did so as I hit "purchase" after having selected an item in the "Purchases" window.

HOWEVER, I can say that I HAD JUST FINISHED using a script; visiting edam, the sauceror was actually the FIRST thing that I did once my script ended (the "done" is printed by my script once it reaches its final line).

Do you run Guide?

Yes
 
Last edited:

Terrabull

Member
Just happened to me almost as soon as I logged in. After doing my basic breakfast stuff (clicking the buttons on the main page), I went to my first battle, and noticed I was naked.

Yes I run Guide but it wasn't active at the time. I had just used the vote ability, then clicked the "Equip" link to equip it to my empty slot (I had the voted sticker on yesterday.) After I equipped the I Voted Sticker I clicked an adventure location, which activated my mood and apparently that's when it took off all my clothes, Mafia told me my semi-rare was coming up, so I opened it. Then I ran an adventure, that's when I realized I was naked.

All my actions today were through the Relay Browser, except for running clip_art.ash (which has stopped working recently, need to see if there's an update.) and turning my mood from apathetic to default.

Aside from updating KolMafia I have not made any changes, added, or removed any scripts since my last post where I detailed everything you had asked. My configuration remains the same as my last post as well.

Thank you for looking into this.

EDIT: I didn't realize this was a new thread, I'm referring to my comment in the previous thread: https://kolmafia.us/showthread.php?...ndomly-during-relay-browser-adventuring/page2
 

Attachments

  • terrabull_20191213.txt
    10.8 KB · Views: 33
Last edited:

fronobulax

Developer
Staff member
I have edited this several times because each time I go back and read what you wrote and it blows my hypothesis out of the water.

The log in the other thread shows the problem without using a relay browser equip link so I think the focus remains on moods or pre/post-adventure scripts. Which of those are you using, do any of them change outfits and, if so, what command is used to do so?

How do you realize you are naked? In particular do you actually attack with your bare hands? The code that says there is a mismatch forces Kolmafia to conform to KoL's idea of equipment so it could be that a mismatch is being detected and fixed rather than actually equipping nothing.

Both session logs show this happening after a cast so scripts or processes that acquire MP could be suspect.

I really want to construct a scenario where this is a thread access/synch type of issue but I can't make that happen yet.

Tangentially - why do you think clip_art.ash is not working? The skill was cast once in your most recent log. I don't know what script you are using but in the absence of looking at the code, I would ask what your MP and MP recovery procedures are. The two variations I am running (if I can cast it in a HC run then there are specific things I want, without regard to mall prices) only try and recover MP once and stop casting if there is not enough MP. I note references to clip_art.ash in 2013 but no code so this is not the place to check for updates :) But it may be that it stops casting because of MP or because of mall conditions. My versions, for example, won't actually request more than one of an item.
 
Last edited:

Terrabull

Member
The log in the other thread shows the problem without using a relay browser equip link so I think the focus remains on moods or pre/post-adventure scripts. Which of those are you using, do any of them change outfits and, if so, what command is used to do so?
I don't run any specific scripts that work between battles (to my knowledge)except counterchecker. I do use a lot of automated features in mafia, including moods and default HP/MP recover.
I'll upload screenshots in case that's helpful.
I do have a lot of scripts, but like Clipart they are mostly one and done scripts or turn burners. 90% of my scripts shouldn't activate unless I tell them to. I included a picture of all my scripts just in case.

How do you realize you are naked? In particular do you actually attack with your bare hands? The code that says there is a mismatch forces Kolmafia to conform to KoL's idea of equipment so it could be that a mismatch is being detected and fixed rather than actually equipping nothing.
Usually I notice by trying to attack and noticing I'm using my bare hands, then scrolling back up in the logs to see what happened. Maybe once I've had the cli window open to see the forced disorobbing.

Both session logs show this happening after a cast so scripts or processes that acquire MP could be suspect.

I really want to construct a scenario where this is a thread access/synch type of issue but I can't make that happen yet.

Tangentially - why do you think clip_art.ash is not working? The skill was cast once in your most recent log. I don't know what script you are using but in the absence of looking at the code, I would ask what your MP and MP recovery procedures are. The two variations I am running (if I can cast it in a HC run then there are specific things I want, without regard to mall prices) only try and recover MP once and stop casting if there is not enough MP. I note references to clip_art.ash in 2013 but no code so this is not the place to check for updates :) But it may be that it stops casting because of MP or because of mall conditions. My versions, for example, won't actually request more than one of an item.

You were right, Clipart isn't running cause I don't have mall access.
 

Attachments

  • HP-MP_Recovery.png
    HP-MP_Recovery.png
    24.2 KB · Views: 27
  • default_mood.png
    default_mood.png
    16.5 KB · Views: 31
  • scripts.png
    scripts.png
    29.4 KB · Views: 24
  • script_manager_1.png
    script_manager_1.png
    81.6 KB · Views: 26
  • script_manager_2.png
    script_manager_2.png
    44.1 KB · Views: 23

Terrabull

Member
Sorry for the bump, but it just happened again.
I was just adventuring like normal underwater, then went to my inventory to look at changing my weapon. but then I saw that the mafia gear changer had me wearing nothing.

I ran a script (cc_snapshot) and mafia forcefully stripped me naked.

I was running version v19.11 r19645 at the time, I hadn't updated yet today.

Not even a between battle incident this time as far as I can see.

EDIT: After that I closed Mafia and updated it, when I logged back in all my clothes were on properly.
 

Attachments

  • terrabull_20191219.txt
    206.4 KB · Views: 27
Last edited:

Terrabull

Member
Another bump, another strip session.
This time I changed from apathetic to besneaky mood, which includes an accordion thief song. My default profile uses them too, but I had switched to apathetic to save MP.
 

Attachments

  • terrabull_20200127.txt
    141.1 KB · Views: 19
  • besneaky_mood.png
    besneaky_mood.png
    11.9 KB · Views: 19
Last edited:

fronobulax

Developer
Staff member
This is more just to let you know someone is paying attention.

If you let us know an adventure number near where the striptease occurred that might keep people from me like reading everything and panicking when we see "cast 1 (null)". (That is not a problem since the Bird Calendar is a work in progress)

I note this happens about 369. It looks like you change mood from something to besneaky and nakedness is detected with the first cast from that mood. I wonder if it could be changing the mood, rather than the contents?

No ideas and no solutions but at least someone is paying attention.
 

GT1

New member
This is an old issue, I mean years old. Mafia does it randomly. It happened to me a couple days ago when I ate a jumping horseradish. I don't recall it ever doing so during a set of queued adventures, it always seems to be after an action that is not an adventure. These days I do things from the CLI and that way I don't miss it happening. It is highly annoying to find out I spent 50 adventures at barf with no equipment.The more micro-managing things you do in a day increase the probability it will happen.
I have a couple other accounts that play every day, and since they just log in and run a couple chat macros to get going and set up for RO after done I can not recall it happening in years on them..
 

Terrabull

Member
I'll remember to include the adventure count in the future, no problem.
I noticed it happen w/ the besneaky mood, and I agree, maybe changing to it was the cause. I swap between default and besneaky many many times a day, especially while ascending. So I'm not sure what to make of that.
 

fronobulax

Developer
Staff member
I'll remember to include the adventure count in the future, no problem.
I noticed it happen w/ the besneaky mood, and I agree, maybe changing to it was the cause. I swap between default and besneaky many many times a day, especially while ascending. So I'm not sure what to make of that.

Thanks. I think about this and look at code but I'm getting nowhere.
 

Terrabull

Member
Happened again, this time w/o moods. I noticed it BEFORE I adventured, but I can't stop it once it strips me.
I beat the Goblin King, auto-sold my meat stacks, then changed my equipment to something more reasonable. Then Mafia decided I was TOO reasonable apparently, and said everything was off.
I clicked onto the counsel to get my new quest, clicked on the Friars copse, then went to my campsite for the buff, and that's when I realized I was naked. Happens right after adventure 27. Unfortunately, there isn't much there.
 

Attachments

  • terrabull_20200205.txt
    18.7 KB · Views: 15

Terrabull

Member
It is installed, but was not running anytime today.

Edit: Speaking of Relay Browser stuff. I have Chit running, and that's how I noticed I was naked while mucking around in the GUI. I looked at the left, saw all the boxes were empty, then went to my inventory page and saw my equipment. Then I confirmed mafia thought I was naked and went to adventure to trigger the disrobing.
 
Last edited:

Terrabull

Member
Got stripped again, this time after going to the Boxing Daycare. Again, noticed it in Chit, all my stuff is still equipped right now. Went to Mafia and re-equipped the stuff in there. Adventure 676

Was not running Guide today.

Should I run anything to make the logs more detailed?
 

Attachments

  • terrabull_20200210.txt
    35.7 KB · Views: 16

fronobulax

Developer
Staff member
Not sure what else you could log. Thank you.

My only hypothesis is that it is a threading issue related to the relay browser and/or relay scripts. So not running Chit or Guide might eliminate the problem. But I can also understand that running without those is more of a problem than nakedness.
 

Veracity

Developer
Staff member
Let's try an experiment. Somehow, this is happening:

Save outfit checkpoint
Do NPC purchase
api.php comes back with current equipment
--> it disagrees with our current model of equipment (naked) and we update current model to agree with KoL
Restore outfit checkpoint
--> which is apparently naked, so we remove all equipment.

Now, there are definitely threading issues:

SpecialOutfit.implicitPoints is a static class field
SpecialOutfit.explicitPoints is a static class field
as are
SpecialOutfit.implicitOutfit
SpecialOutfit.markedCheckpoint
EquipmentRequest.shouldSavePreviousOutfit

Studying the code, those last three provide complexity but serve no purpose that I can discern.

The stack of "explicitPoints" is pushed and popped by script commands.
The stack of "implicitPoints" is pushed and popped in numerous places all over KoLmafia to handle restoring equipment when called code - recovery, NPC purchases, whatever - might change gear - reduce MP cost of skills, wear an outfit to visit NPC store or lower purchase cost, and so on.

To be thread safe, we'd need to synchronize all those push/action/pop code blocks.

But what is so puzzling is that your session logs don't show any indication of extra stuff (from other threads) that would push or pop checkpoints - and how would you get an empty checkpoint?

I am going to submit a change that removes all usage of:

SpecialOutfit.implicitOutfit
SpecialOutfit.markedCheckpoint
EquipmentRequest.shouldSavePreviousOutfit

since, as I said, I cannot see how it is doing anything at all useful and it complicates the code.

I'm also considering adding a debugging property which will log creating and restoring checkpoints and specially calling out when the checkpoint is empty. Whatever happened just before creating an empty checkpoint would be something to look at. What would really be necessary to understand this is a DEBUG log, not a session log, but that is super cumbersome for something which happens so rarely - especially if you run Guide.

Revision 19730 simplifies the code by removing apparently unnecessary complexity.
Lets see how KoLmafia runs without that code.
 

Veracity

Developer
Staff member
Revision 19731 prints a stack trace to the DEBUG log if we create an implicit checkpoint with no equipment.
It also prints "Created an empty implicit checkpoint" to the gCLI and session log.
 
Top