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 150370 - Tomcat crashes when attaching NB profiler
Summary: Tomcat crashes when attaching NB profiler
Status: RESOLVED WONTFIX
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 12:38 UTC by tkellerer
Modified: 2009-05-25 21:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Core dump from JVM crash (12.32 KB, text/plain)
2008-10-16 12:38 UTC, tkellerer
Details
Dump file with JDK 1.6.0_10 (12.32 KB, text/plain)
2008-10-16 13:03 UTC, tkellerer
Details
The real JDK1.6.0_10 dump file... (11.62 KB, text/plain)
2008-10-16 13:12 UTC, tkellerer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tkellerer 2008-10-16 12:38:04 UTC
I'm trying to profile a maven based web project. As the project creates Portlets that are deployed into Liferay,
"running" the project from within NB is not possible. 

So I tried the "Attach profiler methods"
The Tomcat I'm starting is a 6.0.16 (the one that comes with the Liferay bundle) with Liferay and my portlets deployed. 

When I use the "Dynamic attach" feature to attach to my running Tomcat, the Tomcat processes immediately crashes with a
"core dump" (the hs_err.log file is attached)

I cannot use "Direct attach" because in that case Tomcat starts so slowly that Liferay is not initialized properly.
Comment 1 tkellerer 2008-10-16 12:38:52 UTC
Created attachment 71959 [details]
Core dump from JVM crash
Comment 2 tkellerer 2008-10-16 12:40:37 UTC
Sorry, forgot the details (from the ide log file)

  Product Version         = NetBeans IDE Dev (Build 200810160201)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_07; Java HotSpot(TM) Client VM 10.0-b23; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_07-b06

I also tried it with JDK 1.6.0_10 same problem.
Comment 3 Tomas Hurka 2008-10-16 12:50:11 UTC
This looks like JDK bug. As a workaround you can try to use direct attach in monitoring mode. Once the tomcat is started, you can switch to CPU or Memory 
profiling. 
Comment 4 Tomas Hurka 2008-10-16 12:52:21 UTC
Can you please attach the JVM carch log from JDK 1.6.0_10? 
Comment 5 tkellerer 2008-10-16 13:03:58 UTC
Created attachment 71963 [details]
Dump file with JDK 1.6.0_10
Comment 6 tkellerer 2008-10-16 13:12:23 UTC
Created attachment 71967 [details]
The real JDK1.6.0_10 dump file...
Comment 7 Tomas Hurka 2008-10-16 14:24:48 UTC
Run tomcat with
-Xcheck:jni
try to attach from profiler and attach stdout from the Tomcat process - there should be a lot of log about JNI.
Comment 8 Tomas Hurka 2008-10-16 14:29:05 UTC
Forgot about jni check. 
From the crash log, it looks like you are running out of perm space. Try to increase perm space to 256m. Use -XX:MaxPermSize=256m
Comment 9 tkellerer 2008-10-16 18:21:48 UTC
Increasing the perm size did not change anything.
Comment 10 Tomas Hurka 2008-10-16 19:52:21 UTC
Ok, please try -Xcheck:jni
Comment 11 tkellerer 2008-10-17 10:01:16 UTC
Not much info written when using -Xcheck:jni and "dynamic attach". Do you need the JNI information when using "direct
attach"?

Profiler Agent: JNI On Load Initializing...
Profiler Agent: JNI OnLoad Initialized succesfully
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 8)
Profiler Agent: Established local connection with the tool
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6ddc1375, pid=1416, tid=2828
#
# Java VM: Java HotSpot(TM) Server VM (11.0-b15 mixed mode windows-x86)
# Problematic frame:
# V  [jvm.dll+0x291375]
#
# An error report file with more information is saved as:
# C:\Projects\DNS\portal-5.1.1\bin\hs_err_pid1416.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Comment 12 Tomas Hurka 2008-10-17 10:23:36 UTC
So the only option would be reproducible test case. Can you prepare one?
Comment 13 tkellerer 2008-10-17 10:40:26 UTC
As it seems that it is the combination of Tomcat & Liferay, the only way to reproduce it: 

1) Download the Liferay Tomcat bundle from http://downloads.sourceforge.net/lportal/liferay-portal-tomcat-6.0-5.1.2.zip
2) Unpack the zip file and start Tomcat
3) Try to attach to the running Tomcat using "Dynamic Attach" (either using VisualVM or NetBeans, same behaviour)
Comment 14 Tomas Hurka 2008-10-17 10:49:23 UTC
Thanks, I will try it.
Comment 15 Tomas Hurka 2009-04-08 12:56:10 UTC
Milestone cleanup: future->next
Comment 16 Tomas Hurka 2009-05-13 10:20:15 UTC
I was able to reproduce it with liferay-portal-tomcat-6.0-5.1.2.zip. The crash is caused by bug in JVM - reported as 6839599
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6839599)
Closing as wontfix.