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 207892 - Deadlock by invoking code completion
Summary: Deadlock by invoking code completion
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.1
Hardware: All All
: P2 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-30 07:45 UTC by Martin Fousek
Modified: 2012-04-03 07:46 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
deadlock by PHP CC (31.89 KB, text/plain)
2012-01-30 07:45 UTC, Martin Fousek
Details
dump2 (25.25 KB, text/plain)
2012-02-01 15:54 UTC, Martin Fousek
Details
dump3 (30.07 KB, text/plain)
2012-02-01 15:55 UTC, Martin Fousek
Details
log folder archive (247.04 KB, application/x-gzip)
2012-02-13 13:44 UTC, schkovich
Details
app snapshot (9.81 KB, application/octet-stream)
2012-02-13 18:19 UTC, schkovich
Details
php model with reproducible case (1.50 KB, text/plain)
2012-02-20 21:10 UTC, Martin Fousek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fousek 2012-01-30 07:45:06 UTC
Created attachment 115366 [details]
deadlock by PHP CC

NetBeans IDE 7.1 - fcs

I got this dump from one of PHP users who complains about IDE deadlocks by invoking PHP code completion. It happend to him per about 2-3 hours as far as I know. Sorry that I'm not able to provide more information. Feel free to close this issue if you wouldn't find any useful information and I would try to get more.
Comment 1 Ondrej Brejla 2012-01-30 09:12:09 UTC
Can't see anything strange in php parts. Waiting for more information.
Comment 2 Martin Fousek 2012-02-01 15:54:28 UTC
Ok, I'm attaching next two dumps. Still PHP code completion in NB71 - still not mine, reported to me by PHP user.
Comment 3 Martin Fousek 2012-02-01 15:54:49 UTC
Created attachment 115433 [details]
dump2
Comment 4 Martin Fousek 2012-02-01 15:55:03 UTC
Created attachment 115434 [details]
dump3
Comment 5 schkovich 2012-02-13 13:44:25 UTC
Created attachment 115660 [details]
log folder archive

I am facing a similar issue in the latest development build. 

IDE freezes after invoking code completion of if construct.

I tried to create snapshot but once IDE frees I was not able to save snapshot.

Attached is content of log folder. You will notice that messages log ends in each case with almost identical warning: 
log4j:WARN No appenders could be found for logger (nu.validator.source.LocationRecorder).
log4j:WARN Please initialize the log4j system properly.
Adding a fold that is identical with another previously added fold from the same FoldManager is not allowed.

Product Version: NetBeans IDE Dev (Build 201202120400)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Linux version 3.0.0-15-generic running on amd64; UTF-8; en_US (nb)

I will try to reproduce the problem on Mac during the afternoon.

Please let me know if I can assist further or provide additional information.
Comment 6 Ondrej Brejla 2012-02-13 13:52:39 UTC
You can use VisualVM [1] for making snapshots.

[1] http://visualvm.java.net/
Comment 7 schkovich 2012-02-13 18:19:31 UTC
Created attachment 115673 [details]
app snapshot

No difference on iMac. I started NB with fresh user folder.

Product Version: NetBeans IDE Dev (Build 201202130400)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Linux version 3.0.0-15-generic running on amd64; UTF-8; en_US (nb)

Please let me know if I can assist further.
Comment 8 Ondrej Brejla 2012-02-14 08:44:43 UTC
What exactly happens? You just run NB with a clean userdir, open PHP project and NB freezes? I just want to know it to try to reproduce it...because I can't right now :/

Please, make some thread dumps and profiling snapshots during deadlock. App snapshot is not much helpful. Thanks.
Comment 9 schkovich 2012-02-14 10:44:19 UTC
(In reply to comment #8)
> What exactly happens? You just run NB with a clean userdir, open PHP project
> and NB freezes? I just want to know it to try to reproduce it...because I can't
> right now :/
> 
> Please, make some thread dumps and profiling snapshots during deadlock. App
> snapshot is not much helpful. Thanks.

Nope. Type if, press ctrl+space to invoke code completion, select if (true), hit enter. Window containing code completion options will not be properly destroyed. It becomes gray and IDE freezes.

I will make requested snapshots in few hours once I am back to the office.
Comment 10 Ondrej Brejla 2012-02-14 12:26:07 UTC
Quite strange, your use case works properly for me...
Comment 11 Martin Fousek 2012-02-14 12:46:32 UTC
I had the same troubles by PHP code completion.
In method I had something like:
$this->getConnection
    ->delete("mytable")
    ->|

on | CC invoked and deadlock appeared. BTW, getConnection() returns DibiConnection. But I'm quite sure that you will not be able to reproduce that on your custom file. I'll try to attach also whole content of file once I'll find place with 100% reproducibility.
Comment 12 Ondrej Brejla 2012-02-14 12:48:11 UTC
Great, thanks.
Comment 13 schkovich 2012-02-14 19:04:06 UTC
I cannot reproduce the problem using the latest development build. I upgraded Java meanwhile as well.

Product Version: NetBeans IDE Dev (Build 201202140400)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Linux version 3.0.0-16-generic running on amd64; UTF-8; en_US (nb)

Anyway, at least I have a tool and I learned how to profile NB and create a snapshot. :)
Comment 14 Ondrej Brejla 2012-02-15 09:06:09 UTC
Good for you ;)
Comment 15 Martin Fousek 2012-02-20 21:10:51 UTC
Created attachment 115966 [details]
php model with reproducible case

I'm afraid that it's still reproducible in the latest dev builds. :/
Try attached source, you should be able to reproduce that. getConnection returns DibiConnection.

Steps to reproduce:
- invoke CC on the ->whe| place and confirm that -> deadlock is there
Comment 16 Ondrej Brejla 2012-02-21 09:16:18 UTC
Fixed in web-main: http://hg.netbeans.org/web-main/rev/c4739401ce8f
Comment 17 Quality Engineering 2012-02-22 11:02:33 UTC
Integrated into 'main-golden', will be available in build *201202220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c4739401ce8f
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #207892 - Deadlock by invoking code completion
Comment 18 Ondrej Brejla 2012-03-23 08:15:31 UTC
Vlado, please, can you verify that? Use case:

<?php

/**
 * @method Bar where($cond)
 */
class Foo {}

$f = new Foo();
$f->w^ // CC here...

?>

Thanks!
Comment 19 Vladimir Riha 2012-03-23 08:41:34 UTC
verified against case in comment #18 


Product Version: NetBeans IDE Dev (Build 201203220400)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Linux version 2.6.38-13-generic running on amd64; UTF-8; en_US (nb)
Comment 20 Marian Mirilovic 2012-03-23 10:03:28 UTC
Ondra, 
please proceed with integration into release71_fixes branch and follow
http://wiki.netbeans.org/NetBeansPatchesProcess . Thanks in advance.
Comment 21 Ondrej Brejla 2012-03-23 11:01:12 UTC
Transplanted to releases.
Comment 22 Quality Engineering 2012-03-25 02:41:28 UTC
Integrated into 'releases', will be available in build *201203242206* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/b471691bf6e6
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #207892 - Deadlock by invoking code completion
(transplanted from c4739401ce8f1376b94aa63786d060a7672ed8d2)
Comment 23 Martin Fousek 2012-03-25 22:14:48 UTC
Great to see that transplanting into patch2, thanks Ondra!
Comment 24 Vladimir Riha 2012-04-03 07:46:23 UTC
NB 7.1.2 verified


Product Version: NetBeans IDE 7.1.2 (Build 201203312205)
Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02
System: Linux version 3.0.0-17-generic-pae running on i386; UTF-8; en_US (nb)