[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #19 from Alex Richardson--- Git commit bba0f034c4bdfdf9375b7532d134ef05214ce51b by Alex Richardson. Committed on 12/02/2016 at 12:48. Pushed by arichardson into branch '5.0'. Don't add HintedType instances to UnsureType if the target type exists But only do this if the HintedType also has the same context, otherwise they might be invalidated at separate times and removing one of them removes the still valid other HintedType. If we don't deduplicate here we still get UnsureTypes which have lots of entries like this: found potential duplicates when adding N6Python10HintedTypeE int(index = 774764) -> 67278 - int of type N8KDevelop13StructureTypeE 102814 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 139700 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 140778 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 191576 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 206348 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 346692 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 351636 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 362174 (aka 351724: int of type N6Python10UnsureTypeE) - int of type N6Python10HintedTypeE 386886 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 408898 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 533652 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 540306 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 573586 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 614644 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 618548 (aka 66042: bool of type N8KDevelop12IntegralTypeE) - bool of type N6Python10HintedTypeE 648374 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 665250 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 709684 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 750432 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 89504 (aka 66548: str of type N8KDevelop13StructureTypeE) - str of type N6Python10HintedTypeE 765024 (aka 90024: str of type N6Python10UnsureTypeE) - str of type N6Python10HintedTypeE 774764 (aka 403436: int of type N6Python10UnsureTypeE) - int of type N6Python10HintedTypeE REVIEW: 127039 M +6-0duchain/types/hintedtype.cpp M +2-0duchain/types/hintedtype.h M +38 -8duchain/types/unsuretype.cpp http://commits.kde.org/kdev-python/bba0f034c4bdfdf9375b7532d134ef05214ce51b -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #20 from Sven Brauch--- Hmm. Running duchainify /usr/lib/python3.5, I still see some very long hangs somewhere around this code (notably processing site-packages/twisted/trial/test/test_deferred.py). Maybe this needs to be investigated even further :( -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #18 from Alex Richardson--- Thank you for fixing this! However there are still a lot of types being added that in my opinion don't need to exist: found potential duplicates when adding N6Python10HintedTypeE int(index = 774764) -> 67278 - int of type N8KDevelop13StructureTypeE 102814 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 139700 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 140778 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 191576 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 206348 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 346692 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 351636 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 362174 (aka 351724: int of type N6Python10UnsureTypeE) - int of type N6Python10HintedTypeE 386886 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 408898 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 533652 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 540306 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 573586 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 614644 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 618548 (aka 66042: bool of type N8KDevelop12IntegralTypeE) - bool of type N6Python10HintedTypeE 648374 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 665250 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 709684 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 750432 (aka 67278: int of type N8KDevelop13StructureTypeE) - int of type N6Python10HintedTypeE 89504 (aka 66548: str of type N8KDevelop13StructureTypeE) - str of type N6Python10HintedTypeE 765024 (aka 90024: str of type N6Python10UnsureTypeE) - str of type N6Python10HintedTypeE 774764 (aka 403436: int of type N6Python10UnsureTypeE) - int of type N6Python10HintedTypeE I'll submit a patch shortly. -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #14 from Alex Richardson--- I added some debug output into UnsureType::addType() and get the rather confusing: "unsure (str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str)" + "int" -> "unsure (str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int, str, int)" UnsureType::addType() checks if a type as already contained, so the int should not be added. Similarly I also get this: "unsure (Path, str, Path, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path)" + "str" -> "unsure (Path, str, Path, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str, Path, str,
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #15 from Alex Richardson--- I am also getting some of these messages: kdevplatform.language: invalid item for index 35 1478 0 In case it helps: This is the huge unsure type that is being created (it is now so large that outputting the debug info is starting to cause noticeable lags): "unsure (str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path, str), str, list of unsure (str, int), unsure (list of void, list), list of str, list of unsure ((unknown direct declaration), Path,
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #16 from Sven Brauch--- Interesting. Can you maybe print type->indexed()->index() for each type in the list (and also the one which is added)? -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 Sven Brauchchanged: What|Removed |Added Resolution|--- |FIXED Status|REOPENED|RESOLVED Latest Commit||http://commits.kde.org/kdev ||-python/bb98418eb0da83257f3 ||adb91baf8630ee808ddec --- Comment #17 from Sven Brauch --- Git commit bb98418eb0da83257f3adb91baf8630ee808ddec by Sven Brauch. Committed on 10/02/2016 at 23:27. Pushed by brauch into branch '5.0'. fix hinted type appearing repeatedly in unsure type list The check looking whether a type is already in the list of possible types for an unsure does not work properly for HintedTypes, because they create a new IndexedType each (due to different modification revisions). When a function declaration was imported from another file, this would leed to arbitrarily large type lists, since on each parse pass of the importer an entry would be added but the list was never cleared. M +1-1duchain/declarationbuilder.cpp M +5-72 duchain/helpers.cpp M +1-1duchain/helpers.h M +1-7duchain/types/hintedtype.cpp M +8-10 duchain/types/hintedtype.h M +19 -0duchain/types/unsuretype.cpp M +18 -14 duchain/types/unsuretype.h http://commits.kde.org/kdev-python/bb98418eb0da83257f3adb91baf8630ee808ddec -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #13 from Sven Brauch--- Thanks for the output. I think the reason is that KDevPlatform compares only the index of the type, but that is not at all reliable for unsure types. Instead, the types themselves have to be checked for duplicates. -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 Sven Brauchchanged: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED |--- --- Comment #11 from Sven Brauch --- apparently not resolved after all, reopening this -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #12 from Alex Richardson--- Created attachment 97119 --> https://bugs.kde.org/attachment.cgi?id=97119=edit debug output Still happening, here is some debug output -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #10 from Sven Brauch--- Very good, thanks for testing. This is in 5.0, if I don't see it causing other issues I'll try to backport it to 4.7.x as well ... -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 Sven Brauchchanged: What|Removed |Added Status|CONFIRMED |RESOLVED Resolution|--- |WAITINGFORINFO -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #7 from Sven Brauch--- Created attachment 96925 --> https://bugs.kde.org/attachment.cgi?id=96925=edit potential fix for this bug -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #6 from Sven Brauch--- I found a possibly related issue, could you maybe apply the patch below and see if you can still reproduce your problem? -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #5 from Sven Brauch--- Thanks, I'll try that. You could try unsuretype.cpp in kdevplatform, in addType, to see which types are added ... but it will probably be too spammy no matter where you put it. -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #4 from Alex Richardson--- I was editing the script here: https://github.com/RichardsonAlex/cheri-scripts Hasn't happended the last two days, but I have only done minor edits, so I guess the number of UnsureType instances haven't grown enough. I'll post a backtrace next time the freeze happens. Any suggestions where I should add some qDebug() calls to make this easier to debug? -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 Sven Brauchchanged: What|Removed |Added Severity|normal |crash -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 --- Comment #3 from Sven Brauch--- Hmm. Can you post the backtrace? Also do you have example code which you edit to trigger this bug? -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 Sven Brauchchanged: What|Removed |Added CC||p.v.niek...@hccnet.nl --- Comment #2 from Sven Brauch --- *** Bug 355094 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
[kdev-python] [Bug 358563] Possible infinite loop in UnsureType::toString()
https://bugs.kde.org/show_bug.cgi?id=358563 Sven Brauchchanged: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED |CONFIRMED --- Comment #1 from Sven Brauch --- Good find, that is certainly the same as bug 355094. I'll look into it now that I have more specific information. -- You are receiving this mail because: You are watching all bug changes.