cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stack overflow errors when instrumenting hashCode() methods

jan_thomas
Newcomer

For a research project I need to capture all method calls of my Java application using Dynatrace version 6.2. For this reason I tell the sensor configuration to capture all methods of some base package (e.g. de.some.package.). When I run the app with this configuration, the app crashes with a stack overflow error after a while. A stack dump right before the crash looks as follows:

java.lang.Thread.State: RUNNABLE
at com.dynatrace.diagnostics.agent.TraceTag.<init>(Unknown Source)
at com.dynatrace.diagnostics.agent.ThreadLocalTag.getOrCreateTraceTag(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.b(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.checkTag(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.a(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.createTraceTag(Unknown Source)
at de.some.package.MyClass.hashCode(MyClass.java)
at com.dynatrace.diagnostics.agent.TraceTag.<init>(Unknown Source)
at com.dynatrace.diagnostics.agent.ThreadLocalTag.getOrCreateTraceTag(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.b(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.checkTag(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.a(Unknown Source)
at com.dynatrace.diagnostics.agent.introspection.Introspection.createTraceTag(Unknown Source)
at de.some.package.MyClass.hashCode(MyClass.java)
...

So it seems that Dynatrace runs in some kind of recursion, when an instrumented hashCode method is called. Is this behavior already known or fixed in current versions? How could I work around this problem?

1 REPLY 1

harald_berger
Dynatrace Pro
Dynatrace Pro

Hi Jan,

This has already been fixed with 6.3 and later (see JLT-157737)

Please upgrade.

Best

Harry