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 69408

Summary: [tests] StackOverFlow from cpu tests with many recursive methods when using Eager instrumentation scheme
Product: profiler Reporter: ehucka <ehucka>
Component: BaseAssignee: issues@profiler <issues>
Status: NEW ---    
Severity: blocker    
Priority: P4    
Version: 5.x   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: test application

Description ehucka 2005-11-28 09:05:11 UTC
I have an automated test profiling an application containing about 1000 methods
called one from other. It produces StackOverflowError if there is set EAGER
instrumentation scheme.



*** Profiler message (Fri Nov 25 16:48:49 CET 2005): Starting target application...
Exception in thread "*** JFluid Separate Command Execution Thread"
java.lang.StackOverflowError
	at java.util.Hashtable.get(Hashtable.java:336)
	at
com.sun.tools.profiler.classfile.ClassRepository.lookupLoadedClass(ClassRepository.java:249)
	at
com.sun.tools.profiler.instrumentation.ClassManager.loadedJavaClassOrExistingPlaceholderForName(ClassManager.java:68)
	at
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.processInvoke(RecursiveMethodInstrumentor2.java:284)
	at
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor.scanBytecode(RecursiveMethodInstrumentor.java:205)
	at
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.checkAndScanMethod(RecursiveMethodInstrumentor2.java:233)
	at
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.processInvoke(RecursiveMethodInstrumentor2.java:290)
	at
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor.scanBytecode(RecursiveMethodInstrumentor.java:205)
	at
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.checkAndScanMethod(RecursiveMethodInstrumentor2.java:233)
Comment 1 iformanek 2005-12-05 11:26:16 UTC
Can you please specify what test app this is?
Comment 2 ehucka 2005-12-06 10:45:54 UTC
Created attachment 27581 [details]
test application
Comment 3 ehucka 2005-12-06 11:47:32 UTC
I found the automated tests with this application end with java error on solaris
machines. But I cannot find the error log on these machines yet (test processes
are running by nohup).

Tests running on windows return the StackOverFlow:

Exception in thread "*** JFluid Separate Command Execution Thread"
java.lang.StackOverflowError
com.sun.tools.profiler.classfile.DynamicClassInfo.getClassFileBytes(DynamicClassInfo.java:136)
com.sun.tools.profiler.classfile.ClassInfo.getMethodBytecode(ClassInfo.java:119)
com.sun.tools.profiler.classfile.DynamicClassInfo.getMethodBytecode(DynamicClassInfo.java:165)
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.checkAndScanMethod(RecursiveMethodInstrumentor2.java:214)
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.processInvoke(RecursiveMethodInstrumentor2.java:290)
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor.scanBytecode(RecursiveMethodInstrumentor.java:205)
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.checkAndScanMethod(RecursiveMethodInstrumentor2.java:233)
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.processInvoke(RecursiveMethodInstrumentor2.java:290)
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor.scanBytecode(RecursiveMethodInstrumentor.java:205)
com.sun.tools.profiler.instrumentation.RecursiveMethodInstrumentor2.checkAndScanMethod(RecursiveMethodInstrumentor2.java:233)

Tests executed on linux are ok.

Is the java error a different issue?
Comment 4 iformanek 2005-12-10 16:37:01 UTC
This is not a P2, for those reasons:
- the profiled application needs to require a very large stack
- this only happens in eager instrumentation scheme, which is not used by 
default for any of the predefined profiling tasks.

The stack requirements at the tool side if eager scheme is used is ~ 3x the 
required stack depth of the profiled application.

The only way to fix this is to change the behavior of eager scheme not to work 
recursively.

Not going to fix in 1.0, lowering to P4, as the constellation of things is very 
unlikely. 

Suggest to modify the test for eager to be just below the limit of stack depth 
the tool side can handle (or modify the stack depth of the VM when running the 
test to be able to handle the stack depth required by the current test).
Comment 5 Tomas Hurka 2009-04-08 12:55:01 UTC
Milestone cleanup: future->next