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 122907 - Editor locked up during code completion autopopup.
Summary: Editor locked up during code completion autopopup.
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 6.x
Hardware: Sun Solaris
: P1 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
: 123220 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-27 22:29 UTC by _ pcw
Modified: 2009-05-18 10:47 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace (19.04 KB, text/plain)
2007-11-27 22:30 UTC, _ pcw
Details
example file (19.32 KB, text/plain)
2007-11-27 22:52 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2007-11-27 22:29:45 UTC
I was editing html file and while adding a closing tag, code completion auto-popped up and the editor locked up solid. 
JVM does not report any deadlocks, but AWT thread appears to be waiting indefinitely on a lock (as is another background
thread).

This might be a manifestation of issue 110074, as it is on Solaris/JDK 1.6.

However, this is using JDK 1.6.0_03, which was supposed to fix 110074.
Comment 1 _ pcw 2007-11-27 22:30:14 UTC
Created attachment 53575 [details]
stack trace
Comment 2 _ pcw 2007-11-27 22:31:17 UTC
messages.log header:

-------------------------------------------------------------------------------
>Log Session: Monday, November 26, 2007 5:18:20 PM PST
>System Info:
  Product Version         = NetBeans IDE Dev (Build 071126)
  Operating System        = SunOS version 5.10 running on x86
  Java; VM; Vendor        = 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05; Sun Microsystems Inc.
  Java Home               = /usr/jdk/instances/jdk1.6.0_03/jre
  System Locale; Encoding = en (nb); ISO646-US
  Home Directory          = /home/peterw99
  Current Directory       = /space/peterw/nb6/nbbuild/netbeans/bin
  User Directory          = /space/peterw/userdir/nb6_jdk6_dev_run
  Installation            = /space/peterw/nb6/nbbuild/netbeans/nb6.0
                            /space/peterw/nb6/nbbuild/netbeans/ide8
                            /space/peterw/nb6/nbbuild/netbeans/java1
                            /space/peterw/nb6/nbbuild/netbeans/apisupport1
                            /space/peterw/nb6/nbbuild/netbeans/enterprise4
                            /space/peterw/nb6/nbbuild/netbeans/profiler2
                            /space/peterw/nb6/nbbuild/netbeans/harness
                            /space/peterw/nb6/nbbuild/netbeans/extra
                            /space/peterw/nb6/nbbuild/netbeans/platform7
  Boot & Ext. Classpath   =
/usr/jdk/instances/jdk1.6.0_03/jre/lib/resources.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/rt.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/sunrsasign.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/jsse.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/jce.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/charsets.jar:/usr/jdk/instances/jdk1.6.0_03/jre/classes:/usr/jdk/instances/jdk1.6.0_03/jre/lib/ext/sunjce_provider.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/ext/sunpkcs11.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/ext/dnsns.jar:/usr/jdk/instances/jdk1.6.0_03/jre/lib/ext/localedata.jar:/usr/jdk/packages/lib/ext/jhall.jar
  Application Classpath   =
/space/peterw/nb6/nbbuild/netbeans/platform7/lib/boot.jar:/space/peterw/nb6/nbbuild/netbeans/platform7/lib/org-openide-modules.jar:/space/peterw/nb6/nbbuild/netbeans/platform7/lib/org-openide-util.jar:/usr/jdk/jdk1.6.0/lib/dt.jar:/usr/jdk/jdk1.6.0/lib/tools.jar
  Startup Classpath       =
/space/peterw/nb6/nbbuild/netbeans/platform7/core/org-openide-filesystems.jar:/space/peterw/nb6/nbbuild/netbeans/platform7/core/core.jar:/space/peterw/nb6/nbbuild/netbeans/nb6.0/core/org-netbeans-upgrader.jar:/space/peterw/nb6/nbbuild/netbeans/nb6.0/core/locale/core_nb.jar
Comment 3 _ pcw 2007-11-27 22:37:07 UTC
Actually, maybe this isn't 110074 after all.  One of the CPU's is pegged at 100% indicating that the thread that owns
whatever lock the AWT thread is waiting on is in an infinite or near infinite loop.

The following thread stack (from the trace) might be the culprit - I was able to get 2 stack dumps before the console
also locked up and this thread is definitely running (top of stack was at line 488 and 489 in the two dumps).

"Default RequestProcessor" daemon prio=1 tid=0x093d3800 nid=0xe2 runnable [0xcd5ff000..0xcd5ffaf0]
   java.lang.Thread.State: RUNNABLE
        at org.netbeans.editor.ext.html.HTMLSyntaxSupport.getElementChain(HTMLSyntaxSupport.java:488)
        at org.netbeans.editor.ext.html.HTMLSyntaxSupport.getPreviousElement(HTMLSyntaxSupport.java:378)
        at org.netbeans.editor.ext.html.SyntaxElement.getPrevious(SyntaxElement.java:117)
        at org.netbeans.editor.ext.html.HTMLSyntaxSupport.getPossibleEndTags(HTMLSyntaxSupport.java:822)
        at org.netbeans.editor.ext.html.HTMLCompletionQuery.query(HTMLCompletionQuery.java:257)
        at org.netbeans.modules.editor.html.HTMLCompletionProvider$Query.doQuery(HTMLCompletionProvider.java:104)
        at org.netbeans.modules.editor.html.HTMLCompletionProvider$AbstractQuery.query(HTMLCompletionProvider.java:154)
        at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Comment 4 _ pcw 2007-11-27 22:52:26 UTC
Not 110074 - I restarted with -J-XX:-UseThreadPriorities -J-XX:-UseBiasedLocking and can reproduce the infinite loop by
doing the following edits in the attached HTML file.

Open secure-ejb.html in the editor (attached).

On line 35, add '<s>' before "no longer", then add '<s' after "no longer" and hit ctrl-escape.  Editor freezes and cpu
(or 1 core) will be pegged.
Comment 5 _ pcw 2007-11-27 22:52:54 UTC
Created attachment 53578 [details]
example file
Comment 6 _ pcw 2007-11-27 22:54:03 UTC
P1 due to dataloss - have to kill ide from outside losing all unsaved changes.
Comment 7 Dusan Balek 2007-11-28 08:38:40 UTC
Seems like an infinite loop in HTMLSyntaxSupport.getElementChain(). Reassigning.
Comment 8 Petr Jiricka 2007-11-28 10:25:45 UTC
Peter/Marek, 

does this only affect the 6.1 trunk build, or is there a possibility that this is also manifested in 6.0 FCS? Thanks.
Comment 9 Jindrich Sedek 2007-11-28 10:53:30 UTC
I can reproduce this in trunk but it I'm not able to reproduce is 6.0FCS. It happens in the situation while cc is asked
to add ending ">". 

It doesn't happen for example in situation of 
--------------
<h1> ... </| 
-------------
but it happens in situation of 
---------------
<h1> ... </h1|
--------------
Comment 10 Petr Blaha 2007-11-28 11:01:51 UTC
I'm changing version to dev according to jsedek's comment.
Comment 11 Marek Fukala 2007-11-28 13:46:11 UTC
I confirm the problem is reproducible on trunk, not on 6.0. Probably caused by some refactoring done after the branch
point. Will be fixed (the errorneous code removed) by reimplementing the html parsing support. I'll add a temporary
simple hotfix.
Comment 12 Marek Fukala 2007-12-11 15:02:58 UTC
fixed

Checking in HTMLSyntaxSupport.java;
/cvs/html/editor/lib/src/org/netbeans/editor/ext/html/HTMLSyntaxSupport.java,v  <--  HTMLSyntaxSupport.java
new revision: 1.41; previous revision: 1.40
done
Comment 13 Marek Fukala 2008-02-10 12:35:51 UTC
*** Issue 123220 has been marked as a duplicate of this issue. ***