WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   MoP Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=162)
-   -   Addon blocks Glyph Ui (https://www.wowinterface.com/forums/showthread.php?t=43809)

Miiru 07-30-12 07:00 AM

Addon blocks Glyph Ui
 
So today i wanted to remove some more frames and continue to work on my texture pack and i came along the Glyph Ui, tried to equip a glyph and noticed that i get the usual action blocked message.

Curiously i wasn't even changing anything near the glyph UI so i looked over and over and it came down to this little code:

Code:

local frame = CreateFrame("FRAME");                                                                                                                                                                       
                frame:RegisterEvent("ADDON_LOADED")
                function frame:OnEvent(event, arg1)
               
                        if event == "ADDON_LOADED" and arg1 == "Blizzard_TalentUI" then
                       
                        _,c= PlayerTalentFrameSpecialization:GetRegions();               
                        c:Hide()               
                        c1,_,_,_,_,_,_,_,_,_,_,c4 = PlayerTalentFrameSpecializationSpellScrollFrameScrollChild:GetRegions();
                        c1:SetTexture(0,0,0,0)
                        c4:SetTexture(0.129,0.113,0.129,1)
       
            end
          end
           
  frame:SetScript("OnEvent", frame.OnEvent);

If i delte those few lines, everything runs fine. I tested if those frames are protected by i always returned nil (unless i did it wrong :D). Another interesting thing is that if i open up the Glyph Window and proceed to first remove a glyph and the equip one, i don't get an error at at all.

Any ideas on how to get rid of it? :/

edit: digged a bit deeper and it seems to be child c and child c4 causing the error.

Dridzt 07-30-12 12:55 PM

Are those variables local in some part of your code that's not visible in the snippet or are they global like that?

Mainly talking about the throwaway variable '_'

Since that's a throwaway variable by programmer convention and not an automatically discarded variable, that's where I'd start.

There's a possibility Blizzard programmers have overlooked localizing some instance of _ in their own code so there's no telling what code paths are tainted.

Start by putting
Code:

local _,c,c1,c4
at the top of your file.

Barjack 07-30-12 01:32 PM

Yeah, I've definitely seen taintLog errors since 5.0 that mention a tainted global _ when getting a Glyph UI action blocked error. Making sure all your _ variables are local seems to have become even more necessary now.

Xrystal 07-30-12 01:39 PM

I've seen the same problem so far. First it reports nUI as being the addon factor and when I turn that off Titan Panel. But finding common ground with those 2 addons may be a bit difficult rofl.

Phanx 07-30-12 06:33 PM

I've found a lot of leaked globals in Blizzard's beta UI code, including underscores. I haven't looked at the Glyph UI code, but it would not surprise me in the least if Blizzard forgot their "local" declarations there too.

Xrystal 07-30-12 06:49 PM

the only block of code I can see that may be causing the problem is ..

CastGlyph command perhaps?

Lua Code:
  1. 517.function GlyphFrameSpell_OnClick (self, button)
  2.  518.  if ( IsModifiedClick("CHATLINK") ) then
  3.  519.    local _, _, _, _, _, link = GetGlyphInfo(self.glyphIndex);
  4.  520.    if ( link ) then
  5.  521.      ChatEdit_InsertLink(link);
  6.  522.    end
  7.  523.  else
  8.  524.    if self.disabledBG:IsShown() then
  9.  525.      return;
  10.  526.    end
  11.  527.    CastGlyph(self.glyphIndex);
  12.  528.    StaticPopup_Hide("CONFIRM_GLYPH_PLACEMENT");
  13.  529.  end
  14.  530.end

Phanx 07-30-12 07:00 PM

Blizzard's taint reporting system is 99.99999% useless. Chances are, some code is tainting some other code that your addon interacts with, and that code interacts with some other code that interacts with some other code that's tainting something else, and that code interacts with some other code that interacts with some code in the Glyph UI.

Miiru 07-31-12 02:04 AM

Wll thank you all and yes it's definately an underscore probleme right there, which caused the error.

I got around it by using the select method and it now works fine.

Xrystal 07-31-12 03:21 AM

hmmm, time to do a large search through nUI ... rofl

Edit: Oh wow, even local _ usage is causing it. Made 7 changes to nUI where Scott used _ for variables he didn't need to a dummy emptyVar variable and no more error .... nUI Lite fixed .. now for nUI Plus rofl. Then to go through all my addons, just in case I did use it somewhere.

Farmbuyer 07-31-12 04:46 PM

Quote:

Originally Posted by Xrystal (Post 259055)
hmmm, time to do a large search through nUI ... rofl

Edit: Oh wow, even local _ usage is causing it. Made 7 changes to nUI where Scott used _ for variables he didn't need to a dummy emptyVar variable and no more error .... nUI Lite fixed .. now for nUI Plus rofl. Then to go through all my addons, just in case I did use it somewhere.

Fire up FindGlobals, it's designed for exactly this kind of thing.

Xrystal 07-31-12 05:36 PM

The problem is none of them were globals... Every instance of the _ values were local to the function it was in. The moment I replaced them .. no more addon block message.

Betaldor 08-28-12 09:19 PM

I'm seeing this in my (as of yet unpublished addon) as well. Thank you for the problem description, I was about to lose my mind.

I found one non-local "_" variable in my code and as soon as I removed it, the Glyph taint went away.

Aelorean 08-30-12 04:29 AM

This is driving me nuts. I'm getting the same bug; however, even after I went through every inch of the code searching just for '_' ...I can't find any that should still be causing a problem. I even through all of the libs.

Can anyone suggest anything else for debugging this? Are there any tools for seeing what exactly is causing the error? The LUA error is worthless...

Code:

8x [ADDON_ACTION_FORBIDDEN] AddOn "Squire2" tried to call the protected function "CastGlyph()".
!BugGrabber-r188\BugGrabber.lua:587: in function <!BugGrabber\BugGrabber.lua:587>
<in C code>
Blizzard_GlyphUI\Blizzard_GlyphUI-1.0.lua:527: in function "GlyphFrameSpell_OnClick"
<string>:"*:OnClick":1: in function <string>:"*:OnClick":1

Locals:
nil

I went through every single lua file and put "local _" at the top (even ace library files) ...and nothing is helping.

Aelorean 08-30-12 05:34 AM

I tried that script on the files, but noticed nothing out of the ordinary. What should I be looking for in the output? There might be one or two globals there that could be made local; however, there's definitely none of the "usual suspects" listed (i.e., "_", i, k, v, etc) and I see nothing that stands out that could be causing a problem.

It seems strange that this ONLY occurs during this one thing (clicking on a glyph in the GlyphUI window) ...is there really no way to know what it is that's causing the problem?

Dridzt 08-30-12 05:49 AM

Quote:

Originally Posted by Aelorean (Post 261127)
I tried that script on the files, but noticed nothing out of the ordinary. What should I be looking for in the output? There might be one or two globals there that could be made local; however, there's definitely none of the "usual suspects" listed (i.e., "_", i, k, v, etc) and I see nothing that stands out that could be causing a problem.

It seems strange that this ONLY occurs during this one thing (clicking on a glyph in the GlyphUI window) ...is there really no way to know what it is that's causing the problem?

Can't find your code to look at :)

Aelorean 08-30-12 06:29 AM

1 Attachment(s)
Here is a zip file with the addon. There are really only 3 files other than the libs: "Config.lua", "Squire2.lua" and "Localization.lua".

I have also included text files with the output of findglobals: Config_Globals.txt, Squire2_Globals.txt, and Localization_Globals.txt.

Please note that I didn't write this addon :) All I did was update it for 5.0.0.4. It's frustrating because everything seems updated and ready to go except for this one stupid error.

Also, I did at one point go through and rename all of the local variables that were "_" to something else; however, that did not seem to change anything, so I reverted back.

MagicKira 08-30-12 06:38 AM

I don't know if this helps any or is already known but all of my Broker_*insert function here* addons seem to be triggering the error. The rest of the normal data broker addons are fine for some reason, but the ones like Broker_Wallet, Broker_Calendar, etc seem to REALLY not like the glyph window.

Correction: I just went through it again after doing some rechecks and only Broker_CPU and Broker_Calendar are triggering this now. The rest aren't. I don't know why not now but *shrugs* I don't code, I only play squishy characters.

Morsker 08-30-12 06:44 AM

Quote:

Originally Posted by Aelorean (Post 261141)
Here is a zip file with the addon. There are really only 3 files other than the libs: "Config.lua", "Squire2.lua" and "Localization.lua".

The pre-hooking UIErrorsFrame_OnEvent is suspicious. The right implementation is to replace UIErrorsFrame's OnEvent handler, not to prehook the function. There's a little mod called pError that's an example of the right way to do it. Or if all the mod is trying to do is suppress error messages, you can unregister and reregister the event:

UIErrorsFrame:UnregisterEvent("UI_ERROR_MESSAGE")
-- whatever code might generate errors
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")

Also Config.lua is setting something called PanelButton_OnHide globally, although it appears completely unused; I don't know why it's there at all.

Aelorean 08-30-12 06:49 AM

Thanks ...I'll fix those right away (it's code from the original author.)

Dridzt 08-31-12 05:43 AM

MoP beta build 16030 change
Code:

local specialization = GetSpecialization(_, _, PlayerTalentFrame.talentGroup);
to
Code:

local specialization = GetSpecialization(false, false, PlayerTalentFrame.talentGroup);
Maybe they've finally fixed all those weird taint problems involving the throwaway variables they're leaking :D


All times are GMT -6. The time now is 08:25 PM.

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