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 22270

Summary: deadlock on startup of IDE, due to openfile server
Product: utilities Reporter: Roger Blumer <rblumer>
Component: CodeAssignee: issues@utilities <issues>
Status: CLOSED FIXED    
Severity: blocker CC: non_migrated_user, pnejedly
Priority: P2    
Version: -FFJ-   
Hardware: PC   
OS: Windows 3.1/NT   
Issue Type: DEFECT Exception Reporter:
Attachments: Full thread dump

Description Roger Blumer 2002-04-10 00:56:05 UTC
I've hit this deadlock twice now, while starting up the IDE.  
It may be due to having a node (EJBmodule? or its directory) selected in the Explorer 
on shutdown, and that file has been deleted before the startup.

Occurred on FFJ build 020403, on a 2-cpu 800Mhz PC.

It seems to have something to do with the openfile server.

Partial dump:

"OpenFile Server" prio=5 tid=0xedcbbe0 nid=0x190 runnable [0xefbf000..0xe
fbfdc8]
        at org.openide.util.SharedClassObject.getProperty(SharedClassObject.java:285)
        at org.openide.options.SystemOption.firePropertyChange(SystemOption.java:80)
        at org.netbeans.modules.openfile.Settings.setActualPort0(Settings.java:223)
        at org.netbeans.modules.openfile.Server.initSocket(Server.java:108)
        at org.netbeans.modules.openfile.Server.run(Server.java:118)
        at java.lang.Thread.run(Thread.java:484)
.........

"main" prio=5 tid=0x990f20 nid=0x1ec runnable [0xb5df000..0xb5dfdc8]
        at org.netbeans.modules.openfile.Settings.setPort(Settings.java:176)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.openide.options.SystemOption.readExternal(SystemOption.java:264)
        at org.netbeans.modules.openfile.Settings.readExternal(Settings.java:146)
.....
Comment 1 Roger Blumer 2002-04-10 00:57:52 UTC
Created attachment 5349 [details]
Full thread dump
Comment 2 _ lkramolis 2002-04-22 11:38:11 UTC
After discussion with Petr Nejedly (thanks) we localized this deadlock:

* "OpenFile Server"
  1) openfile.Settings.setActualPort0(...) -- synchronized (this)
  2) SharedClassObject.getProperty(...) -- synchronized (getLock())

* "main"
  1) SystemOption.readExternal(...) -- synchronized (getLock())
  2) openfile.Settings.setPort(...) -- synchronized (this)
---

Petr proposed to cover Settings.readExternal body by 'synchronized
(this)' block what should sort locks.
---

I would like to mark it as "ORION_WAIVER" and do not fix it in Orion
branch because:

- it is hard to reproduce it, it is race-condition -- it depends on
deserialization time.

- it occurs occasionally and I am not sure if new synchronized section
will not bring any problems. It could be too risky to fix it without
long testing.
---

Proposed fix integrated in main trunk.
Comment 3 Jan Chalupa 2002-04-22 12:04:39 UTC
Requesting a waiver for FFJ 4.0 (Orion) - FFJ40_WAV. The bug is not
easily reproducible and the fix is potentially risky.
Comment 4 Jan Chalupa 2002-05-02 10:45:56 UTC
Waiver approved.
Comment 5 _ lkramolis 2002-05-03 07:40:17 UTC
Already fixed in main trunk.
Comment 6 pfelenda 2003-03-03 15:06:01 UTC
Verified in dev 200303030100.
Comment 7 Quality Engineering 2003-07-01 15:31:07 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.