Thread Tools Display Modes
10-22-12, 06:23 AM   #1
Animor
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 136
New whispers on new tabs cause UI errors and taints

Hi,

I'm opening a new thread, since my previous has a misleading subject, and the problem seems to be global and not related only to my addon.

The behavior I have encountered is very strange: setting new whispers to be displayed on a new tab (Interface -> Social) causes LUA and UI errors. Several addons are being blamed for these errors, including DBM, bartender and more. It also happens after I disabled almost every addon I have (including my own).

1. First error is easy to reproduce: log into the game, whisper yourself so a new tab will show. Then open glyphs panel and click on a glyph from the list. A UI error will appear.

2. Second error happens on BG: enter a BG (Silvershard Mines demonstrates the best), whisper yourself so a new tab will show, then make sure to be in combat while the game updates the BG score (top-middle of the screen). Bugsack capture lua errors of the following: ArenaEnemyFrames:ClearAllPoints(), ArenaEnemyFrames:SetPoint(), ArenaPrepFrames:ClearAllPoints(), ArenaPrepFrames:SetPoint(). These are also blamed on several addons.

I wonder if these errors happen only to me, or to others as well. Perhaps my WoW installation gone mad or something, since it seems very strange indeed.
  Reply With Quote
10-22-12, 10:33 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
The default UI tends to taint itself a lot. When taint happens, the game engine always assumes it's from an addon and only stores an index number to tell which one. I don't know the game engine's code, but let's say when the default UI taints itself, this index gets set to 0. When the game gets to displaying an error about it, there is no addon at index 0, so to prevent a crash, it picks index 1, which is the top addon in the addon list when you look at it in the character select screen.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-23-12, 10:02 AM   #3
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
Originally Posted by SDPhantom View Post
The default UI tends to taint itself a lot. When taint happens, the game engine always assumes it's from an addon and only stores an index number to tell which one. I don't know the game engine's code, but let's say when the default UI taints itself, this index gets set to 0. When the game gets to displaying an error about it, there is no addon at index 0, so to prevent a crash, it picks index 1, which is the top addon in the addon list when you look at it in the character select screen.
That's not how it work, the default UI cannot taint itself. This is how taint works:

Blizzards code is blessed and carries no taint, this includes the AddOns/Blizzard_*. Addons (eg, everything else) start out as tainted. Every time an addon touches something that's untainted (Blizzard code), the part of Blizzards code you touched becomes tainted. Blizzard does not notify you about taint until it hits something that requires an untainted execution path, such as :Show() or :Hide() while in combat. Or the glyph/talent UI.

The secure templates are a mix of this. They are blessed/untainted because it's Blizzard code, but they become tainted because addons interact with them. They can temporarily ignore taint when executing, because the secure templates have a strict environment and verifies everything to make sure no monkey business is going on.

You can see this if you look at the code, such as SecureTemplates.lua which calls forceinsecure() to force taint when it's calling a custom method that's not controlled by the secure templates.

As an analogy, because everyone loves analogies: Blizzards code is blue, Addons are red. Whenever an addon (red) interacts with blizzards code (blue), Blizzards code turns red. Everything will continue executing merrily along it's way until the C engine reaches a point where it has to go "Only execute this if it's still blue, otherwise raise a taint error".

This is also how taint can spread. Because once you taint one part of the Blizzard code, it can spread to other areas if tainted Blizzard code interacts with other tainted code.

Last edited by Shadowed : 10-23-12 at 10:13 AM.
  Reply With Quote
10-23-12, 10:10 AM   #4
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
I wish there were more debug API added regarding fixing taint issues, those that break stuff. It is insanely annoying to attempt to figure out what broke it in the first place... cought drop down template, cough.
__________________
Profile: Curse | Wowhead
  Reply With Quote
10-23-12, 10:17 AM   #5
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
As an addendum. The default UI can't actually taint itself. The glyph issue with _ (which was fixed already), wasn't Blizzards UI tainting itself, it was addons tainting _ which in turn tainted the glyph UI.

Last edited by Shadowed : 10-23-12 at 11:28 AM. Reason: Clarified
  Reply With Quote
10-23-12, 11:44 AM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
The main problem with Blizzard_CompactRaidFrames in most of Cataclysm was the fact it was tainting itself while trying to update in combat. There are problems in Blizzard's code, they are not the holy grail of programming by any means.

I forgot many specific reasons, but Blizzard has been known to randomly blame addons in this way. In this specific occasion, when removing/disabling said addon, it just blames the next one down in the list.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-23-12 at 12:04 PM.
  Reply With Quote
10-23-12, 11:51 AM   #7
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
I don't know what to make out of this now... I trust you and SDPhantom but there are two conflicting posts going on, lol.
__________________
Profile: Curse | Wowhead
  Reply With Quote
10-23-12, 12:17 PM   #8
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
Originally Posted by SDPhantom View Post
The main problem with Blizzard_CompactRaidFrames in most of Cataclysm was the fact it was tainting itself while trying to update in combat. There are problems in Blizzard's code, they are not the holy grail of programming by any means.

I forgot many specific reasons, but Blizzard has been known to randomly blame addons in this way. In this specific occasion, when removing/disabling said addon, it just blames the next one down in the list.
When deciding which addon to blame, Blizzard uses the last addon that caused the taint.

So if addons A, B, C all taint the same thing, but C taints on PLAYER_ENTERING_WORLD while A and B taint on ADDON_LOADED, the blame will be associated to C. If you then disable C, it will blame the addon that loaded last, so if it loads A then B, B will be blamed with the taint.
  Reply With Quote
10-23-12, 12:28 PM   #9
Spike`
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 3
the one still needing fixing is InterfaceOptions_AddCategory()

ahh... so many taints hehe
  Reply With Quote
10-23-12, 12:39 PM   #10
Animor
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 136
Hi,

This is indeed a very educating discussion.

Did any of you manage to reproduce the UI error with the glyph I have described? Can you think of an explanation or a way to fix that?


Originally Posted by Spike` View Post
the one still needing fixing is InterfaceOptions_AddCategory()

ahh... so many taints hehe
What taints are caused by InterfaceOptions_AddCategory()? I saw that Healbot for example removed itself from the inteface panel due to taints, and I wondered why.
  Reply With Quote
10-23-12, 01:01 PM   #11
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Blizzard's options panel code is propagating taint into the Blizzard options side.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-23-12, 01:35 PM   #12
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Originally Posted by Shadowed View Post
As an addendum. The default UI can't actually taint itself. The glyph issue with _ (which was fixed already), wasn't Blizzards UI tainting itself, it was addons tainting _ which in turn tainted the glyph UI.
Is it fixed ? Comment 5 mentions that its still unfixed ...
http://www.wowace.com/announcements/...h-ui-taint/#c5
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
10-23-12, 01:42 PM   #13
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
Originally Posted by Rilgamon View Post
Is it fixed ? Comment 5 mentions that its still unfixed ...
http://www.wowace.com/announcements/...h-ui-taint/#c5
The _'s that were leaking were closed last I looked. Taint issues at this point would be addons specifically tainting the glyph UI, rather than indirectly tainting it through tainting _.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » New whispers on new tabs cause UI errors and taints

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