Community
Participate
Working Groups
Removing all filters and attaching to HeapJniCarTest in HeapProf enabled mode causes JVM crash. Sun JVM/Windows. See comments #5 through #12 of bug 270767 for full description.
Chengrui or Yunan, Please take a look at this problem for TPTP 4.6.
This can also be reproduced on Linux by profiling Tomcat: 1. Download and setup Tomcat 5.5.27 (latest) 2. export JAVA_OPTS='-agentlib:JPIBootLoader=JPIAgent:server=enabled;HeapProf' 3. Run Tomcat's startup.sh 4. In Eclipse, under the Profiling dialog, create a new 'Attach to Agent' entry for the Linux host. 5. Move to the 'Agents' tab, bring up the filter dialogue, and remove the java* filter from the list, thus including all java* classes in the profiling data. You do not need to change any of the other filters. 6. Accept the filter change and click Profile. Within a few moments, the Tomcat server will core (may need to use 'ulimit -c unlimited' to get the core file, depending on your Linux distro). It is not required to hit the server at all to achieve the crash. ractest@tptp-blackhawk:~/jgw/apache-tomcat-5.5.27/bin> java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing) ractest@tptp-blackhawk:~/jgw/apache-tomcat-5.5.27/bin>
Hi Chengrui, Any update on this defect? Would this be containable in TPTP 4.6?
(In reply to comment #3) > Hi Chengrui, > > Any update on this defect? Would this be containable in TPTP 4.6? > Hi Kathy, I have found the problem cause and am working on the solution. The profiler binary for testing and patch will be submitted soon. Thanks, Chengrui
Created attachment 135514 [details] Add null pointer check to avoid JVM crash on attach in heapprof The crash problem is found caused by code in HeapProf Object AllocEvent handler. In CObjAllocEvent::HandleEvent(SHeapEventData &data): .... if (!m_pProfEnv->m_profilerIsActive) { return; } m_pProfEnv->CheckClassId(data.pObjectInfo->classId); .... data.pObjectInfo maybe NULL, but it is not be checked before using in m_pProfEnv->CheckClassIddata.pObjectInfo->classId). This patch add additional NULL pointer check in if (!m_pProfEnv->m_profilerIsActive) and it will solve the crash problem. Dear committers, please help to review the patch code. Thanks, Chengrui
Created attachment 135517 [details] Profiler binary files for testing on WindowsXP Hi, Jonathan, I have submitted the patch for this bug. This attachment is the profile binary files for testing on WindowsXP. Please try with it. Thanks, Chengrui
Patched binary fixes the problem on Windows. When the fix is in the build I will test the Linux scenario on Tomcat. Patch looks good to me.
Chengrui, Thanks for the quick turn-around! Jonathan, Thanks for reviewing and testing! Could you please check the code in HEAD so that this gets into TPTP 4.6 RC1?
Patch checked into HEAD w/ project lead approval.
Verified and closed.