This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 188155

Summary: Complete never ends, CPU at 100%
Product: php Reporter: rogojine <rogojine>
Component: EditorAssignee: rmatous <rmatous>
Status: VERIFIED FIXED    
Severity: normal CC: emononen, mmirilovic, pjiricka, pulsorock, valCooL
Priority: P1    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: message log, bug happened at the start of the session
thread dump, CPU at 100%
compressed log, bug happened after some time

Description rogojine 2010-06-28 13:41:23 UTC
Created attachment 100455 [details]
message log, bug happened at the start of the session

When dealing with PHP code, the completion sometimes starts but never ends. A tool tip prints "Please wait" (not the exact message that is in French), then the CPU goes to 100%, and the completion list never shows up. I can still move the cursor and continue to edit, but the CPU stays at its max until I restart Netbeans.

I could not find an easy way to reproduce this bug, but it happens quite frequently here. I word on a small to medium sized project in PHP, using the Yii framework.

As recommended in the wiki FaqScanningAndIndexingIssues, I'll attach detailed message logs. A bzipped one for when it happened in the middle a session. A second one for the same problem happening at start (I had to close and reopen the project).
I'll also attach a thread dump.

Unless I missed something, I can't add more than one file to the original report.
Comment 1 rogojine 2010-06-28 13:42:17 UTC
Created attachment 100456 [details]
thread dump, CPU at 100%
Comment 2 rogojine 2010-06-28 13:43:07 UTC
Created attachment 100457 [details]
compressed log, bug happened after some time
Comment 3 rogojine 2010-07-14 19:48:35 UTC
Here is a way to reproduce this bug. I did this with `netbeans --userdir ~/netbeans-config-tmp` to have a default configuration and no custom plugins.

1. Download and extract Yii 1.1.3.
   https://netbeans.org/bugzilla/show_bug.cgi?id=187127
2. Create a new project "PHP with sources" from "yii-1.1.3/demos/blog".
3. Add "yii-1.1.3/framework" to the project include path.
4. Open the file "Source Files/protected/models/Lookup.php".
5. Go to the last code line and complete (ctrl-space) just after "self::".
     self::<COMPLETE_HERE>$_items[$type][$model->code]=$model->name;
   CPU goes to 100%.

After this, any attempt to complete anything gives the tooltip "Please wait...".
Comment 4 rogojine 2010-07-14 19:52:14 UTC
(In reply to comment #3)
The URL to download the Yii framework archive was mysteriously converted into a Netbeans bug report. Please ignore this URL and go to www.yiiframework.com (without "hxxp" prefix, I hope it won't be mangled).
Comment 5 rmatous 2010-07-16 11:35:38 UTC
*** Bug 187989 has been marked as a duplicate of this bug. ***
Comment 6 rmatous 2010-07-16 13:42:03 UTC
http://hg.netbeans.org/web-main/rev/2b54057d9d46

This issue might be also fixed into release 6.9.1, but I need verification that the fix really helps. Thanks to rogojine I was able to reproduce the never ending loop, so at least in this usecase this fix works.

Problem description: never ending loop for type inference when e.g. method "a" calls method "b"  and method "b" calls method "a" (on different types but with the same name). 

Justification for fixing it into relase 6.9.1:
-many duplicates
-complains about it on forums, blogs (http://blogs.sun.com/netbeansphp/entry/is_the_ide_slow_send#comments)


For verification use please #2079 build (or newer):
http://bertram.netbeans.org/hudson/job/PHP-build/2079/
(http://bertram.netbeans.org/hudson/job/PHP-build/)
Comment 7 rmatous 2010-07-16 13:59:44 UTC
*** Bug 188103 has been marked as a duplicate of this bug. ***
Comment 8 Erno Mononen 2010-07-16 14:57:20 UTC
I had a look at the diff on radek's request; the change looks safe and the logic behind it seems sound.
Comment 9 rmatous 2010-07-16 15:53:34 UTC
Thanks François for verification:
http://forums.netbeans.org/topic29589.html
Comment 10 rmatous 2010-07-16 16:20:44 UTC
Transplanted to release691:
http://hg.netbeans.org/release691/rev/b9d3fe81e7a7
Comment 11 Quality Engineering 2010-07-17 03:47:01 UTC
Integrated into 'main-golden', will be available in build *201007170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/2b54057d9d46
User: Radek Matous <rmatous@netbeans.org>
Log: #188155 - Complete never ends, CPU at 100%