Bug 355094 - Kdevelop unresponsive, possibly hang, when editing python 2.x code
Summary: Kdevelop unresponsive, possibly hang, when editing python 2.x code
Status: RESOLVED DUPLICATE of bug 358563
Alias: None
Product: kdev-python
Classification: Developer tools
Component: general (show other bugs)
Version: 1.7.1
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-09 17:19 UTC by p.v.niekerk
Modified: 2016-01-26 10:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Output of gdb "thread apply all bt" (57.09 KB, text/plain)
2015-11-09 17:26 UTC, p.v.niekerk
Details
Output of thread apply all bt (13.54 KB, text/plain)
2015-11-17 20:10 UTC, rjwgnr27
Details
Another output of thread apply all bt (138.73 KB, text/plain)
2015-11-17 22:13 UTC, p.v.niekerk
Details
And another bt (104.63 KB, text/plain)
2015-11-17 22:18 UTC, p.v.niekerk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description p.v.niekerk 2015-11-09 17:19:27 UTC
When browsing or editing python 2.x code, Kdevelop randomly hangs, or is unresponsive.

Reproducible: Sometimes

Steps to Reproduce:
Don't know. But it keeps happening.

Actual Results:  
"Hang"


Will attach gdb backtrace
Comment 1 p.v.niekerk 2015-11-09 17:26:21 UTC
Created attachment 95408 [details]
Output of gdb "thread apply all bt"
Comment 2 Sven Brauch 2015-11-09 19:10:34 UTC
First, please try to clear the code cache (rm -Rf ~/.cache/kdevduchain). Is the problem still reproducable?
If yes, it looks like it hangs when trying to display some type, eventually in a popup or so. Can you tell me which code you're looking at when this happens?
Comment 3 rjwgnr27 2015-11-17 20:09:23 UTC
I see the same issue on a "C" file. Entering the line "bool x = true;", and hovering over "true" will hang KDevelop, at 100% of CPU core.

I don't know if the size of the project is important, but this is a large project where the literal "true" is used many places. Attaching "thread apply all bt" below.

Kdevelop 4.7.2, on KDE 4.14.11 from Fedora 21 packages. This is a new regression, updated on Wed 11 Nov 2015. Prior version did not exhibit the issue.
Comment 4 Sven Brauch 2015-11-17 20:10:03 UTC
Did you clear the cache?
Comment 5 rjwgnr27 2015-11-17 20:10:55 UTC
Created attachment 95572 [details]
Output of thread apply all bt

Hang when hover mouse over literal "true".
Comment 6 rjwgnr27 2015-11-17 20:42:34 UTC
(In reply to Sven Brauch from comment #4)
> Did you clear the cache?

Not on this instance, but I did on other instances. Will still occur immediately after clearing cache.
Comment 7 p.v.niekerk 2015-11-17 21:55:01 UTC
To me, the original problem also occurred after clearing the cache.
Comment 8 Sven Brauch 2015-11-17 21:59:14 UTC
I think these are two separate issues, actually. The one with the backtrace in python I sort of understand, but I would need example code which causes this to investigate. The second backtrace looks entirely different, and should be put into a new report.
Comment 9 p.v.niekerk 2015-11-17 22:13:10 UTC
Created attachment 95576 [details]
Another output of thread apply all bt
Comment 10 p.v.niekerk 2015-11-17 22:18:40 UTC
Created attachment 95577 [details]
And another bt
Comment 11 rjwgnr27 2015-11-17 22:41:53 UTC
(In reply to Sven Brauch from comment #8)
> I think these are two separate issues, actually. The one with the backtrace
> in python I sort of understand, but I would need example code which causes
> this to investigate. The second backtrace looks entirely different, and
> should be put into a new report.

Will you be splitting the issues? Or would you like me to open a new one?
Comment 12 Sven Brauch 2015-11-17 22:49:26 UTC
Would be easiest if you opened a new one. Thanks.

The two backtraces look identical to the first one. The ThreadWeaver one is very weird ...
Comment 13 Sven Brauch 2015-11-17 22:53:49 UTC
So, to pursue this further I would need some example code to reproduce the problem. The issue from the python backtraces looks like it is triggered by some specific code. Can you tell me which project is loaded in KDevelop, if it's openly available?
Comment 14 p.v.niekerk 2015-11-18 14:49:06 UTC
The source code is not available, sorry about that. If you'd want specific logging / tracing to be added and can provide a patch for that, I'm willing to include it and rebuild Kdevelop.
Comment 15 Sven Brauch 2015-11-18 22:16:27 UTC
Hard to say poking in the dark. What it hangs at is creating a string representation of an "unsure type", which is created when a variable can have multiple values. Is the value you hover over maybe a function which is called in a lot of places with lots of different arguments, or so?
Comment 16 rjwgnr27 2015-11-24 18:38:31 UTC
Hi Sven. Sorry to take so long to get back to you on this; I've been heads down on a customer outage.

I have opened Bug 355854 as you asked.
Comment 17 p.v.niekerk 2015-12-04 12:59:34 UTC
We keep seeing this behaviour every day, quite annoying.
Despite that, we have not found what actually triggers it.

Not sure if it's related, but one thing we noticed is that whenever we use the word "connect" in a python file, it is always rendered Bold in a blue-ish color, independent of how and when the word is used. Expectation would be that only the definition would be bold, and that there would be variation in the colour used. Is there a reason for this special treatment?
Comment 18 Sven Brauch 2015-12-04 17:39:27 UTC
That is not related, that's just kate's Qt highlighting. It's a bit weird, but you can ignore it, it is harmless.

I'm sorry for the inconvenience, but without a way to reproduce I can't really fix it.
If you need a quick workaround, delete line 57 in duchain/unsuretype.cpp. You will lose a bit of type tracking accuracy but probably not much.
Comment 19 Sven Brauch 2015-12-04 17:41:40 UTC
sorry, duchain/types/unsuretype.cpp is the file name. The line is
  results.append(resolved.cast<UnsureType>()->typesRecursive());
That apparently runs into a (near?) infinite recursion, but I'm not sure how. To find out I'd need some example code which creates a type which triggers this behaviour.
Comment 20 p.v.niekerk 2015-12-20 20:34:17 UTC
The suggested workaround fixes the problem. Not sure exactly what functionality is gone now because of this. Anyway, this fix needs to be in!
Comment 21 Sven Brauch 2015-12-20 21:00:29 UTC
Nah, this is not a proper fix for the problem. I need to know where the issue originates from ...
Comment 22 Sven Brauch 2016-01-26 10:57:35 UTC
*** This bug has been marked as a duplicate of bug 358563 ***