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 51228 - EXCEPTION_ACCESS_VIOLATION @ JVM_OnLoad+0xFD4 (getMethodNamesForJMethodIds)
Summary: EXCEPTION_ACCESS_VIOLATION @ JVM_OnLoad+0xFD4 (getMethodNamesForJMethodIds)
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: PC Other
: P2 blocker (vote)
Assignee: mishadmitriev
URL:
Keywords:
: 51284 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-06 03:51 UTC by jchristi
Modified: 2007-02-20 18:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jchristi 2004-11-06 03:51:44 UTC
I got the following exception killing the JVM
while using the M3 build on Netbeans 4.0b2.


An unexpected exception has been detected in
native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION
(0xc0000005) occurred at PC=0x3E4164
Function=JVM_OnLoad+0xFD4
Library=C:\DOCUME~1\jchristi\.netbeans\4.0beta2\modules\profiler-ea-libs\deployed\jdk142\windows\profilerinterface.dll

Current Java thread:
	at
com.sun.tools.profiler.server.system.Stacks.getMethodNamesForJMethodIds(Native
Method)
	at
com.sun.tools.profiler.server.ProfilerInterface.getMethodNamesForJMethodIds(ProfilerInterface.java:284)
	at
com.sun.tools.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:548)
	at
com.sun.tools.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:375)
	at
com.sun.tools.profiler.server.ProfilerServer.run(ProfilerServer.java:242)

Dynamic libraries:
{SNIP SNIP}

Heap at VM Abort:
Heap
 def new generation   total 3072K, used 278K
[0x10010000, 0x10360000, 0x113c0000)
  eden space 2752K,  10% used [0x10010000,
0x10055990, 0x102c0000)
  from space 320K,   0% used [0x10310000,
0x10310000, 0x10360000)
  to   space 320K,   0% used [0x102c0000,
0x102c0000, 0x10310000)
 tenured generation   total 37084K, used 19619K
[0x113c0000, 0x137f7000, 0x20010000)
   the space 37084K,  52% used [0x113c0000,
0x126e8d88, 0x126e8e00, 0x137f7000)
 compacting perm gen  total 21248K, used 21165K
[0x20010000, 0x214d0000, 0x24010000)
   the space 21248K,  99% used [0x20010000,
0x214bb728, 0x214bb800, 0x214d0000)

Local Time = Fri Nov 05 19:42:44 2004
Elapsed Time = 6404
#
# The exception above was detected in native code
outside the VM
#
# Java VM: JFluid Client VM 1.4.3 (based on Java
HotSpot(TM) VM) (1.4.2_04-b05-release mixed mode)
#
Comment 1 mishadmitriev 2004-11-10 03:53:14 UTC
Jon, a few questions to you:
1. How often does it happen?
2. By any chance, does the profiled application do any (intensive) 
class unloading? E.g. Tomcat may do that when it redeploys some 
application. You can check that by running the target JVM with "-
verbose:class" option. There is a small chance that the failure may 
be due to attempting to get some info for a class that is already 
unloaded.
3. Traditionally, can you provide a test case?

If item 2 above is not confirmed, then I suspect, there is a 
considerable chance that it's a yet another JVM defect that might be 
hard to fix. We have already fixed one problem that manifested itself 
in a very similar way, and probably had a root cause somewhere in the 
depth of the original HotSpot VM's GC code. Actually, we provided a 
workaround rather than a fix, but even that was difficult. So the 
decision on whether to spend time trying to fix this problem would 
depend on whether it's easy enough to reproduce and is really 
annoying...
Comment 2 jchristi 2004-11-10 04:51:05 UTC
Fairly certain no (intensive) class loading.  Will investigate to 
make sure.

Unfortunately this happens sporadically, and I will try to see if I 
can come up with a test case in the next few days.
Comment 3 jchristi 2004-11-11 05:10:42 UTC
Got this same crash tonight... still no additional info, but want to
keep track of how many times I see this via a note in the issue.
Comment 4 jchristi 2004-11-11 05:17:16 UTC
I did note this was also spit out to stderr:

*** JFluid warning: invalid jmethodID detected
*** mId = 54006048, *mId = 53612992, standard_ptr_value = 136017176
Comment 5 jchristi 2004-11-12 19:37:34 UTC
Not positive because my profiling sessions usually last many hours and
possibly days, but the occurrance of this error this past week seem to
be when I connect to the JVM via Ctrl-Break.

It seems as though when I use the "Connect at Startup" mechanism, that
this error doesn't seem to happen.

It could be just luck of the draw, but I will keep good track of how I
connected for any further incidents of this... I haven't seen this the
past few runs, but that is because I've been doing the majority of my
profiling using the "Connect at Startup" mechanism.
Comment 6 jchristi 2004-11-16 15:33:55 UTC
Seems like when I connect via CTRL-BREAK, I'll get this error within a
few hours.

I currently have a profiling session that has been running for more
than 90 hours, which I initiated via a "connect at startup", and never
saw this happen.
Comment 7 mishadmitriev 2004-12-07 03:26:37 UTC
*** Issue 51284 has been marked as a duplicate of this issue. ***
Comment 8 mishadmitriev 2004-12-10 02:58:26 UTC
The root cause of this issue is very likely the fact that when a 
class gets unloaded, jmethodIds that could have previously been 
obtained for its methods, become invalid. If the tool keeps these 
jmethodIds and doesn't use them to obtain strings for class/method 
name before the class gets unloaded, it can crash the VM when it 
finally attempts to use jmethodIds that became invalid.

I've just implemented a mechanism which keeps track of class 
unloading and forces the tool to obtain all information for classes 
about to be unloaded before they go away. Will send Jon a patch to 
see how this works for him.
Comment 9 iformanek 2004-12-13 13:50:49 UTC
changing owner to Misha
Comment 10 jchristi 2004-12-15 23:26:41 UTC
Just finally stopped profiling session that was up for 4 days, and it
appears this fix worked.

The following was sent to stdout (which I figures shows just how many
times your new code has prevented the JVM from crashing)

*** JFluid warning: invalid jmethodID detected
*** mId = 49883280, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 158734304, *mId = 51560120, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 89690120, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 108126216, *mId = 2097189, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 199660032, *mId = 7471174, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 48827792, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 90335944, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 48546888, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 89853960, *mId = 48752688, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 87971160, *mId = 88406520, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 48348400, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 106739872, *mId = 50682864, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 101408736, *mId = 49941624, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 90607624, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 95813680, *mId = 46353792, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 51156368, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 87967880, *mId = 87607864, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 87971448, *mId = 87967880, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 49346976, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 50304304, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 86828408, *mId = 7471174, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 90383408, *mId = 86509696, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 50165760, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 46236592, *mId = 106739552, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 48518824, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 87606536, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 102099816, *mId = 608559352, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 141002072, *mId = 0, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 158799216, *mId = 703688944, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 732453360, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 112246424, *mId = 2097189, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 87971040, *mId = 103923720, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 86006784, *mId = 52268024, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 49276560, *mId = 679005760, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 86827256, *mId = 86925056, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 106738896, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 52267200, *mId = 96470184, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 96472144, *mId = 49467440, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 48425440, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 52400056, *mId = 102022632, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 103732000, *mId = 147505120, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 84041360, *mId = 136032660, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 103722288, *mId = 148307624, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 49937896, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 49740952, *mId = 157843376, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 174561704, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 87411592, *mId = 107516528, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 102008576, *mId = 659397048, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 49211168, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 46285816, *mId = 91333144, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 102010272, *mId = 136032660, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 48740136, *mId = 0, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 99054552, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 147427272, *mId = 141067856, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 89621832, *mId = 83337496, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 49346832, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 102009376, *mId = 91088880, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 90467368, *mId = 140938064, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 86924912, *mId = 152174808, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 84590480, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 147580248, *mId = 3, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 136932192, *mId = 7471174, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 90565776, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 99373232, *mId = 99884816, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 99373144, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 46115616, *mId = 7471174, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 48411504, *mId = 99852168, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 87574976, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 169427880, *mId = 103914360, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 174562888, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID detected
*** mId = 148381136, *mId = 6357072, standard_ptr_value = 136017176
*** JFluid warning: invalid jmethodID det
Comment 11 jchristi 2004-12-15 23:29:10 UTC
I meant stderr
Comment 12 mishadmitriev 2004-12-16 04:43:15 UTC
Well, the above is a different issue, this fix (for what seems to be 
a bug in the JVM) existed before. But anyway, given that the problem 
didn't show up in 4 days, we can probably consider this issue fixed.
Comment 13 jchristi 2004-12-16 13:47:55 UTC
Got this while using patch jf-patch121404 on Netbeans 4.0 (real release):


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred
at PC=0x26E61364
Function=Java_com_sun_tools_profiler_server_system_Stacks_getMethodNamesForJMethodIds+0xB4
Library=C:\Documents and
Settings\jchristi\.netbeans\4.0\modules\profiler-ea-libs\deployed\jdk142\windows\profilerinterface.dll

Current Java thread:
	at
com.sun.tools.profiler.server.system.Stacks.getMethodNamesForJMethodIds(Native
Method)
	at
com.sun.tools.profiler.server.ProfilerInterface.getMethodNamesForJMethodIds(ProfilerInterface.java:291)
	at
com.sun.tools.profiler.server.ProfilerServer.handleClientCommand(ProfilerServer.java:562)
	at
com.sun.tools.profiler.server.ProfilerServer.listenToClient(ProfilerServer.java:376)
	at
com.sun.tools.profiler.server.ProfilerServer.run(ProfilerServer.java:243)
Comment 14 jchristi 2004-12-16 16:22:32 UTC
It happened 4 hours into the profiling session, and both the target
JVM and the Netbeans JVM seemed to be very unresponsive.... CPU was
being highly consumed.
Comment 15 mishadmitriev 2005-01-27 06:27:13 UTC
One more attempt to declare this issue fixed. This time I was able to 
reproduce it (though still not very reliably), found a real bug in 
the native code, and also introduced MS exception handler to protect 
the code from unknown problems.

Jon, I can send you a hot fix to test if you would like.
Comment 16 ehucka 2006-10-09 12:11:36 UTC
Verification of old issues.
Comment 17 Alexander Kouznetsov 2007-02-12 22:41:42 UTC
Closing old issues.
Comment 18 Alexander Kouznetsov 2007-02-20 18:37:27 UTC
Reverting to the original Target Milestone value changed by mistake. Sorry for
inconvenience.