How to deal with taint issues?
Hello!
I've been the whole morning trying to understand the taint logs and why I'm getting this error in my addon and it doens't make too much sence to me. This is the first time I have to deal with something like this, so I'm a little bit lost. Here is the log: Code:
5/24 14:59:11.579 Global variable INTERFACE_ACTION_BLOCKED_SHOWN tainted by RareScanner - Interface\FrameXML\UIParent.lua:5448 DisplayInterfaceActionBlockedMessage() Code:
Interface\AddOns\Blizzard_EncounterJournal\Blizzard_EncounterJournal.lua:1720 EncounterJournal_ClearDetails(): My addon doesn't use anything from the EncounterJournal, so I imagine this error comes from somewhere else. Ideas? I'm not asking for the solution, I'm asking for a guide of how can I find the relation between that error and my bug. Thanks. |
Not sure but it might be taint from WorldMapFrame:AddDataProvider() or something else tainting the WorldMapFrame
Which in turn would show an interface action blocked message when calling ShowUIPanel() in combat from now-tainted code |
Hey Ketho.
Thanks for your answer. The first thing I did was to comment the parts of the code where I was using the "WorldMapFrame", which are in 2 places: - WorldMapFrame:AddDataProvider() - WorldMapFrame.overlayFrames I also modified the library HereBeDragons that I use in my addon to stop using the WorldMapFrame. But yet... the error persists. Cheers. |
It says that you have tainted EncounterJournalBossButton1 at some point. You will need to look further back in the log to find out where.
Then, during the defualt UI's execution - it read EncounterJournalBossButton1 and tainted itself. You should post the whole taint log |
Taint is pretty easy to understand, but these forums make it complicated by saying "you can't trust the logs". What you basically need to do is look for any piece of code that modifies existing Blizzard code without using provided widget API. The problem with taint is generally that you replace methods or variables used in secure scopes, or that you call a method/function that has side effects.
What you can't safely do: Lua Code:
The issue with calling existing methods implemented in pure Lua (if you can find the function definition in the Lua source code, it's risky to call it) can be a bit obscure, but I'll show you an example. Let's say you have a function like this: Lua Code:
Blizzard has workarounds for some things that addons need to be able to access, and in that case you will find Blizzard using securecall to wrap the function call in a secure closure (meaning taint will not affect the outcome), or the opposite forceinsecure to say "we don't know this next bit of code is going to be safe". The reason you get a weird reference to something you haven't even touched, is that you touched the code somewhere BEFORE that line was executed, which is when the tainted execution path was discovered. You can't trust the log in that sense, but tracing back from where the error occurred will lead to where you modified something that eventually carried taint to the breaking point. As a rule of thumb, it's easier to look for places where you used/modified existing code indiscriminately, than it is to follow the stack trace from a taint error. |
MunkDev, thank you very much for your guide.
That's actually what I was looking for. I've been reading about taint in other places and they make it sound so complicated, when actually is fairly simple. Too bad I didn't have this information when I started to develope the addon, now I will have to review all the code to see where I'm doing the things wrong. Cheers. |
Ditto on that thanks .. it appears nUI's old code used alot of *bad* functionality that was all that was known way back when I assume ... the addon is almost as old as wow rofl.
I'll have to book mark this thread so I can go back to it when I want to go through my addons and make sure that I am not doing anything just as bad myself rofl. |
All times are GMT -6. The time now is 10:36 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI