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 41082 - Deadlock after disabling and enabling module
Summary: Deadlock after disabling and enabling module
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker (vote)
Assignee: David Konecny
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2004-03-17 16:34 UTC by L Martinek
Modified: 2008-12-22 23:48 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (98.12 KB, text/plain)
2004-03-17 16:34 UTC, L Martinek
Details
Thread dump with proposed fix (100.26 KB, text/plain)
2004-03-22 12:23 UTC, Martin Grebac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description L Martinek 2004-03-17 16:34:05 UTC
[NetBeans 3.6 RC1, JDK 1.4.2_03]

Steps to reproduce:
1. switch to Runtime tab
2. open Options window, select IDE Configuration
-> System -> Modules -> Web -> HTTP Server
3. Disable HTTP Server, wait until HTTP Server
node in Rutime disappears.
4. Enable HTTP Server, wait until HTTP Server node
appears.
5. Disable HTTP Server. Now HTTP Server node never
disappears. 
When you click on it, deadlock occurs. Actually
you needn't to click on HTTP Server node, it's
enought to activate Runtime window or just move
mouse over the node. 
IDE eats 100% of CPU.
Comment 1 L Martinek 2004-03-17 16:34:45 UTC
Created attachment 14020 [details]
Thread dump
Comment 2 L Martinek 2004-03-18 11:15:02 UTC
If you restart IDE after disabling and enabling module, it 'resets'
the issue so you can disable and enable it once after restart without
problem, but of course next disabling cause deadlock again.

Resume: After start of IDE you can safely once disable and enable
module. Next disable cause deadlock.
Comment 3 Martin Grebac 2004-03-18 14:33:15 UTC
According to the stacktrace, this doesn't seem to be httpserver
problem, but a problem in openide, as it seems to get to some cycle
loop in URLMapper.
Comment 4 David Konecny 2004-03-19 09:30:21 UTC
I'm working on this. 
Comment 5 David Konecny 2004-03-19 10:56:02 UTC
Yarda, could you look at this. It is lookup or lookup.vs.datasystems
issue.

Couple of observations:
* httpserver registers its URLMapper in /Services subfolder of SFS.
Therefore disabling the module uninstall it and changes default lookup.
* in NetBeans 36beta (build 200402042050) this seems to work fine so
it looks like regression which happened recently.

If I had at hand daily builds of last month I would try to find when
this regression happened. That would help a lot. Is anybody at QA
willing to do that? I can do that myself on Monday when I'm in office.

Yarda, if the registration was moved to META-INF would it helped? (It
should be there anyway.) I guess it should because that would
eliminate FolderLookup usage. This could be quite safe fix at the
httpserver side.

This is serious issue but IMO not stopper for NB36. It should happen
only for modules providing URLMapper in /Services folder, which at the
moment in standard distribution is httpserver and javadoc module. And
anyway, how typical it is that users disable/enable/disable module in
one IDE session? I would record it just in release notes.
Comment 6 Jaroslav Tulach 2004-03-20 08:27:45 UTC
Registration in META-INF is of course more flexible and should be used
if one does not want the user to modify the content of the lookup in
options.

I do not see the deadlock. It is more infinite lookup. URLMapper
mapper is asked for something, it needs all registered mappers and
while creating the mappers, URLMapper is asked again and so on. 

As there were pretty significant changes between beta and release
(rev. 1.22) in URLMapper I suggest to include Radek in the loop.
Comment 7 David Konecny 2004-03-21 19:22:10 UTC
Yes, it is infinite loop.

No, Radek could not cause it because his changes were related to URL
encoding semantics only.

Both code in URLMapper which is looking up registered URLMapper
implementations and code in NBClassLoader which is calling URLMapper
has been sitting there for some time without problem.

So my guess is that there was a change in lookup which caused this.
The problem happens after disabling httpserver module. First
suspicious thing is that disabling module should result in removal of
file from Services folder and there should not be any need for new
instance creation. And definitely it should not affect lookup of
URLMapper.class. Any idea? I was not following 36 relase much so I do
not know if there were any related changes.
Comment 8 Jaroslav Tulach 2004-03-22 08:17:07 UTC
There is no change in org.openide.util or org.openide.loaders related
to Lookup as can be verified by cvs diff -r
release36beta-BLD00402042050 -r release36

As there is no clear indication where the regression is and there
exist simple fix - use META-INF/services instead of /Services folder,
which is especially dangerous for URLMappers, I believe that if we
want to address this issue for 3.6 we should do it in httpserver module.
Comment 9 Martin Grebac 2004-03-22 10:54:10 UTC
Well, if you transferred this one back to httpserver, then I'd say you
should file a separate issue for javadoc module as well.

I'll fix it in trunk and request a waiver for 3.6 as this happens in a
very rare case.
Comment 10 Martin Grebac 2004-03-22 12:21:59 UTC
I tried the proposed fix - it doesn't solve the problem - loop is stil
there - I'll attach the new thread dump.
Comment 11 Martin Grebac 2004-03-22 12:23:27 UTC
Created attachment 14074 [details]
Thread dump with proposed fix
Comment 12 David Konecny 2004-03-22 22:43:01 UTC
I tried couple of builds and NetBeansIDE-dev-200402221900 still works
but NetBeansIDE-dev-200402241900 already throws StackOverflowError.
Sometimes I has to repeat disable/enable cycle twice or thrice. So I
tried to replace lib\openide-loaders.jar in newer build with the older
one and problem seems to disappear. And so then I looked at commit
logger for openide and only possibly relevant change which could cause
this is:

<http://openide.netbeans.org/servlets/ReadMsg?msgId=701197&listName=cvs>

by anebuzelsky. Tonda, could you please try the same what I did and
confirm that it is reproducible for somebody else then me? Could you
try to revert your change, create patch and try it with NB36 RC1
whether it was really caused by this change. Thx.
Comment 13 Antonin Nebuzelsky 2004-03-23 09:14:46 UTC
I will have a look at this and let you know.
Comment 14 Antonin Nebuzelsky 2004-03-23 11:47:40 UTC
I verified that the problem was introduced between 02221900 and 
02241900. My investigation and verification shows that the problem 
was not caused by my integration, but by an integration to 
XMLDataObject:

http://openide.netbeans.org/servlets/ReadMsg?msgId=701831&listName=cvs

Radime, it was your change.
Comment 15 David Konecny 2004-03-23 16:21:54 UTC
Jesse, just told me that it is fixed in trunk. I tried it and it is
working. I suggest closing it as FIXED.
Comment 16 _ rkubacki 2004-03-24 08:01:10 UTC
From the stacktraces that I see it looks to me that the problem is in
URLMapper and my integration only revealed it. I agree w/ David that
we can close it beacause it works in trunk. I don't want to rollback
the change for 3.6 until there is thorough analysis of what is really
wrong.
Comment 17 David Konecny 2004-03-24 09:08:54 UTC
.
Comment 18 David Konecny 2004-03-24 14:59:18 UTC
Waiver Request:

Description:
This problem occurs only when user disable/enable/disable httpserver
module. If user does that the IDE goes into infinitive loop which
looks like deadlock although it should eventually end with
StackOverflow exception. The could happen also for
disable/enable/disable of Javadoc module because bug is related to
URLMapper which is registered by both these modules. No other modules
should cause it.

Justification:
This is very uncommon user operation.

Workaround:
Restart IDE before second disable action.

Fix:
In trunk this does not happen because involved code was changed by
buildsys merge/cleanup.

I propose to just mention in Release Notes.
Comment 19 Jan Chalupa 2004-03-26 15:23:28 UTC
Waiver approved.
Comment 20 L Martinek 2004-09-30 15:04:23 UTC
forgot to mark as verified