UIDropDownMenu can taint CompactRaidFrame1

90 Human Priest
11570
Creating a dropdown menu using UIDropDownMenu_Addbutton() causes the CompactRaidFrame1 frame to be tainted when it gets created, if your dropdown menu contains 8 or more buttons prior to CompactRaidFrame1 being created.

Edit: When first logging into a character, CompactRaidFrame1 appears to be created as an untainted secure frame. However, if you /reload the UI, CompactRaidFrame1 will be tainted when it is created.

hooksecurefunc("CreateFrame", function (frameType, frameName)
-- This detects when CompactRaidFrame1 gets created
-- and then displays the secure status of the frame.
if (frameName == "CompactRaidFrame1") then
print(frameName, "has just been created.");
local secure, addon = issecurevariable(_G, frameName);
if (not secure) then
print(frameName, "is tainted by", addon);
else
print(frameName, "is secure.");
end
end
end);

local function MyTest_DropDown_Initialize(self, level)
-- Adding 7 buttons does not cause CompactRaidFrame1 to
-- become tainted when it gets created.
-- Adding 8 buttons does cause CompactRaidFrame1 to
-- become tainted when it gets created.
-- UIDropDownMenu.lua defines UIDROPDOWNMENU_MINBUTTONS as 8.
for i = 1, UIDROPDOWNMENU_MINBUTTONS do
local info = UIDropDownMenu_CreateInfo();
info.text = "item" .. i;
info.value = "item" .. i;
info.func = function() end;
print("Adding button", i, "to the dropdown menu.");
UIDropDownMenu_AddButton(info);
end
end

local myframe = CreateFrame("Frame", "MyTest_Frame");
local dropdown = CreateFrame("Frame", "MyTest_DropDown", myframe, "UIDropDownMenuTemplate");
UIDropDownMenu_Initialize(dropdown, MyTest_DropDown_Initialize, "MENU");
Edited by Dargen on 9/12/2012 11:01 PM PDT
Reply Quote
100 Night Elf Druid
12665
Thanks for the work involved in tracking this down. Perhaps this is why my addon seems to have an issue with:

Message: [ADDON_ACTION_BLOCKED] AddOn "Wholly" tried to call the protected function "CompactRaidFrame1:Show()".

even though my addon does nothing with CompactRaidFrame1.

Do you know a way to make sure CompactRaidFrame1 is created prior to the drop down?
Reply Quote
90 Human Priest
11570
I currently don't know of a way to ensure the frame is created before the dropdown.

I added a print(debugstack()) to the function that detects when the frame is created to see when and where it does get created. For me, the sequence of calls that lead to the creation of the frame started on line 28 in Blizzard_CompactUnitFrameProfiles.lua which is when it called CompactUnitFrameProfiles_ValidateProfilesLoaded after detecting the "VARIABLES_LOADED" event.

Note that not all characters may see CompactRaidFrame1 get tainted when logging in or reloading the UI. It does do it on my level 85 character, but when I logged in a level 40 character I did not see CompactRaidFrame1 get any taint since it did not create the frame at that time (perhaps because the level 40 character has never been in a raid).

If you don't have too many dropdown menus, one work around is to not call UIDropDownMenu_Initialize during the dropdown object's OnLoad script. If you can wait until just before you need to use the dropdown menu, then you can increase the chance that CompactRaidFrame1 will have been created by then.
Edited by Dargen on 8/30/2012 12:19 PM PDT
Reply Quote
100 Tauren Druid
13175
I'm getting a load of CompactUnitFrame.lua on 4 toons all 85. What do you mean by drop down menus? These are a few examples of what I'm getting ALL the time, with one addon on or all on. I've been in contact with all these developers and they have no idea. at this point I have tosay it's blizzard not the addons. Is there a fix?

["message"] = "[ADDON_ACTION_BLOCKED] AddOn \"TBag\" tried to call the protected function \"CompactPartyFrameMember5:Show()\".",
["time"] = "2012/09/12 20:09:58",
["stack"] = "!BugGrabber-r188\\BugGrabber.lua:587: in function <!BugGrabber\\BugGrabber.lua:587>\n<in C code>\nFrameXML\\CompactUnitFrame.lua:276: in function \"CompactUnitFrame_UpdateVisible\"\nFrameXML\\CompactUnitFrame.lua:234: in function \"CompactUnitFrame_UpdateAll\"\nFrameXML\\CompactUnitFrame.lua:46: in function <FrameXML\\CompactUnitFrame.lua:43>",
["session"] = 52,
["counter"] = 1,
}, -- [33]
{
["message"] = "[ADDON_ACTION_BLOCKED] AddOn \"ButtonForge\" tried to call the protected function \"ActionButton3:Show()\".",
["time"] = "2012/09/12 20:41:17",
["stack"] = "!BugGrabber-r188\\BugGrabber.lua:587: in function <!BugGrabber\\BugGrabber.lua:587>\n<in C code>\nFrameXML\\ActionButton.lua:268: in function \"ActionButton_Update\"\nFrameXML\\ActionButton.lua:249: in function \"ActionButton_UpdateAction\"\nFrameXML\\ActionBarController.lua:136: in function \"ActionBarController_ResetToDefault\"\nFrameXML\\ActionBarController.lua:124: in function \"ActionBarController_UpdateAll\"\nFrameXML\\ActionBarController.lua:53: in function <FrameXML\\ActionBarController.lua:42>",
["session"] = 53,
["counter"] = 1,
}, -- [34]
{
["message"] = "[ADDON_ACTION_BLOCKED] AddOn \"Decursive\" tried to call the protected function \"PartyMemberFrame1:Hide()\".",
["time"] = "2012/09/12 20:09:58",
["stack"] = "!BugGrabber-r188\\BugGrabber.lua:587: in function <!BugGrabber\\BugGrabber.lua:587>\n<in C code>\nFrameXML\\PartyMemberFrame.lua:116: in function \"PartyMemberFrame_UpdateMember\"\nFrameXML\\PartyMemberFrame.lua:345: in function \"PartyMemberFrame_OnEvent\"\n<string>:\"*:OnEvent\":1: in function \"OnEvent\"\nFrameXML\\UnitFrame.lua:489: in function <FrameXML\\UnitFrame.lua:487>",
["session"] = 52,
["counter"] = 2,
}, -- [3]
{
Reply Quote
90 Human Priest
11570
What do you mean by drop down menus?...Is there a fix?


Drop down menus are just menus that appear to "drop down" from some spot on the screen that you click on. For example, if you open the full screen world map, a drop down menu is displayed when you click on the "Zone map", "Continent", or "Zone" arrow button. Blizzard creates those menus by calling functions such as UIDropDownMenu_Initialize and UIDropDownMenu_AddButton.

Addons can also create drop down menus by making use of the same UIDropDownMenu_Initialize and UIDropDownMenu_AddButton functions that Blizzard uses. When an addon uses those functions, certain things that are also used by Blizzard become tainted (not secure). Then when Blizzard later creates a secure frame (such as a compact raid frame), that frame may also become tainted. When the game tries to do certain things to a secure frame that has become tainted (such as showing, hiding, or moving it during combat) you will end up with those types of error messages.

An addon could stop using Blizzard's drop down menu functions, but then the addon would have to either not create any menus or it would have to use a non-Blizzard menu system.

An addon may be able to avoid indirectly tainting frames like CompactRaidFrame1, if the addon does not initialize its menu until just before the menu needs to be displayed. However, taint may still occur if the game creates a secure frame after the addon has initialized its menu.

An addon may be also able to avoid the taint problem if its menu contains less than 8 buttons. In the test addon shown in the first post, if the addon creates a menu with 7 menu items then the compact raid frame remains untainted. However, if the addon creates 8 or more menu items, then the compact raid frame will be tainted when the game eventually creates it.

The problem ultimately lies with Blizzard's drop down menu functions. Those functions are used by a lot of addons as well as the default UI. Hopefully the functions can be fixed so that addons using them don't indirectly cause secure frames to become tainted. Until then we will continue to get those error messages.
Reply Quote
100 Tauren Druid
13175
Thank you for this nice, clear and concise response. I'm not a programmer and I don't quite understand all that you said but I get most of it. hehe I know what dropdowns are, I thougth you meant they just appear on mouse over and I was trying to think of what did that.
Edited by Rhazzledazle on 9/13/2012 5:28 AM PDT
Reply Quote
100 Tauren Druid
13175
I know this thread is on the older side, but I'm finding that close to 10 and more addons are having issues with this taint. I did not have any of this in the past, it...seems, it started with 5.0.4.
Reply Quote
85 Tauren Druid
6765
09/19/2012 01:03 PMPosted by Rhazzledazle
I know this thread is on the older side, but I'm finding that close to 10 and more addons are having issues with this taint. I did not have any of this in the past, it...seems, it started with 5.0.4.


Same here - and I have seen zero acknowledgement by Blizz that they are aware of the taint-spread issue in what appears to be their code.
Reply Quote
100 Blood Elf Warrior
2860
This is still going on after the 5.05 patch. Blizz, this is throwing errors in all kinds of addons. Respond?

To me this looks like some sort of boundary issue, like a "magic number" constant sort of defect. And it also looks like a lot of other errors we are seeing in the 5.04 release - regression errors. To me, as an experienced software engineer, this whole release feels poorly tested.
Reply Quote
100 Blood Elf Warrior
2860
If a limit of 8 is the issue, and UIDropDownMenu is where you see the errors, then look at ...

BlizzInterface_enUS\FrameXML -- line 2:
UIDROPDOWNMENU_MAXBUTTONS = 8;


Its a global.

In the famous words of the Mythbusters: There's your problem.
Edited by Kinx on 9/28/2012 8:06 AM PDT
Reply Quote
Is there any blue that has said this is known by them? I checked the known issues and this was not reported.
Reply Quote
Any acknowledgment from Blizz? Or should we just file a ticket in-game every day?
Reply Quote
92 Undead Warlock
13985
so my question is why can't we just edit the

UIDROPDOWNMENU_MAXBUTTONS = 8;

and make it like 16 instead of 8?
Reply Quote
100 Tauren Druid
18530
so my question is why can't we just edit the

UIDROPDOWNMENU_MAXBUTTONS = 8;

and make it like 16 instead of 8?


Because editing the value of anything that comes from Blizzard code taints it. If we leave UIDROPDOWNMENU_MAXBUTTONS as it is right now, some problem occurs deeper in the logic that taints another value, UIDROPDOWNMENU_MENU_LEVEL. If we change UIDROPDOWNMENU_MAXBUTTONS, that value becomes tainted. We cannot change anything at all that comes from Blizzard without risking taint-related errors.
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)

Reported!

[Close]