WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Need help making sense of an error dump (https://www.wowinterface.com/forums/showthread.php?t=56471)

MuffinManKen 07-29-18 01:26 PM

Need help making sense of an error dump
 
I got the following error sent to me and I'm having trouble making any sense of it. I do not call MainMenuBar:SetPoint, I don't use AceEvent, and don't do anything with the TalkingHead API. I'm a little baffled and not sure how to do anything useful with this report. Any advice would be welcome.


Message: ADDON_ACTION_BLOCKED: MuffinFactionizer tried to call the protected function 'MainMenuBar:SetPoint()'.
Time: Sat Jul 28 20:09:16 2018
Count: 4
Stack: ADDON_ACTION_BLOCKED: MuffinFactionizer tried to call the protected function 'MainMenuBar:SetPoint()'.
[C]: ?
[string "safecall Dispatcher[3]"]:13: in function `?'
...ibraries\CallbackHandler-1.0\CallbackHandler-1.0.lua:90: in function `Fire'
...AddOns\ElvUI\Libraries\AceEvent-3.0\AceEvent-3.0.lua:120: in function <...AddOns\ElvUI\Libraries\AceEvent-3.0\AceEvent-3.0.lua:119>
[C]: in function `SetPoint'
Interface\FrameXML\UIParent.lua:2943: in function `UIParentManageFramePositions'
Interface\FrameXML\UIParent.lua:2326: in function <Interface\FrameXML\UIParent.lua:2313>
[C]: in function `SetAttribute'
Interface\FrameXML\UIParent.lua:3115: in function <Interface\FrameXML\UIParent.lua:3113>
[C]: in function `UIParent_ManageFramePositions'
...ns\Blizzard_TalkingHeadUI\Blizzard_TalkingHeadUI.lua:16: in function <...ns\Blizzard_TalkingHeadUI\Blizzard_TalkingHeadUI.lua:15>
[C]: ?
[C]: in function `Show'
...ns\Blizzard_TalkingHeadUI\Blizzard_TalkingHeadUI.lua:155: in function `TalkingHeadFrame_PlayCurrent'
...ns\Blizzard_TalkingHeadUI\Blizzard_TalkingHeadUI.lua:25: in function <...ns\Blizzard_TalkingHeadUI\Blizzard_TalkingHeadUI.lua:23>

Locals: <none>

briskman3000 07-29-18 02:28 PM

Do you have ElvUI installed? Because it looks like ElvUI is contributing to the error.

AcidWeb 07-29-18 04:18 PM

This is taint error.

They are quite elusive to debug. ElvUI is not a culprit and most probably MuffinFactionizer neither.
Only thing we really know from this stack is that something is tainted execution path. And that path is trying to execute MainMenuBar:SetPoint().

Disable all addons other than MuffinFactionizer. And try to replicate this error.

MunkDev 07-29-18 08:32 PM

The key here is UIParentManageFramePositions, not ElvUI, nor MainMenuBar. Your addon is likely doing something that taints the UIParent handler that moves default UI frames around in response to something changing in the UI. The taint is probably correctly attributed to your addon.

A common cause is replacing functions on default UI frames, instead of using hooksecurefunc.

MuffinManKen 07-30-18 01:24 PM

I don't use ElvUI; this is a report from a user and getting them to try things like "does it happen with ElvUI disabled?" is challenging at best.

MuffinFactionizer does replace a number of functions related to the Reputation dialog so maybe I need to look into hooksecurefunc. I didn't write the original version, I just forked it after it had been abandoned and I'm still digging into everything does.

MuffinManKen 07-30-18 01:32 PM

The comment about hooksecurefunc got me wondering if this is even the right direction to go in.

MuffinFactionizer (among other things) allows sorting of your Factions list in the standard Reputation dialog. To do this it creates its own "ReputationFrame_Update".

What are the current "best practices" for replacing significant functionality in a default UI frame? The current approach of just replacing some functions feels fragile.

MunkDev 07-31-18 03:16 AM

If you're actually replacing the global ReputationFrame_Update, then it stands to reason this is the source of your taint. Your tainted function would be called in the execution path when the reputation frame is shown, then transferring that taint to UIParent's position handler.

The best you can do to ensure there are no problems with taint is to either replace the frame altogether, or use hooksecurefunc to apply your changes after the original function call.

This is how the taint would spread (secure/tainted):
Quote:

ToggleCharacter("ReputationFrame", true)
-> CharacterFrame_ShowSubFrame("ReputationFrame")
--> _G["ReputationFrame"]:Show()
---> ReputationFrame_OnShow(self)
----> ReputationFrame_Update(true)
-> ShowUIPanel(CharacterFrame)
--> FramePositionDelegate_OnAttributeChanged(self, "panel-show")
---> FramePositionDelegate:ShowUIPanel(CharacterFrame, false)
----> FramePositionDelegate:SetUIPanel(...)
At this point, FramePositionDelegate taints itself by storing CharacterFrame as a key in its own table. Thus, next time FramePositionDelegate:UIParentManageFramePositions() is called in combat, the taint and the source of the taint is finally revealed.

Kanegasi 07-31-18 05:01 AM

Quote:

Originally Posted by MuffinManKen (Post 329197)
The comment about hooksecurefunc got me wondering if this is even the right direction to go in.

MuffinFactionizer (among other things) allows sorting of your Factions list in the standard Reputation dialog. To do this it creates its own "ReputationFrame_Update".

What are the current "best practices" for replacing significant functionality in a default UI frame? The current approach of just replacing some functions feels fragile.

hooksecurefunc will work just fine here. ReputationFrame_Update will happen, then your own hooked function will change what it needs to each time. I hook that same function for my ExaltedPlus addon to alter the paragon faction bars. It’s also very simple to switch to immediately.

Code:

function YourRepFrameUpdate()
    -- your code
end

turns into

Code:

hooksecurefunc("ReputationFrame_Update",function()
    -- your code untouched
end)

Nothing should be different. Then, you can strip all the duplicate stuff your function does that ReputationFrame_Update already does that you don’t need to change, so your hook is streamlined to only what you want to change.

MuffinManKen 07-31-18 09:20 AM

Thanks all! I will dig into hooksecurefunc and rework my code to run after the existing global function.


All times are GMT -6. The time now is 01:56 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI