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 84704

Summary: Deadlock when inspecting variables in Ant debugger session
Product: projects Reporter: Jiri Kovalsky <jkovalsky>
Component: AntAssignee: Jesse Glick <jglick>
Status: VERIFIED FIXED    
Severity: blocker Keywords: THREAD
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 84591    
Attachments: Full thread dump containing the detected deadlock.
Screenshot of my IDE when it freezed.

Description Jiri Kovalsky 2006-09-12 14:52:04 UTC
Development build #200609101800 of NetBeans 6.0
Windows XP, JDK 1.6.0 RC build #94

Description:
============
I was not doing something special. I was stepping in targets when I decided to
inspect values of some watches. When I created new watch IDE freezed. I am
attaching a full thread dump and screenshot of the IDE. I have seen the problem
twice in a row thus I think it will not be hard to reproduce.

What I did:
===========
1. Created AnagramGame sample project from template.
2. Invoked "Debug Target|run" on "AnagramGame1|build.xml" node in Files view.
3. Used F7 key until I got to line 36 in build-impl.xml.
4. Toggled breakpoint at previous line.
5. Created new watch "nbproject/private/config.properties".
6. The "tree.getComponent(2)" watch was some leftover from previous work.
7. Tried to switch to "Breakpoints" tab but it was not possible.
Comment 1 Jiri Kovalsky 2006-09-12 14:52:36 UTC
Created attachment 33827 [details]
Full thread dump containing the detected deadlock.
Comment 2 Jiri Kovalsky 2006-09-12 14:53:21 UTC
Created attachment 33828 [details]
Screenshot of my IDE when it freezed.
Comment 3 Jiri Kovalsky 2006-09-12 14:54:57 UTC
Please note that this is a Milestone 3 build showstopper.
Comment 4 Martin Entlicher 2006-09-12 15:29:51 UTC
This is a bug in ant debugger. Working on a fix...
Comment 5 Martin Entlicher 2006-09-12 17:08:42 UTC
This deadlock is caused by a tooltip annotation. But while I'm investigating
this more deeply, it looks like evaluation in Watches is enough. The evaluation
was never completed for me.

There are two locks being acquired in different order, one in NbBuildLogger and
the second in AntDebugger. We need to assure that NbBuildLogger will not be
called under our lock.

This looks like a conceptual problem. Did this ever worked? The same problem
seems to be in NetBeans 5.5.
Comment 6 Jesse Glick 2006-09-12 18:37:15 UTC
The issue is that the AntLogger SPI was never designed for something like
AntEvent.evaluate to be called from a different thread from the one with the
logger callback. While AntDebugger could probably arrange to always evaluate
tooltips from the same thread, this would be cumbersome. Anyway it seems that
the way the Ant debugger works, it would prevent other non-debugged builds from
running. So I will try to remove some unnecessary synchronization in NbBuildLogger.
Comment 7 Jesse Glick 2006-09-12 19:42:57 UTC
Checking in test/unit/src/org/apache/tools/ant/module/spi/AntLoggerTest.java;
/shared/data/ccvs/repository/ant/test/unit/src/org/apache/tools/ant/module/spi/AntLoggerTest.java,v
 <--  AntLoggerTest.java
new revision: 1.16; previous revision: 1.15
done
Checking in src-bridge/org/apache/tools/ant/module/bridge/impl/NbBuildLogger.java;
/shared/data/ccvs/repository/ant/src-bridge/org/apache/tools/ant/module/bridge/impl/NbBuildLogger.java,v
 <--  NbBuildLogger.java
new revision: 1.29; previous revision: 1.28
done
Comment 8 Jiri Kovalsky 2006-09-15 09:28:10 UTC
This seems to be fixed indeed in the latest development build #200609141800 of
NetBeans 6.0.