Here is a clear and concise description of what the problem is:
When manually updating an addon that has a private repository in its manifest, Kodi will crash. The source of the problem appears to be with changes made between Matrix Alpha 1 and Alpha 2:
The call to CheckForUpdates is casting an object that is not a CRepository into one, which bypasses construction, but more specifically the CRepository::m_dirs member variable isn't really a vector<>, causing the crash when m_dirs is attempted to be iterated here:
The vector<> iterators are garbage, so it enters the loop and blows up calling dir.checksum.empty().
Here is a clear and concise description of what was expected to happen:
Expected to not crash, I suppose?
Please see description above.
Construct a new instance of CRepository and use that instead? That doesn't appear to be trivial with the information on-hand in that function and might need multiple changes to support it, so I didn't bother trying a PR for this one, leaving it to the pros.
Steps to reproduce the behavior:
The debuglog can be found here:
https://paste.kodi.tv/resavetori.kodi
Here are some links or screenshots to help explain the problem:
N/A
N/A
Used Operating system:
note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.
How could it be that an addon instance with type ADDON_REPOSITORY is not a CRepository?
It appears to start life via AddonBuilder::Generate() as ADDON_UNKNOWN and therefore just a CAddon instance, but I didn't really dig in that far. Just telling you what I found :)
bool CAddonInfo::HasType(TYPE type, bool mainOnly /*= false*/) const
{
return (m_mainType == type || ProvidesSubContent(type, mainOnly ? m_mainType : ADDON_UNKNOWN));
}
Seems we need to call HasType(true) in this case... @AlwinEsch what do you say?
Is the addon you attempted to install something you can share?
Certainly: https://github.com/djp952/pvr.hdhomerundvr/releases/tag/matrix-3.3.3a
This would be the only version I have compatible with master/Alpha 3.
Seems we need to call HasType(true) in this case
@phunkyfish I'm pretty sure this is the correct fix.
Seems we need to call HasType(true) in this case
@phunkyfish I'm pretty sure this is the correct fix.
I鈥檓 not disputing that. Was just curious to see what structure the repo being installed had.
@howie-f can you pick up this change?
@howie-f can you pick up this change?
sure, ..else if (m_addon->HasType(ADDON_REPOSITORY, true)) separate PR or the pending one?
@djp952 could you please check if this https://github.com/howie-f/xbmc/commit/19b92db2768e85148e5b23824bcf6853c3430522 fixes your issue? if it does i'll polish it up. thanks
@howie-f - looks great from here! Thank you very much!
edit: This wasn't a static analysis I did make the proposed changes and rebuilt from master branch. By "looks great" I mean I did legitimately build and test it and it worked just fine for me...
I just wanted to thank @howie-f for all the work that went into this on my account. It is sincerely appreciated! 馃憤 馃憤 馃憤