WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   strange error (https://www.wowinterface.com/forums/showthread.php?t=57379)

gmarco 08-23-19 01:24 AM

strange error
 
Hi all,

there is something I really don't understand well.

I got this error, and I have a gmTweaks addon, but I don't call PetFrame:Hide() function anywhere.

Lua Code:
  1. 2x [ADDON_ACTION_BLOCKED] AddOn 'gmTweaks' tried to call the protected function 'PetFrame:Hide()'.
  2. !BugGrabber\BugGrabber.lua:519: in function <!BugGrabber\BugGrabber.lua:519>
  3. [C]: in function `Hide'
  4. FrameXML\PetFrame.lua:81: in function `PetFrame_Update'
  5. FrameXML\PlayerFrame.lua:368: in function <FrameXML\PlayerFrame.lua:366>
  6. [C]: in function `PlayerFrame_SequenceFinished'
  7. FrameXML\PlayerFrame.lua:350: in function `PlayerFrame_UpdateArt'
  8. FrameXML\PlayerFrame.lua:274: in function `OnEvent'
  9. FrameXML\UnitFrame.lua:933: in function <FrameXML\UnitFrame.lua:931>
  10.  
  11. Locals:
  12. InCombatSkipped


The gmTweaks code can be found in gmUI or here:

https://is.gd/e3c4JK


Thanks all.

Rilgamon 08-23-19 02:17 AM

Some days ago someone mentioned Globe in another thread.
That tool is really extremly cool to check for problems.

https://www.townlong-yak.com/globe/

There are some potential problems in your code.

A global use of unitplate for example.

While options is local you create a global frame by naming it options. Such a common name is really dangerous I think.
Lua Code:
  1. local options = CreateFrame("Frame", "options", InterfaceOptionsFramePanelContainer)
Another code that might be a problem ... the first button1 is local but not at the time you use it as name.
Lua Code:
  1. local button1 = CreateFrame("button", button1, options, "UIPanelButtonTemplate")

gmarco 08-23-19 02:56 AM

Hi Rilgamon.

I have correct the iussues you pointed out in this way:

Lua Code:
  1. local ADDON = ...
  2.  
  3. -- [ ... ]
  4.  
  5. local options = CreateFrame("Frame", ADDON .. "options", InterfaceOptionsFramePanelContainer)
  6.  
  7. -- [ ... ]
  8.  
  9. local button1 = CreateFrame("button", ADDON .. "button1", options, "UIPanelButtonTemplate")
  10.  
  11. -- [ ... ]

It should be ok now even if I don't think they can solve the iussue in the first post.
Btw thanks so much for your reply. It is really appreciated.

Rilgamon 08-23-19 03:05 AM

The problem with blocked addons is that it blames the current running addon.
Not the one that tainted the function.

Btw I mentioned only button1 but button2 has the same problem ;)

When you really want to find out what is causing the problem you can use the taintlog
https://wow.gamepedia.com/CVar_taintLog
But be prepared for quite a bit of data ;)

gmarco 08-23-19 07:31 AM

Hi again,

when I fix button1 I fixed also button2 and checked if there are similar situations :)

I really don't know about taintlog. I'll try to debug with it asap.

Thanks again Rilgamon.
Your tips are precious.

myrroddin 08-23-19 09:22 AM

As Rilgamon mentioned, the taintlog blames the currently running addon, which is almost never accurate. The example below is extremely rough, and is intended to be as simple as possible to get the point across.
  1. Game UI doing its thing using a global frame, variable, whatever
  2. Addon1 taints the UI path because all addons cause taint they aren't secure like Blizzard's UI code
  3. Addon1 does something with the global mentioned in #1 that messes with the Blizzard UI but doesn't break it
  4. Taintlog notes the bad behaviour and begins tracking the cause, but it's too late Addon1 is finished doing bad things
  5. Addon2 runs code, any code, even unrelated to the global and because addons are tainted by default, the taintlog throws a fit
  6. You get the error message [ADDON_ACTION_BLOCKED] blaming Addon2 because that was the last code ran
Keep in mind that Lua is a single thread language. That means Lua processes one command and then a second, then a third from a queue. It is not multi-threaded and cannot process two or more commands at the same time, which is another factor why the second addon gets the blame, even for something it had nothing to do with.

What you can do: turn on deeper taintlog tracking using /console taintLog setting where setting is a number between 0-2. The downside is that doing so will drastically slow down the game and drop frames while the game crunches through all that data.

https://wow.gamepedia.com/CVar_taintLog


All times are GMT -6. The time now is 12:05 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI