Quantcast
Debugging "protected function call" errors - WoWInterface
Thread Tools Display Modes
10-29-16, 03:34 AM   #1
vvv444
A Murloc Raider
Join Date: Oct 2016
Posts: 5
Debugging "protected function call" errors

Hi,

I'm somehow lost... Many times I'm receiving errors like the following one (the log provided by the BugGrabber addon).

1x [ADDON_ACTION_BLOCKED] AddOn 'PetTracker' tried to call the protected function '<unnamed>:Hide()'.
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `Hide'
FrameXML\WorldMapActionButton.lua:58: in function `Clear'
FrameXML\WorldMapActionButton.lua:67: in function `Refresh'
FrameXML\WorldMapActionButton.lua:19: in function `SetMapAreaID'
FrameXML\WorldMapFrame.lua:1230: in function `WorldMapFrame_Update'
FrameXML\WorldMapFrame.lua:2809: in function `WorldMapFrame_UpdateMap'
FrameXML\WorldMapFrame.lua:436: in function <FrameXML\WorldMapFrame.lua:422>
[C]: ?
[C]: in function `SetMapToCurrentZone'
FrameXML\WorldMapFrame.lua:370: in function <FrameXML\WorldMapFrame.lua:349>
[C]: ?
...
FrameXML\UIParent.lua:2327: in function `SetUIPanel'
FrameXML\UIParent.lua:2166: in function `ShowUIPanel'
FrameXML\UIParent.lua:2086: in function <FrameXML\UIParent.lua:2082>
[C]: in function `SetAttribute'
FrameXML\UIParent.lua:2868: in function <FrameXML\UIParent.lua:2856>
[C]: in function `ShowUIPanel'
FrameXML\UIParent.lua:2852: in function `ToggleFrame'
FrameXML\WorldMapFrame.lua:261: in function <FrameXML\WorldMapFrame.lua:233>
[C]: in function `ToggleWorldMap'
[string "TOGGLEWORLDMAP"]:1: in function <[string "TOGGLEWORLDMAP"]:1>

Locals:

It seems that the execution path comes from the Blizzard's code, so why does it blame the PetTracker addon? (It happens with other addons too). In any case, how do I approach debugging such problem?

Best regards,
Brizag


UPDATE: Another example:
1x [ADDON_ACTION_BLOCKED] AddOn 'MultiBars' tried to call the protected function 'OverrideActionBarButton1:Show()'.
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `Show'
FrameXML\ActionButton.lua:330: in function `ActionButton_Update'
FrameXML\ActionButton.lua:665: in function `ActionButton_OnEvent'
FrameXML\ActionButton.lua:174: in function <FrameXML\ActionButton.lua:171>

Locals:

Last edited by vvv444 : 10-29-16 at 03:40 AM.
  Reply With Quote
10-29-16, 02:47 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
  1. Disable all other addons.
  2. Run "/taintlog 2".
  3. Wait until you get the error.
  4. Log out (don't /reload or you'll wipe the log for the new session).
  5. Open the "World of Warcraft/Logs/taint.log" file in Notepad.
  6. Find the line containing a word like "block" or "protect" (I don't remember exactly what it says).
  7. Note the variable it's saying is tainted.
  8. Work you way back up toward the beginning of the log to see where/how that variable was originally tainted.

If it's your addon:
  • Make sure you are not leaking any global variables.
  • Make sure any intentional global variables have unique names.
  • Don't overwrite any methods on secure frames (eg. frame.Hide).
  • Don't overwrite/modify any globals that are read by secure code (eg. RAID_CLASS_COLORS).
  • Use hooksecurefunc instead of "manual" hooks on Blizz functions that might touch anything secure.

The wrong addon can be blamed for any number of reasons, all of which basically boil down to "whoever touched it (or looked at it sideways, or was seen in the general vicinity of it) last gets all the blame".
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
10-30-16, 06:41 AM   #3
vvv444
A Murloc Raider
Join Date: Oct 2016
Posts: 5
Thank you very much! I'll try that.
  Reply With Quote
11-09-16, 06:16 AM   #4
nebula
A Deviate Faerie Dragon
 
nebula's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 16
This is taint from having the map open while getting into combat. There is a secure action button attached to the frame to instantly complete a world quest which causes the taint errors (even if you don't have the class hall upgrade for it). Not much you can do about it, anything that touches the map can be blamed.
  Reply With Quote
11-13-16, 10:23 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by nebula View Post
Not much you can do about it...
I'd imagine reparenting the button (eg. to UIParent) and overwriting any world map functions that refer to it (with versions where those references have been removed) would do the trick.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Debugging "protected function call" errors

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off