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 183107 - Crash when taking snapshot of a Java application
Summary: Crash when taking snapshot of a Java application
Status: RESOLVED WONTFIX
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P2 normal with 1 vote (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-29 16:26 UTC by _ gtzabari
Modified: 2010-07-29 11:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
normal stdout output (8.25 KB, text/plain)
2010-03-29 16:27 UTC, _ gtzabari
Details
stdout output with JVM -verbose option (551.84 KB, text/plain)
2010-03-29 16:29 UTC, _ gtzabari
Details
JVM crash log (10.62 KB, application/octet-stream)
2010-03-29 16:29 UTC, _ gtzabari
Details
Netbeans messages log (91.08 KB, application/octet-stream)
2010-03-29 16:30 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2010-03-29 16:26:54 UTC
Netbeans 6.8 (no updates applied)
JDK 6 update 18 32-bit

When I run my application under the profiler I see the following warnings:

*** Profiler engine warning: class sun.reflect.GeneratedSerializationConstructorAccessor1 that should be instrumented is not loaded by target VM
*** Requested classloader: sun.reflect.DelegatingClassLoader@f3ce62, its class = class sun.reflect.DelegatingClassLoader, index = 4, hashcode = 15978082
*** Profiler engine warning: target VM cannot load class to instrument sun.reflect.GeneratedSerializationConstructorAccessor1
*** probably it has been unloaded recently

Later on, I hit the "take snapshot" button and the JVM crashes. I don't know if the two are related but I thought I would mention it because I believe Netbeans used to have special handling for "sun.reflect.GeneratedSerializationConstructorAccessor*" in the past but it no longer seems to.

Please see the attached logs and let me know if you need any more information.

PS: I am using "Profile main application".
Comment 1 _ gtzabari 2010-03-29 16:27:50 UTC
Created attachment 96249 [details]
normal stdout output
Comment 2 _ gtzabari 2010-03-29 16:29:01 UTC
Created attachment 96250 [details]
stdout output with JVM -verbose option
Comment 3 _ gtzabari 2010-03-29 16:29:52 UTC
Created attachment 96251 [details]
JVM crash log
Comment 4 _ gtzabari 2010-03-29 16:30:28 UTC
Created attachment 96252 [details]
Netbeans messages log
Comment 5 _ gtzabari 2010-03-29 16:37:18 UTC
You can reproduce the problem with for following simple testcase:

public class Main
{
    public static void main(String[] args) throws InterruptedException
    {
        while (true)
        {
            Thread.sleep(1000);
        }
    }
}

The key seems to be to enable "Record stack trace for allocations". The crash goes away with this feature disabled.
Comment 6 _ gtzabari 2010-03-29 16:41:44 UTC
Upon further examination, I suspect these are two separate issues:

1. sun.reflect.GeneratedSerializationConstructorAccessor warnings are probably a Netbeans issue.

2. The crash is probably a JVM issue.
Comment 7 Tomas Hurka 2010-03-30 08:20:39 UTC
Profiler engine warning should be harmless. The JVM crash looks similar to issue #62919. Can try to reproduce it on latest JDK7 build (https://jdk7.dev.java.net/). You try workaround from issue #62919 - run your profiled application with JVM option -Xnoclassgc
Comment 8 Tomas Hurka 2010-03-30 10:33:18 UTC
I am not able to reproduce it on Windows 7 64bit, with 32bit JDK 1.6.0_18 and NetBeans 6.8. I used memory profiling with allocation stack traces and I used your testcase.
Comment 9 _ gtzabari 2010-03-30 17:00:51 UTC
Thomas,

Was bug #62919 ever fixed in the JDK? Or did you only work around it in Netbeans?

Regarding this bug:

1. You must launch memory profiling with "Record both object creations and garbage collection" and "record stack trace for allocations". The default "Record object creations only" will not do it.

2. This problem does not occur under JDK7 b87.

In spite of #2, I hope that you agree that this needs to be fixed in Java6.
Comment 10 Tomas Hurka 2010-03-31 16:20:41 UTC
I was able to reproduce it. It looks like a JVM problem, which is different from issue #62919.
Comment 11 _ gtzabari 2010-04-01 22:44:15 UTC
Tomas,

Do you plan on filing a bug report against the JDK?
Comment 12 Tomas Hurka 2010-04-02 13:53:36 UTC
Yes, once I know what is going on. I am still investigating it.
Comment 13 Tomas Hurka 2010-04-02 13:56:41 UTC
There is an easy workaround - create custom configuration and uncheck 
'Run garbage collection when getting memory results' in Advanced settings. Lowering priority to P2.
Comment 14 Tomas Hurka 2010-05-04 15:53:11 UTC
Problem reported as JDK bug #6949515
Comment 15 Tomas Hurka 2010-05-13 13:56:30 UTC
Closing as wontfix. The crash is caused by JDK bug. The fix for the JDK bug is in progress and the bug will be fixed in OpenJDK 6, JDK 7 and it will be back-ported to JDK 6 update release. Until the problem is fixed  in JDK, please, use JDK 6u17 or use workaround from comment #13.
Comment 16 _ gtzabari 2010-05-13 21:53:59 UTC
Any idea why JDK bug #6949515 isn't visible on BugParade? It's been a long time since it was filed.
Comment 17 Tomas Hurka 2010-07-08 07:56:59 UTC
JDK bug #6949515 is fixed in 1.6.0_21, which was released on July 7th 2010.
Comment 18 elton.chan 2010-07-18 07:40:30 UTC
I encountered the same problem with netbean 6.9, i.e the same error message, and same output message telling cannot load some classes...
Comment 19 Marian Petras 2010-07-29 11:23:00 UTC
Apparently, the bug is not fixed properly. JDK 6u21 crashes every time I try to dynamically attach the profiler to it. Both NetBeans and the WebLogic server run on JDK 6u21.

--
NetBeans 6.9
JDK 6u21
Windows XP Professional (version 2002) (32-bit), Service Pack 3
Intel Core 2 Quad CPU
--

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d951e2b, pid=2224, tid=1572
#
# JRE version: 6.0_21-b06
# Java VM: Java HotSpot(TM) Client VM (17.0-b16 mixed mode windows-x86 )
# Problematic frame:
# V  [jvm.dll+0xa1e2b]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x45f32800):  JavaThread "*** Profiler Agent Special Execution Thread 2" daemon [_thread_in_vm, id=1572, stack(0x48300000,0x48350000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000004

...
Comment 20 Tomas Hurka 2010-07-29 11:27:03 UTC
(In reply to comment #19)
> Apparently, the bug is not fixed properly. JDK 6u21 crashes every time I try to
> dynamically attach the profiler to it. Both NetBeans and the WebLogic server
> run on JDK 6u21.
This is probably something different. Please open new bug.