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 33062 - Deadlock during saving document
Summary: Deadlock during saving document
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: RANDOM, THREAD
: 30309 32584 33556 37594 39389 (view as bug list)
Depends on: 40951
Blocks:
  Show dependency tree
 
Reported: 2003-04-18 17:02 UTC by Martin Roskanin
Modified: 2008-12-22 18:56 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Deadlock full thread dump (13.47 KB, text/plain)
2003-04-18 17:04 UTC, Martin Roskanin
Details
BadLocationException (1.31 KB, text/plain)
2003-04-22 13:41 UTC, Martin Roskanin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Roskanin 2003-04-18 17:02:55 UTC
Reproduction:
1. Create a new file
2. Add a new method that returns i.e. String
public String foo(){
return "";
}
3. Place cursor inside the method and invoke
editor context menu

4. Invoke Tools/Correct JavaDoc and save the
document immediately.
Comment 1 Martin Roskanin 2003-04-18 17:04:31 UTC
Created attachment 10032 [details]
Deadlock full thread dump
Comment 2 Martin Roskanin 2003-04-18 17:12:59 UTC
Feel free to change the priority to P2 in accordance with 
http://qa.netbeans.org/processes/bug_priority_guidelines.html
The reproductions steps are not very common
Comment 3 Martin Roskanin 2003-04-18 18:00:30 UTC
NB 3.5 beta, build 200304172350, jdk1.4.1

Now I have reproduced datalost using these repro steps. The document
has not been saved complete, several lines from the end of the file
was lost. Undo doesn't work. 
Comment 4 David Konecny 2003-04-22 12:34:41 UTC
From the thread dump it looks that two save actions were started on
the document. Strange, but it is not cause of this issue.

I've already seen this deadlock, but was never able to reproduce it.
I'm sure there is a problem and it is there for some time (definitely
>4 months).

I'm not able to reproduce this test case as well. It works fine on my
computer. I'm going to analyze source code. Lowering to P2.
Comment 5 Martin Roskanin 2003-04-22 13:39:10 UTC
It is strange that after "Correct javadoc" action (following by save
action), the document is reloaded sometimes. Sometimes the
confirmation dialog appears with the question "File x.y was modified
externally. Reload it?" After pressing "Yes" the document is empty,
all data are lost. The exception is thrown, I'll attach it. Now, I am
not able to reproduce the deadlock such easy on the current build. 
Anyway, I think, that reproduction steps are very, very uncommon. The
priority evaluation depends only on the threads analyzing. David, if
you think, that problem cannot occur during normal circumstances, feel
free to downgrade the priority.
Comment 6 Martin Roskanin 2003-04-22 13:41:39 UTC
Created attachment 10065 [details]
BadLocationException
Comment 7 David Konecny 2003-04-22 15:01:02 UTC
*** Issue 30309 has been marked as a duplicate of this issue. ***
Comment 8 David Konecny 2003-04-22 15:39:34 UTC
I spent whole afternoon playing with this and could not reproduce it.

Problem background: Document has Lines and Line has PositionRefs
(reference to position in document) and PositionRef has Kind which can
be PositionKind, OffsetKind, OutKind or LineKind. The Kind of the
PositionRef *dynamically changes* according to document changes like
document was opened in editor or document was closed.

Somewhere there is synchronization problem causing that some positions
are not correctly converted to the proper Kind (ie. OffsetKind was not
converted properly). As a result when document is saved and Lines are
updated the line with incorrect Kind starts opening of the document.

Without having reproducible test case on which I could test a fix I do
not dare to touch the code. QA, could you please try to reproduce it?
So far this problem appeared quite rarely.

If we do not find a testcase I propose to lower priority to P3 and
TM=4.0. Hopefully will be killed by threading redesign of IDE.
Comment 9 Marian Mirilovic 2003-04-23 15:48:14 UTC
It seems like it's unreproducible. Nobody can reproduce it (me, David,
... ) . I propose to not fix them for 3.5. 

David, please change milestone and if you think it's really hard to
reproduce, decrease priority to P3. Thanks in advance.
Comment 10 David Konecny 2003-04-23 15:54:41 UTC
Feel free to increase priority if it appears again. If reproducible
case is found increase to P1!
Comment 11 David Konecny 2003-04-29 09:55:11 UTC
*** Issue 32584 has been marked as a duplicate of this issue. ***
Comment 12 David Konecny 2003-04-30 09:28:44 UTC
"future" TM is more appropriate. Without reproducible case I cannot
promise to fix this for next version.
Comment 13 David Konecny 2003-05-27 08:41:52 UTC
*** Issue 33556 has been marked as a duplicate of this issue. ***
Comment 14 David Konecny 2003-12-01 11:10:10 UTC
Petr is responsible for the text package now.
Comment 15 Petr Nejedly 2003-12-01 14:35:37 UTC
*** Issue 37594 has been marked as a duplicate of this issue. ***
Comment 16 Petr Nejedly 2003-12-01 14:51:51 UTC
Maybe better reproducible as described in issue 37594
It may coincide somehow with background reload process.
Comment 17 Petr Nejedly 2004-02-18 13:02:15 UTC
*** Issue 39389 has been marked as a duplicate of this issue. ***
Comment 18 Petr Nejedly 2004-03-19 22:17:46 UTC
Should be prevented by fixing issue 40766
Comment 19 Marian Mirilovic 2004-06-30 10:04:52 UTC
verified in [nb_dev](200406291800)