Bug 221422 - netbeans deadlock maybe related to connecting javadb
netbeans deadlock maybe related to connecting javadb
Status: RESOLVED FIXED
Product: db
Classification: Unclassified
Component: Code
7.3
PC Mac OS X
: P2 (vote)
: 7.3
Assigned To: Jaroslav Havlin
issues@db
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-04 08:25 UTC by medeag
Modified: 2012-11-15 17:01 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
sample (126.71 KB, text/plain)
2012-11-04 08:25 UTC, medeag
Details
sample 2 (9.37 KB, text/plain)
2012-11-04 08:25 UTC, medeag
Details
deadlock (31.42 KB, text/plain)
2012-11-04 15:29 UTC, medeag
Details
screenshot (139.98 KB, image/png)
2012-11-05 17:47 UTC, medeag
Details
dump (23.69 KB, text/plain)
2012-11-05 17:49 UTC, medeag
Details
screenshot - linux (94.16 KB, image/png)
2012-11-08 09:56 UTC, Jaroslav Havlin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description medeag 2012-11-04 08:25:00 UTC
Created attachment 127072 [details]
sample

Product Version: NetBeans IDE 7.3 Beta 2 (Build 201211020750)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b12
System: Mac OS X version 10.7.5 running on x86_64; US-ASCII; ka_GE (nb)  

Not sure if it related but netbenas freezes when i connected to javadb, tried to run  stack, but stacktrace seem not to be much help...

Medea-Gugushvilis-MacBook-Pro:~ medea$ sudo jstack -F 6462
Attaching to process ID 6462, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at sun.tools.jstack.JStack.runJStackTool(JStack.java:118)
	at sun.tools.jstack.JStack.main(JStack.java:84)
Caused by: java.lang.RuntimeException: Type "nmethodBucket*", referenced in VMStructs::localHotSpotVMStructs in the remote VM, was not present in the remote VMStructs::localHotSpotVMTypes table (should have been caught in the debug build of that VM). Can not continue.
	at sun.jvm.hotspot.HotSpotTypeDataBase.lookupOrFail(HotSpotTypeDataBase.java:371)
	at sun.jvm.hotspot.HotSpotTypeDataBase.readVMStructs(HotSpotTypeDataBase.java:262)
	at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:87)
	at sun.jvm.hotspot.MacOSXTypeDataBase.<init>(MacOSXTypeDataBase.java:36)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:578)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:499)
	at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:337)
	at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
	at sun.jvm.hotspot.tools.JStack.main(JStack.java:88)
Comment 1 medeag 2012-11-04 08:25:44 UTC
Created attachment 127073 [details]
sample 2
Comment 2 medeag 2012-11-04 08:34:07 UTC
Just to add: only menu item that was accessible was netbeans main menu, so i  was able to quit netbeans using it.
Comment 3 everflux 2012-11-04 12:08:13 UTC
Maybe this is related to the JDK early access release? (Java: 1.7.0_10-ea)

What did you do when the problem appeared, I can try to reproduce it on Linux.
Comment 4 medeag 2012-11-04 12:12:07 UTC
Netbeans doesn't work with previous versions of jdk 7 on mac, that is why i'm using 1.7.0_10-ea, 
The steps what is did is following: just connected to javadb, then left netbeans and switch to other application, when i returned i was unable to do anything in netbeans except quit it.
Comment 5 medeag 2012-11-04 15:29:48 UTC
Created attachment 127086 [details]
deadlock

another deadlock when clicked on recreate table
Comment 6 Tomas Danek 2012-11-05 14:57:39 UTC
Tondo, can you please evaluate as a potential beta2 stopper? It seems to me like it's JDK related, not NB...

However, I am not able to reproduce on my Mac using those steps:(

Product Version: NetBeans IDE 7.3 Beta 2 (Build 201211042000)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b12
System: Mac OS X version 10.8.2 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.3beta2
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.3beta2


Medea, can you try to run on JDK 6 for Apple (should be in /Library/Java/Home) 

(In reply to comment #4)
> Netbeans doesn't work with previous versions of jdk 7 on mac, that is why i'm
> using 1.7.0_10-ea, 
> The steps what is did is following: just connected to javadb, then left
> netbeans and switch to other application, when i returned i was unable to do
> anything in netbeans except quit it.
Comment 7 Tomas Danek 2012-11-05 15:02:28 UTC
Stepane, can you please try to reproduce on you Mac? Thanks in  advance.
Comment 8 Antonin Nebuzelsky 2012-11-05 15:33:59 UTC
Unfortunately the thread dumps are hardly usable. The native ones are lacking details of the java code and the third one was not successfully obtained and instead of details of java threads contains jstack's own NPE.

> Medea-Gugushvilis-MacBook-Pro:~ medea$ sudo jstack -F 6462

Any reason to use "sudo" here? Isn't this the reason why jstack is not able to successfully connect to the process and return the regular thread dump?

Can you try using VisualVM to connect to the hung process and see if the thread stack traces are available from there?
Comment 9 medeag 2012-11-05 17:46:37 UTC
jstack did not work without sudo: 
I was getting:

jstack -F 1081
Attaching to process ID 1081, please wait...
attach: task_for_pid(1081) failed (5)
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process

I tried to create thread dumping using visualVM... hope i have done  correctly this time :) I'm also atteching view of netbeans when it is freezed
Comment 10 medeag 2012-11-05 17:47:21 UTC
Created attachment 127174 [details]
screenshot
Comment 11 medeag 2012-11-05 17:49:12 UTC
Created attachment 127175 [details]
dump
Comment 12 medeag 2012-11-05 17:59:06 UTC
@Tomas

Unfortunately i can't test on jdk 6 today :(
Comment 13 Antonin Nebuzelsky 2012-11-05 21:54:39 UTC
Nothing interesting in the thread dump. No threads blocked, some waiting for an event, some runnable including AWT thread. The IDE should be responsive according to this dump.
Comment 14 Stepan Zebra 2012-11-05 22:51:59 UTC
(In reply to comment #7)
> Stepane, can you please try to reproduce on you Mac? Thanks in  advance.

I was able to reproduce some kind of lockup. I haven't found some exact steps, but basically after connecting and disconnecting few databases on JavaDB, IDE suddenly stop responding after another one connection was made. The main IDE window doesn't respond to any input, but it's still being repainted - I can see the small memory usage graph still showing live data and I can freely move the window. Another interesting thing is that all menu items are now gone excluding the "NetBeans" item, which can be opened and allows to invoke "About" box and "Options" manager and they both seems to work perfectly fine.
Unfortunately, I don't have any data from the lockup as Ctrl+\ didn't work on the IDE console and neither jstack nor jvisualvm were able to connect to the process (though I didn't try to run them as superuser).
Comment 15 medeag 2012-11-06 05:20:25 UTC
Now when Stepane have mentioned this  i recall that it is really somehow related to connect/disconnect ... The situation Stepane  describes looks exactly same i've seen for two times, 

there was also another freeze (not with these symptoms) when i tried to recreate database, but i couldn't reproduce it anymore
Comment 16 Tomas Danek 2012-11-06 11:14:40 UTC
assigning to DB, removing beta 2 stopper sw, but leaving open as P2 for further investigation.
Comment 17 Jaroslav Havlin 2012-11-06 17:39:36 UTC
Maybe it is not a deadlock, but symptom of a problem with displaying dialog (modal dialog with progress bar and "cancel" button should be shown while connecting to a database).
The UI is rendered correctly, but cannot process any input (like if an invisible modal dialog is blocking it). Menu items may be missing because the dialog modifies the global menu (I'm not sure hot this works on Mac OS X).

I haven't been able to reproduce the bug yet (Windows 7 64, jdk1.7.0_10-ea-b14).
Comment 18 Jaroslav Havlin 2012-11-08 09:56:40 UTC
Created attachment 127375 [details]
screenshot - linux

I tried to reproduce on Linux, and I also encountered some problems with dialog. (tested with JDK 7u9 and 7u10ea-build14). After several connections and disconnections, the dialog stayed open, with no content (see the screenshot). The mouse and keyboard input was blocked. With JDK 7u9 everything worked fine after the dialog was closed. With JDK 7u10ea and NetBeans started from console, the key input was blocked even after closing the dialog.
It could be related to the issue on Max OS X.

I haven't been able to reproduce on Linux with JDK 6.
Comment 19 Jaroslav Havlin 2012-11-13 17:06:15 UTC
http://hg.netbeans.org/core-main/rev/29e557b81e55
The Linux issue seems to be fixed (tested with jdk1.7.0_10-ea-b15).
Please test whether Mac works fine now too. Thanks in advance.
Comment 20 Quality Engineering 2012-11-15 02:44:19 UTC
Integrated into 'main-golden', will be available in build *201211150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/29e557b81e55
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #221422: Call Dialog.setVisible(false) in EDT
Comment 21 Jaroslav Havlin 2012-11-15 17:01:13 UTC
I cannot reproduce on Mac. Closing as fixed.
Please reopen if you encounter this bug again.
Thank you for your help!


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo