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 21022

Summary: Working with RMI crash JVM
Product: ide Reporter: pknakal <pknakal>
Component: Internal ServerAssignee: _ rkubacki <rkubacki>
Status: CLOSED WONTFIX    
Severity: blocker CC: issues, mbalin, non_migrated_user
Priority: P2    
Version: -FFJ-   
Hardware: PC   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 19717    
Bug Blocks:    
Attachments: HotSpot error file
examples
Stacktrace of internal RMI registry waiting on tomcat op
RMI registry standalone process
The last thread dump.
JVM crash report

Description pknakal 2002-02-28 17:23:17 UTC
[FFJ4.0 EE ea, JDK1.4_b92, Linux RH 7.1]

Start FFJ and create new RMI activatable and unicast servers (of course you have
to start the rmid_wrapper and local RMI registry). Execute the created servers
(the easiest are in the attached examples.tar file).
In the Runtime workspace there are still running both servers (they are
correctly displayed in the RMI registry and in the RMI Activatable Browser).
Now terminate servers in the Runtime tab and now there are possibilities:
1) JVM gone with HotSpot error
2) nothink happend, but next execution of the servers works as see 1)

The HotSpot error is attached in the next file. The HotSpot error is the same as
for bug 4623152 in bugtraq.

On Solaris this not crash JVM, but executed servers are not wisible in the RMI
registry.
Comment 1 pknakal 2002-02-28 17:24:23 UTC
Created attachment 4869 [details]
HotSpot error file
Comment 2 pknakal 2002-02-28 17:25:31 UTC
Created attachment 4870 [details]
examples
Comment 3 Tomas Zezula 2002-03-06 18:30:28 UTC
The crash of JDK 1.4 on Solaris is caused by JDK bug, on JDK 1.3 the
crash does not occure.
Comment 4 Tomas Zezula 2002-03-07 13:35:47 UTC
Created attachment 4982 [details]
Stacktrace of internal RMI registry waiting on tomcat op
Comment 5 Tomas Zezula 2002-03-07 13:36:42 UTC
Created attachment 4983 [details]
RMI registry standalone process
Comment 6 Tomas Zezula 2002-03-07 13:39:33 UTC
The bug can be splitted into two bugs, first is the crash of JVM (see
P. Knakal attachment id= 4869) problematic Thread is tomcat Thread,
but the  crash is SIGSEGV (Segmentation violation), so JDK not
NetBeans bug.
The seccond is the deadlock of IDE, the deadlock is caused by waiting
on  socket while the URLClassLoader performs HTTP GET operation, there
is no answer from tomcat and also the socket is not closed or
shutdowned by tomcat, so the thread is hanged for standard TCP stay
time (if no setsockopt is used 2 hours). This can be seen from
attached thread dumps (4982,4983) one represents Internal RMI registry
(running
inside in IDE) second represents deadlock of extenral rmiregistry
process. Both stack trace are the same.

RMI WORKARROND:
   In RMI executor set rmi.server.codebase to URL of filesystem where
the RMI application is located. e.g file:///home/me/nbdev/sampledir/.
The URL must end with slash. In this case no tomcat is used.

Possible RMI improvements:

    Do not perform ClassElement.forClass in createNode, this operation
does the following code inside the clazz module:
      ((Class) c)).findResource
("/"+((Class)c)).getName().replace('.','/')+".class")
This yields to URLClassLoader to load the resource of class, this
functionality should be done in special RequestProcessor.
Also there is no reason why to read Class and then to read again its
resource, better way is to use dirrectly the resource.
Comment 7 Tomas Zezula 2002-03-07 13:41:08 UTC
According to my testing the bug can be reproduced only on JDK1.4 on
Solaris operating system.
Comment 8 _ rkubacki 2002-03-07 16:52:35 UTC
Reassigned to internal httpserver module. 

We can't fix JVM crashing. It has to be fixed by JDK team.

Regarding the second problem we need to check if it is common that
internal HTTP server hangs during request dispatching earlier than
communication is established. Now it is reported as a platform
dependent problem that is not 100% reproducible.
Comment 9 _ rkubacki 2002-03-12 09:57:10 UTC
Lowering priority. Most likely it is a bug in JDK.
Comment 10 _ rkubacki 2002-03-13 08:12:24 UTC
Could we try patch attached to bug #19717 that is related to the same
JVM bug?
Comment 11 _ rkubacki 2002-03-15 15:54:03 UTC
According to discussion with Tomas Zezula this won't be fixed in the
IDE. The problem will be documented and workaround exists.
Comment 12 pknakal 2002-04-26 14:07:40 UTC
I've check it in the dev build 3.4 & JDK1.4.1_b10

This freeze the IDE. That's good that the workaround exist, but RMI
module is unusable.
Comment 13 pknakal 2002-04-26 14:09:32 UTC
Created attachment 5571 [details]
The last thread dump.
Comment 14 _ rkubacki 2002-04-26 14:58:49 UTC
This bug was related to JVM bug 4623152. This one is still not fixed
and it seems that workarounds in 19717 doesn't help us. Can you try
the -Xnoclassgc switch. 

Tomas: is there any possibility to implement any workaround on RMI
module side? What are the URLs you are trying to load? Maybe that
newly introduced URLMapper class in openAPI can help us here to find
URL that will use file: or jar: protocol for given fileobject.
Comment 15 Martin Ryzl 2002-04-26 16:13:16 UTC
I don't think this would solve the problem - rmi can be exported on
one machine and the browser may run on another. Using of http protocol
is essential.
Comment 16 _ rkubacki 2002-04-30 09:21:49 UTC
Created attachment 5600 [details]
JVM crash report
Comment 17 _ rkubacki 2002-04-30 09:59:02 UTC
Reproduced JVM crashes with NB dev build (Apr 30), Linux (redhat 7.1),
jdk1.4.1-b10 and jdk1.4.0-b92.

I created new RMI activatable and unicast servers execute them,
stopped and executed again and JVM always crashed (error file is
attached). So I can't evaluate the freezing behaviour.

Comment 18 Petr Jiricka 2002-05-02 07:55:27 UTC
Waived for Forte for Java 4.0
Comment 19 _ rkubacki 2002-05-02 13:17:35 UTC
Step for reproducing (NB3.4 dev build, Linux RH7.1, JDK 1.4.0-b72 or
JDK1.4.1-b10). 
- start the rmid_wrapper on port 1098 (from bin directory of the IDE
instalation)
- start the IDE
- start local RMI registry (in Explorer window go to Runtime tab and
select Local registry from context menu on RMI registry node
- create RMI classes. Either use attached examples.tar (extract it
into sampledir that is mounted in explorer) or create new Activatable
and Unicast RMI from templates (you need also create some interface
that will be implemented by these objects). Compile them (you may need
to write some implementation of the method specified by RMI interface).
- execute both servers 
- check that RMI registry and RMI activatable browser show the servers.
- stop runing proces(es) in execution window
- restart RMI registry
- execute both servers again

After this IDE crashes in my environment. Another possibility is that
it will be blocked with possible problem in thread:

	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:343)
	- locked <0x4659ce48> (a java.net.PlainSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:439)
	at java.net.ServerSocket.accept(ServerSocket.java:410)
	at
org.apache.tomcat.service.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:286)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:402)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
	at java.lang.Thread.run(Thread.java:536)

If this doesn't reveal the problem repeated execution of RMI objects
and RMI registry may help.
Comment 20 Petr Jiricka 2002-05-07 08:59:10 UTC
The waiver was approved.
Comment 21 _ rkubacki 2002-05-28 18:03:12 UTC
JDK bug is reported to JDK team, workaround is documented.
http://developer.java.sun.com/developer/bugParade/bugs/4680160.html
Comment 22 Quality Engineering 2003-07-01 09:34:11 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 23 Quality Engineering 2003-07-01 09:34:54 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.