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 124113 - Deadlock while editing a .php file
Summary: Deadlock while editing a .php file
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-17 12:45 UTC by Tim Lebedkov
Modified: 2008-03-12 11:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack traces (14.88 KB, text/plain)
2007-12-17 12:46 UTC, Tim Lebedkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Lebedkov 2007-12-17 12:45:45 UTC
see attached file
Comment 1 Tim Lebedkov 2007-12-17 12:46:09 UTC
Created attachment 54316 [details]
Stack traces
Comment 2 Denis Anisimov 2007-12-17 13:08:21 UTC
It seems two thread : GSF Source Worker Thread ( compilation task ) 
and AWT-EventQueue-1 ( formatting task ) tries to access on Swing Document resource and 
PHP model simultaneously but is different order.
GSF call PHP model for sync and inside sync one calls lock on Swing Document.
But it seems foramtter locks OM having lock on Swing Document.

So we need to resolve this dead lock. Possibly sync() should lock Swing document firstly 
and perform all his work under this lock. But we cannot avoid situation when someone 
call Swing document lock inside PHP Model lock. So this situation need more deep 
investigation.
Comment 3 Denis Anisimov 2007-12-17 13:59:15 UTC
I don't see any other solution for problem except placing "sync" inside "render" method of Swing
Document. As I already said this can still lead to deadlock when one perform locked reading or writing in Document
OM lock holding. But this will be a problem of OM client. 
I place this warning into JavaDoc for OM locks method.

There is one more simple solution for this problem : remove OM lock at all and base only on Swing Document lock.
But this is not good decision from my point of view.
Comment 4 Denis Anisimov 2007-12-19 08:43:14 UTC
Please provide steps to reproduce.
I have just only my vision on this issue and provide fix for this.
But I'm not sure that the essence of this deadlock is exactly what I'm thinking.
Comment 5 Denis Anisimov 2007-12-19 08:44:34 UTC
    Checking in php/srcmodel/src/org/netbeans/modules/php/model/PhpModel.java;
    /cvs/scripting/php/srcmodel/src/org/netbeans/modules/php/model/PhpModel.java,v  <--  PhpModel.java
    new revision: 1.9; previous revision: 1.8
    done
    Checking in php/srcmodel/src/org/netbeans/modules/php/model/impl/PhpModelImpl.java;
    /cvs/scripting/php/srcmodel/src/org/netbeans/modules/php/model/impl/PhpModelImpl.java,v  <--  PhpModelImpl.java
    new revision: 1.16; previous revision: 1.15
    done
Comment 6 Tim Lebedkov 2008-03-12 11:13:32 UTC
I am sorry, but I cannot reproduce the issue too.