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.
Created attachment 154582 [details] jstack for deadlock See attachment for jstack. Clearly deadlocked in the AWT thread. Something on another thread has held the lock that the AWT thread ought to be able to acquire fast. Can NOT reproduce at will, but HAS reproduced 3 times now. Not sure if this is a spellchecker bug, but that appears in the non-AWT-thread stack.
Deadlock, upping the priority. The associated messages.log might be useful. Sometimes an exception can put things into a bad state. "ViewHierarchy-Region-Rebuilding", while holding the document readlock, is stuck trying to get its "PriorityMutex" The AWT-EQ thread is trying to get the document writelock through the DefaultKeyTypedAction. The spellchecker is waiting for the EventQ. osgi is in there.
BTW, this is while editing a "Velocity" file. The reporter has this to say Velocity has a syntax highlighting plugin, but it didn't appear as a file type in the spellchecker preferences, so I unticked plain text (and most other things) in the spellchecker preferences because I have to do work, and netbeans hung up three times today, and restarting it takes about 10 minutes. The implication is that the failure definitely is related to spellchecker.
Can you please attach message.log? I don't know what is your Netbeans version, what plugins you have installed. Messages.log is in user directory, you can find path to user directory in Help/About in Netbeans Menu.
I am sorry there is not enough information to have P1 priority. Spellchecker is waiting for EventQ, but it doesn't hold anything. I would more investigate document holding in AWT-EQ. Are there sources of com.raelity.jvi. available online?
(In reply to Milutin Kristofic from comment #4) > I am sorry there is not enough information to have P1 priority. Right. Without the messages.log from @arren it's hard to say... > Spellchecker > is waiting for EventQ, but it doesn't hold anything. I would more > investigate document holding in AWT-EQ. Are there sources of > com.raelity.jvi. available online? Sure, jVi is a sourceforge project, https://sourceforge.net/projects/jvi/, it has been primarily in maintenance mode for several years. There are several thousands of jVi users and it doesn't really directly use document locking. I'm suspicious of the "Velocity" plugin, or perhaps some strange interaction between it and something else. jVi certainly doesn't take any internal/private locks from the ViewHierarchy code, which is where it is stuck. Notice that ViewHier is the process which is holding the document read-lock causing the deadlock. ViewHier has been involved in lots of deadlocks over the years, I'd have someone familiar with that code take a look.
Created attachment 154661 [details] messages.log messages.log attached as requested. I see a useful exception in there.
Pertinent extract: WARNING [org.netbeans.modules.editor.bracesmatching.MasterMatcher]: Origin offsets out of range, origin = [8464, 8468], caretOffset = 8463, lookahead = 129, searching backwards. Offending BracesMatcher: com.tsi.netbeans.modules.languages.velocity.editor.bracesmatching.VTLBracesMatcher@1e8758fa WARNING [org.openide.filesystems.Ordering]: Not all children in / marked with the position attribute: [org-netbeans-modules-editor-java-JavaBracesMat cher.shadow], but some are: [org-netbeans-modules-editor-bracesmatching-LegacyEssMatcher.instance, org-netbeans-modules-editor-bracesmatching-Default Matcher.instance] WARNING [org.netbeans.modules.editor.bracesmatching.MasterMatcher]: Origin offsets out of range, origin = [8414, 8418], caretOffset = 8413, lookahead = 79, searching backwards. Offending BracesMatcher: com.tsi.netbeans.modules.languages.velocity.editor.bracesmatching.VTLBracesMatcher@24851b1e WARNING [org.netbeans.modules.editor.bracesmatching.MasterMatcher]: Origin offsets out of range, origin = [8414, 8418], caretOffset = 8413, lookahead = 79, searching backwards. Offending BracesMatcher: com.tsi.netbeans.modul es.languages.velocity.editor.bracesmatching.VTLBracesMatcher@195515fc WARNING [org.netbeans.modules.editor.bracesmatching.MasterMatcher]: Origin offsets out of range, origin = [8414, 8418], caretOffset = 8413, lookahead = 79, searching backwards. Offending BracesMatcher: com.tsi.netbeans.modules.languages.velocity.editor.bracesmatching.VTLBracesMatcher@6e2d1cf3 WARNING [org.netbeans.modules.editor.bracesmatching.MasterMatcher]: Origin offsets out of range, origin = [8416, 8420], caretOffset = 8415, lookahead = 81, searching backwards. Offending BracesMatcher: com.tsi.netbeans.modules.languages.velocity.editor.bracesmatching.VTLBracesMatcher@38f1b8dd WARNING [org.netbeans.modules.java.source.parsing.JavacParser]: Javac returned startpos: 5,340 > endpos: -1 WARNING [com.raelity.jvi.core.MagicRedoOriginal]: docRemove ERROR: expectChar len = 12 WARNING [com.raelity.jvi.core.MagicRedoOriginal]: markRedoPosition ERROR: expectChar WARNING [org.netbeans.api.editor.fold.FoldHierarchy]: Fold transaction not committed at unlock SEVERE [global] java.lang.IllegalStateException: No transaction in progress at org.netbeans.modules.editor.fold.FoldHierarchyExecution.clearActiveTransaction(FoldHierarchyExecution.java:668) at org.netbeans.modules.editor.fold.FoldHierarchyTransactionImpl.cancelled(FoldHierarchyTransactionImpl.java:214) at org.netbeans.modules.editor.fold.FoldHierarchyExecution.unlock(FoldHierarchyExecution.java:398) at org.netbeans.api.editor.fold.FoldHierarchy.unlock(FoldHierarchy.java:218) at org.netbeans.editor.CodeFoldingSideBar.getPaintInfo(CodeFoldingSideBar.java:493) at org.netbeans.editor.CodeFoldingSideBar.paintComponent(CodeFoldingSideBar.java:957) at javax.swing.JComponent.paint(JComponent.java:1046) at javax.swing.JComponent.paintChildren(JComponent.java:879)
Actually, this looks pretty suspicious. It seems like the velocity plugin might be breaking some locking rules... INFO [org.netbeans.spi.lexer.MutableTextInput]: !!WARNING!! Missing READ-LOCK when accessing TokenHierarchy: input-source:org.netbeans.modules.editor.NbEditorDocument@480f0609, mimeType='text/x-velocity', kitClass=null, length=402, version=1, file=com.tsi.netbeans.modules.languages.velocity.VTLDataObject@4dd91cb6[/home/shevek/java/sablecc3/sablecc-core/src/main/resources/org/sablecc/experimental/ilexer.vm@c740b43a:4e61afc] java.lang.Exception at org.netbeans.lib.lexer.TokenHierarchyOperation.ensureReadLocked(TokenHierarchyOperation.java:406) at org.netbeans.lib.lexer.TokenHierarchyOperation.tokenSequence(TokenHierarchyOperation.java:431) at org.netbeans.lib.lexer.TokenHierarchyOperation.tokenSequence(TokenHierarchyOperation.java:427) at org.netbeans.lib.lexer.TokenHierarchyOperation.embeddedTokenSequences(TokenHierarchyOperation.java:459) at org.netbeans.api.lexer.TokenHierarchy.embeddedTokenSequences(TokenHierarchy.java:265) at com.tsi.netbeans.modules.languages.velocity.editor.bracesmatching.VTLBracesMatcher.getTokenSequences(VTLBracesMatcher.java:184) at com.tsi.netbeans.modules.languages.velocity.editor.bracesmatching.VTLBracesMatcher.findOrigin(VTLBracesMatcher.java:60) at org.netbeans.modules.editor.bracesmatching.MasterMatcher$Result.findOrigin(MasterMatcher.java:857)
Thank you for finding the locking violation. So how do we get this fixed?
(In reply to arren from comment #9) > Thank you for finding the locking violation. So how do we get this fixed? I would contact the velocity plugin author and ask him to comment on the analysis in this thread.
(In reply to arren from comment #9) > Thank you for finding the locking violation. So how do we get this fixed? I can not really tell if the locking violation caused the editor to freeze, but I fixed it in version 2.2.5
@arren Did wjaeger's change fix your problem?