Thread Tools Display Modes
08-22-18, 02:27 PM   #1
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
How to handle addon interference?

I am the maintainer of Skillet and it and Bagnon are interfering with each other. When both are enabled, either an error occurs (see below) or the player's bags won't open. Of course, disabling Skillet resolves the interference.

Error occured in: Global
Count: 1
Message: ...\AddOns\Skillet\Libs\LibAbacus-3.0\LibAbacus-3.0.lua line 535:
C stack overflow

After looking at my code and looking at the issues submitted against Bagnon, I'm 99% convinced that this is a Bagnon issue (older versions work) and I don't know what I can do to Skillet to fix it. I have tried to contact the Bagnon authors with no success (there are 150+ open issues against Bagnon and none open against Skillet).

I am however, getting tired of closing issues against Skillet. I'm considering adding code to Skillet to print a big red message when it discovers that Bagnon is also loaded (and perhaps also shutting down Skillet).

Before I do anything this drastic, I thought I would ask for advice from this community first. What is the "politically correct" thing to do?

In case anyone wants more details, see closed issues #533 and #545 at https://www.wowace.com/projects/skillet/issues
  Reply With Quote
08-22-18, 02:39 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Personally I would point out the incompatibilities and that you are trying to contact the developer of the other addon to resolve them but in the mean time users will have to decide on which addon is their preference, preferably stop using the other addon in favor of your own of course.

An alternative is to have a pop up YES/NO window come up when it is discovered that both are loaded and asks the question on whether to unload Skillet (YES) or Bagnon (NO) due to incompatibilities and unload the addon requested by the user.
__________________
  Reply With Quote
08-22-18, 03:09 PM   #3
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Weird. I have used both Skillet and Bagnon for years and never had issues with compatibility. I'm in game right now with the most recent versions of both (4.04 and 8.0.2 respectively) and they both work just fine.

After looking at both of those tickets, looking at LibAbacus, and a dump command, the issue is not Skillet or Bagnon.

It's LibAbacus and the Ace2 compatibility it has at the bottom of its file.

Autobar uses AceLibrary, PetCare overhauled their files but wasn't using Ace2 from what I can see, Broker_Portals uses AceLibrary, and so on. Everybody that has this issue has an addon that uses AceLibrary. This compatibility causes some sort of self-referential loop that somehow affects Bagnon.

You can reproduce this issue by installing AceLibrary.
  Reply With Quote
08-22-18, 03:36 PM   #4
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by Kanegasi View Post
After looking at both of those tickets, looking at LibAbacus, and a dump command, the issue is not Skillet or Bagnon.

It's LibAbacus and the Ace2 compatibility it has at the bottom of its file.
If I understand you correctly, opening an issue against LibAbacus and a subsequent fix would resolve this?
  Reply With Quote
08-22-18, 03:47 PM   #5
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by bsmorgan View Post
If I understand you correctly, opening an issue against LibAbacus and a subsequent fix would resolve this?
I think I can answer my own question... LibAbacus-3.0 hasn't had a release since 2008 (or 2012 if you count an alpha release).

It looks like the right answer is to replace LibAbacus-3.0 completely. Any suggestions for a suitable replacement?
  Reply With Quote
08-22-18, 03:58 PM   #6
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Given that Ace2 (and Rock) are super old and long dead, I would just delete everything below line 525 in LibAbacus-3.0.lua. That section's purpose is only to register with Ace2 and Rock. LibStub has been the standard for library tracking for several expansions and Abacus uses LibStub already.
  Reply With Quote
08-22-18, 04:21 PM   #7
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by Kanegasi View Post
Given that Ace2 (and Rock) are super old and long dead, I would just delete everything below line 525 in LibAbacus-3.0.lua. That section's purpose is only to register with Ace2 and Rock. LibStub has been the standard for library tracking for several expansions and Abacus uses LibStub already.
That doesn't solve the problem of all the LibAbacus-3.0 libraries embedded in addons unless one can somehow get that code released as a new version of the library.

I'm going to solve the problem in Skillet by just copying the two functions Skillet uses and deleting references to LibAbacus-3.0. That doesn't solve Bagnon's problem but it will eliminate Skillet from the tracebacks.
  Reply With Quote
08-22-18, 04:46 PM   #8
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
If you increase the version number at line 13, anyone with your addon installed will use your Abacus, effectively updating it. That's how libraries work, the most recent version loaded is served by LibStub, any other version is ignored, no matter what else is installed.

However, reorganizing Skillet to not use Abacus is probably the better answer.

Edit: Nevermind, the library system only deals with the functions provided by the library, it won't fix the Ace2/Rock loop. My bad.

Last edited by Kanegasi : 08-22-18 at 04:49 PM.
  Reply With Quote
08-22-18, 06:35 PM   #9
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Now I have a (hopefully) stupid question. I removed all references to LibAbacus-3.0 from the code, the .toc, and the .pkgmeta but after updating the SVN, the Wowace packager included LibAbacus-3.0 anyway.

What did I miss?
  Reply With Quote
08-22-18, 08:47 PM   #10
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
You also have to remove LibAbacus from Wowace's relations, the serverside part of the packager process.

https://www.wowace.com/projects/skil...ault-relations
  Reply With Quote
08-22-18, 09:30 PM   #11
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by Kanegasi View Post
You also have to remove LibAbacus from Wowace's relations, the serverside part of the packager process.

https://www.wowace.com/projects/skil...ault-relations
I can see there is a relationship between Skillet and LibAbacus-3.0 but I'll be damned if I can figure out how to break the relationship! Skillet wants a divorce!
  Reply With Quote
08-23-18, 11:42 AM   #12
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
On the page I linked, there's a little trashcan icon above each relation.

  Reply With Quote
08-23-18, 12:10 PM   #13
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
You may have a little trashcan icon but I don't. I'm not the "owner" of the project, just the "maintainer". The "owner", Yossa, hasn't been active on Skillet for years.
  Reply With Quote
08-24-18, 01:44 PM   #14
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
It seems really bizarre that just using AceLibrary causes this conflict. Removing that from AutoBar is going to be a massive pain.
  Reply With Quote
08-24-18, 02:37 PM   #15
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by MuffinManKen View Post
It seems really bizarre that just using AceLibrary causes this conflict. Removing that from AutoBar is going to be a massive pain.
I'm not removing all of AceLibrary, just LibAbacus-3.0. What is happening to Skillet is that LibAbacus-3.0 is crashing from some other addon's use of it but since Skillet has the most recent copy, Skillet appears in the traceback. If you follow the traceback down past all the LibAbacus-3.0 calls, you don't find a call from Skillet, you find some other addon.

LibAbacus-3.0 was last updated in 2012 (last released version 2008). The chances are slim to none that a bug in LibAbacus-3.0 is going to be fixed. It is such a simple library that I was able to eliminate the need for it in Skillet in less than an hour.

Unfortunately, I can't say the same for the packager. It is beginning to look like I'll have to abandon Skillet and recreate it as Skillet2 because I can't get the packager to remove LibAbacus-3.0 from the Skillet package. The "owner" of the project hasn't been active on the project for years now and only pops up when I attempt to take ownership away from him. Getting a response from CurseForge or WowAce development is equally difficult.
  Reply With Quote
08-24-18, 08:55 PM   #16
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
AutoBar doesn't use LibAbacus, so I'm not sure what's going on. I want to remove all of the Ace2 stuff anyway, but it'll be a big job. I have removed a fair bit.
  Reply With Quote
08-24-18, 09:08 PM   #17
MuffinManKen
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 106
I had another look at one of the stack traces and there is no actual AutoBar code in it (stack trace follows). It's just erroring out in AutoBar's copy of CallbackHandler which is newer than the one that seems to ship with Bagnon.
Could there have been a breaking change in CallbackHandler and Bagnon isn't handling it?

Code:
2x ...Bar\libs\CallBackHandler-1.0\CallbackHandler-1.0-7.lua:51: [string "safecall Dispatcher[5]"]:1: chunk has too many syntax levels
[C]: ?
...Bar\libs\CallBackHandler-1.0\CallbackHandler-1.0-7.lua:51: in function <...Bar\libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:25>
...Bar\libs\CallBackHandler-1.0\CallbackHandler-1.0-7.lua:55: in function <...Bar\libs\CallBackHandler-1.0\CallbackHandler-1.0.lua:54>
...Bar\libs\CallBackHandler-1.0\CallbackHandler-1.0-7.lua:90: in function Fire' ...AutoBar\libs\LibDataBroker-1.1\LibDataBroker-1.1-4.lua:31: in function <...AutoBar\libs\LibDataBroker-1.1\LibDataBroker-1.1.lua:22> BugSack\ldb.lua:36: in function <BugSack\ldb.lua:33> [C]: in functionUpdateDisplay'
BugSack\core.lua:61: in function <BugSack\core.lua:46>
[string "safecall Dispatcher[2]"]:4: in function <[string "safecall Dispatcher[2]"]:4>
[C]: ?
[string "safecall Dispatcher[2]"]:13: in function ?' ...Bar\libs\CallBackHandler-1.0\CallbackHandler-1.0-7.lua:90: in functionFire'
...
Bagnon\components\frame.lua:60: in function Update' Bagnon\components\frame.lua:50: in functionRegisterSignals'
...s\Bagnon\external\Wildpants\components\frameBase.lua:18: in function OnShow' ...s\Bagnon\external\Wildpants\components\inventory.lua:12: in function <...s\Bagnon\external\Wildpants\components\inventory.lua:11> [C]: in functionShow'
FrameXML\UIParent.lua:3131: in function ShowUIPanel' ...aceBagnon\external\Wildpants\core\frames.lua:54: in function <...aceBagnon\external\Wildpants\core\frames.lua:50> (tail call): ? ...s\Bagnon\external\Wildpants\features\autoDisplay.lua:167: in functionToggleAllBags'
[string "OPENALLBAGS"]:1: in function <[string "OPENALLBAGS"]:1>

Locals:
(*temporary) = nil
(*temporary) = "[string "safecall Dispatcher[5]"]:1: chunk has too many syntax levels"
  Reply With Quote
08-25-18, 09:34 AM   #18
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
I don't know but the Bagnon authors are MIA (and have been for a long time if over 150 open issues is any indication).

If something is messing with the call stack who knows who is going to be blamed when things blow up. All I know is that my client is happiest when Bagnon isn't loaded.
  Reply With Quote
08-25-18, 09:40 AM   #19
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Originally Posted by MuffinManKen View Post
AutoBar doesn't use LibAbacus, so I'm not sure what's going on. I want to remove all of the Ace2 stuff anyway, but it'll be a big job. I have removed a fair bit.
There's nothing wrong with AutoBar here. I mentioned it because it was mentioned in Skillet's tickets. I made the AceLibrary connection from the LibAbacus code.

This is the offending code block in LibAbacus-3.0.lua causing the error between Skillet and Bagnon:

Lua Code:
  1. local function compat()
  2.     local Abacus20 = setmetatable({}, {__index = function(self, key) -- line 527
  3.         if type(Abacus[key]) == "function" then
  4.             self[key] = function(self, ...)
  5.                 return Abacus[key](Abacus, ...)
  6.             end
  7.         else
  8.             self[key] = Abacus[key]
  9.         end
  10.         return self[key] -- line 535
  11.     end})
  12.     AceLibrary:Register(Abacus20, "Abacus-2.0", MINOR_VERSION*1000)
  13. end
  14. if AceLibrary then
  15.     compat()
  16. elseif Rock then
  17.     function Abacus:OnLibraryLoad(major, instance)
  18.         if major == "AceLibrary" then
  19.             compat()
  20.         end
  21.     end
  22. end

AceLibrary just existing is what triggers the code, but we don't know why Bagnon causes the C stack overflow loop.

I have noted two lines with the original line numbers. The loop is between these two according to posted errors.

Last edited by Kanegasi : 08-25-18 at 11:14 AM.
  Reply With Quote
08-25-18, 10:22 AM   #20
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by Kanegasi View Post
There's nothing wrong with AutoBar here. I mentioned it because it was mentioned in Skillet's tickets. I made the AceLibrary connection from the LibAbacus code.

AceLibrary just existing is what triggers the code, but we don't know why Bagnon causes the C stack overflow loop.
While I commend your analysis it is worthless unless we can get LibAbacus-3.0 officially updated and I have no idea how to do that.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » How to handle addon interference?

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