AdiBags Immediately Crashes WoW to Desktop on M1/M2 Macs
xaimaway opened this issue · 28 comments
Describe the bug
Adibags is immediately crashing wotlk wow to desktop (MacOS) as the only addon I have enabled.
After more testing: ONLY happens on my druid, level 80
To Reproduce
Steps to reproduce the behavior:
Load WOTLK wow on macOS
Install Adibags wotlk
Login game
Open bags
Crash
Expected behavior
It not to crash
Screenshots
Nothing to screenshot
World of Warcraft Release and Version (Retail 9.2.7, etc)
WOTLK latest version
AdiBags Version
- v1.9.40
Have you tried disabling all your other addons to ensure only this addon causes the issue?
- Yes
- Also tried a full file cleardown and reinstall of wow
Additional context
What's the sequence to reproduce? I don't see the Interface item on the main menu anymore. I do have equipment sets defined. Usually one for my main spec and one for fishing. (I've got a lot of alts.)
I get it, just trying to provide information and see if there is something that can be worked around.
Wondering if it's item or item type specific as it's only happening on one character. I completely removed my entire WTF directory and it still happens on my priest. Some further testing I did:
- Automatically opening my bags (i.e visiting merchant/bank) still crashes
- If I make them not open automatically, then merchants work but bank still causes the crash (probably since merchants aren't scanned and don't have bags to iterate over)
- I tried disabling more features (item sets, stacking options, plugins, etc), still crashes.
Next thing I'm going to try is to clear out my bank and put everything my character is carrying/wearing in the bank and see if I can open my bags. Just to see if it's bag/item related.
At least if we can find what is triggering it, there might be a work around to avoid it.
For other having this issue, what class are you? My char having the issue is a priest in a few kara pieces, some pvp gear and some northrend blues/greens.
No luck.
- Bags are empty (in bank)
- Bags are put in bank
- Key bag is empty (in bank)
- Character inventory is empty (in bank)
Totally naked and nothing but the built in backpack. Still crashing. Weird.
I should note that even having my bags not automatically open, it crashes on opening the bank so it doesn't appear to be just character bags, but character bank as well.
Sorry for the spam, but if you want do any diagnosing of it I'm happy to run a test/debug build for you and send you whatever you need.
There's no realistic way to debug a hard crash like this remotely -- I want to stress this again, concerned users should petition Blizzard to fix this, as this is a bug in Blizzard's code, and not in AdiBags.
I found the problem. Seems like a weird corrupted Equipment Manager set. I was able to localize the crash to this call in core/DefaultFilters.lua, line 111
local locations = GetItemLocations(equipmentSetID)
Here is what I did to fix it:
- Interface -> Features, then enable the Equipment Manager
- In the character pane, I clicked the gear manager icon
- Deleted the sets. When I went in, there were two and when I deleted the first I got a ? icon for the other. I reloaded the UI and then deleted the second one first, then the first one.
- To be safe that everything saved, I logged out to char select.
- Came back in and bags open fine now.
Looks like a potential corrupted equipment manager set. For what it's worth, I never enabled that feature (it was disabled) so not sure what created a set in there for me, unless WoW does it by default.
TL;DR: Activate the WoW equipment manager and remove your sets.
Quick update. I think Ask Mr. Robot creates WoW equipment manager sets if you import gear sets from it, even if it's disabled in the UI. The corrupt set might be from that, but I'm only one data point so cannot confirm. Other chars are fine with their gear sets from AMR, but who knows.
Thanks for the investigation. This isn't really a corruption issue at heart, as the call should not crash even in a corrupted state.
The WoW game client runs the Lua interpreter in a sandbox, which translates the exposed surface area of Lua into calls in the C++ game engine directly. Under no circumstance should an addon be able to crash the WoW client under normal operation that isn't intentional. That is to say, no amount of invalid inputs to the exposed API should ever crash the WoW client from the Lua side.
However, because this crash only happens on Arm instruction sets, it's almost certainly a compiler bug, a Lua VM specific bug that isn't cross-platform safe, or a WoW client bug that isn't cross-platform safe. I suspect some bounds aren't being checked, but I can't be sure. Further, because it's impossible to tell if a user is running on Arm or x86, there's no realistic way to patch this out or otherwise inspect the state of the stack such that we know what would cause this. We could potentially disable this feature entirely for Mac players, but that would punish non-Arm chipset players.
Equipment sets can only save what you have currently equipped, and can not be injected into by an outside call, so it's entirely possible that some piece of equipment specifically is causing the issue, or otherwise there's a bug in which equipment which no longer exists will crash the client when the equipment set is accessed, and somehow triggers a broken path/case in the compiled Arm instructions.
Please raise this with Blizzard, and if possible try to come up with a case that can replicate it by using the equipment set API.
Thanks for your investigation again!
Totally, agree. Been in software development for 35 years and was not implying that the corruption of the gear set is the root cause of the issue, there is obviously a bug somewhere, either in their code or, like you mentioned, the arm specific compiler outputs. But, in this specific case, a corrupted or missing gear set IS a cause for this crash via exploiting that bug in their code.
I was actually able get my priest back into that case. I used Ask Mr. Robot to import two gear sets, when I click the button in that addon to equip the sets, it creates a gear set in the wow equipment manage. To your point, it probably equips the gear and then "saves" the gear set in the equipment manager. I equipped both, then went into the equipment manager and deleted the first gear set in the list. Logged out, logged back in, opened bags and crashed to desktop.
I tried to recreate it by doing gear sets manually. Equipped my healing set with item rack, saved it, equipped my dps set, saved it, then removed the first set. No crash to desktop. Order didn't matter. Logging out and back in between or after didn't matter. Something with how an addon (AMR in this case) was saving the gear sets messed it up when you delete the first set.
There is definitely also a bug in the WoW UI code as well as even if you create two gears sets manually and the delete the first one, the one left is a "?" and is not usable or really visible until you create a new one. Then you can delete them if you delete the second one, then the first one.
And as a software developer for 35 years, as clean and fault tolerant as they want their code or as isolated as they want tehir sandbox to be they will be wrong. Always. Full stop. There are always edge case that are missing. There are always exploits to be found. Always.
Be be clear, I was never implying that this was a bug in your code. Not at all. I was simply looking for a work-around for people so, if they were in this state, they continue to use this amazing addon. That work around could have been defensive programming IF it was detectable which, as you mentioned correctly, it is not. In this case the work around was to remove the offending gearset(s) and recreate them.
Sorry, I didn't mean to offend you or your skills in anyway -- I apologize if I my words offended.
It's super, super interesting that you have a reproduction case. Check out this page and search for "Equipment Manager". You'll see a list of all the functions that you can call that interact with the Equipment Manager. I wonder if it's not the equipment set itself, but the name or the icon of the equipment set that is causing the crash. Specifically, I'm referring to this function that when saved with a specific argument, it causes a crash when retrieved later on via GetItemLocations. It could also be a call to SaveEquipmentSet with broken parameters.
If you feel like debugging, you can short-circuit your local copy of AdiBags by creating a new Lua file and modifying the TOC so it loads first, and see if you can create a broken equipment set with bad parameters.
Oh, I wasn't offended. Takes a lot more than that for me to be offended. I thought of it as more of a "profession discussion" more than anything.
I'll look into those. I'm also going to look into the Ask Mr Robot addon and see if I can see what they are doing and see if they have a bug there that I can find and report to them.
It's funny, the gear sets it creates are fine as long as you don't delete the first one. If you leave them alone, it's all good.
Wasn't there a bug back in Vanilla (more than a decade ago) that caused the game to crash to desktop if you clicked on item links for items not in your cache? The links would only work if you'd seen the actual item before, to populate that cache. Probably right when item links in chat first became a thing. So maybe someone at Blizzard recreated the same bug in the Arm port.
I don't think Arm is a port, so much as it is a cross-compile, so this is unlikely. CTD's aren't uncommon, fwiw -- I found one just last month when I was fiddling with animations in a certain way that crashed 100% of the time.
Either way, once we narrow it down, we'll send it over to Blizzard.
This is a bug that is known with M1 Mac's. Unfortunately, I don't have an M1 to test, but it only happens on M1 and not Intel. Addons generally don't have the ability to hard crash to desktop, and this is likely an issue in Blizzard's ARM specific code/compiler.
I'll keep this bug open to track it -- it's possible that I may own an M1/M2 Mac at some point in the future and attempt a work around.
I'm having this same issue but, oddly, for me it's only affecting one character. I've even removed (moved away) that characters WTF directory and it still happens. But only for that character.
When I have more time I'm going to check interaction with other addons like the datastore ones and altoholic and I'll also see if I clear out or move away the account level SaveVariables if that helps.
Yeah, there's no real reason to it, in general, and there's nothing we can do about a hard crash like this as authors. This problem falls squarely on Blizzard and their ARM implementation. Unfortunately, addons are not supported by Blizzard officially, so until they get around to fixing this bug, the priority will likely be quite low.
I can confirm it is ARM-specific.
Up until very recently I was going between playing on a Mac Studio with M1 Max and a Mac mini 2018 with 3.2GHz 6-core Intel Core i7. I reported this issue in #708 and at the time it couldn't be reproduced, and I certainly don't have the Lua knowledge to isolate the issue. But a defining characteristic was that it happened while playing on the Studio and not the mini, with the exact same character and Interface and WTF folders synced between the computers.
I now have two Studios and it has been crashing on both for that specific character when AdiBags is enabled.
Earlier tonight I re-enabled AdiBags just to see if anything had changed, and upon the bag being opened it immediately crashed. I had Equipment Manager enabled (since when exactly, I'm not sure) and I followed the steps above and deleted all equipment sets. I then re-enabled AdiBags and it worked perfectly. I tried adding a new gear set in Equipment Manager. As soon as I did, then opened my bags, it crashed again. I can go back and forth like this--so long as I have at least one gear set in Equipment Manager, it will crash when I open my bags. No reloads/logouts required.
(The characters where AdiBags never stopped working did not have Equipment Manager enabled.)
something must have changed since v1.9.36. this version is working fine on Apple Silicon
something must have changed since v1.9.36. this version is working fine on Apple Silicon
I can‘t confirm. Maybe you deleted your Equipment Manager Profiles. As I use Ask Mr. Robot I always have such profiles and so Adibags crashes WoW like described here. The same applies to Sorted - which obviously calls the same function…
There's nothing we can really do about client crashes -- this is entirely a Blizzard problem, likely in their compiler. We could potentially work out hacks, but we would break the addon for certain players.
I also don't own an M1/M2, so I have no real way to test or debug this and be 100% positive as to what fixes to implement, though, I have been eyeing one as of late :)
This happens for my warlock with a Soul Pouch 20-slot bar equipped. Apple M1 chip. Equip Soul Pouch, open bags with AdiBags installed, BOOM! instant client crash.
since we know that for some of user the issue is with equipment manager, can you add settings to disable grouping item by sets? then there will be no issues with calling
local locations = GetItemLocations(equipmentSetID)
Was there a fix for this at all? Crash instantly on my M1 Macbook when using adibags.
Nice catch. The next step would be to extract all the Blizzard API calls from the setFilter object created in DefaultFilters.lua and put them in a small test addon to try each call one at a time and see if any crash the game. Then create an issue at https://github.com/Stanzilla/WoWUIBugs.
I was able to prevent AdiBags from crashing the game on my 2021 14" MacBook Pro by disabling the Gear manager item sets filter in the AdiBags configuration. Re-enabling it immediately crashes the game when opening the main bag frame.
Additional thing to note is the game only crashes with this enabled when the character has sets in the game's Equipment Manager. It does not crash on a level 1 character without equipment sets.
This option can be found by typing /adibags
, then clicking Filters on the left. Under to Gear manager item sets, uncheck the checkbox.
It crashes for me consistently when I have equipment set filtering enabled and have a set that have ALL slots filled. If I let i.e the shirt slot be empty, it (mostly, had to remake a couple sets) doesn't crash anymore.
edit: having at least 1 slot ignored works too. I think what I'll do is have shirt or tabard ignored on all sets.
edit2: logging in the next day and the same sets that were working the night before are now crashing again. Having at least 1 ignored only seems to work temporarily, but when you reopen the client it will crash again. So for now it looks like you need to have at least 1 slot completely empty (not ignored).