View Single Post
03/30/17, 03:38 AM   #14
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
I hope I understood this correctly. Every closure that is created by the stock UI has a "trusted" flag set to "true" and every closure created by an addon has it set to "false".
When you execute a function you have a separate flag which starts as true. You then look at the flag for each closure you encounter along the way and set that flag to false on the first addon closure. Once it is false, it is no longer possible to execute private functions until the callstack unwinds.

I am not sure how helpful it would be to know at which step of the callstack the closure became tainted. That wouldn't tell us more than what we already know, or would it? But it might be a good start anyways.

When saving the whole callstack is problematic memorywise, maybe you could at least save the last entry of it? If I am not mistaken, that should be the line of code that we need to look at and would tell us a lot already. Or if that is still too much, maybe save a number which represents the addon index from the addon manager when you set the trusted flag to false? That way we at least know who originally caused the violation and it shouldn't use as much memory.

Or as votan said, make it a flag in the usersettings.txt so we can turn it on when we are debugging. That way it shouldn't matter how much memory it takes.
  Reply With Quote