StackOverflowError during exception reporting
Closed this issue · 1 comments
raner commented
I just ran into a scenario where instead of seeing an exception that informs me of an issue with my bytecode generation, I see a StackOverflowError
instead.
The repeating part of the overflow is:
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onTypeVariable(TypeDescription.java:1973)
at net.bytebuddy.description.type.TypeDescription$Generic$OfTypeVariable$Symbolic.accept(TypeDescription.java:5931)
at net.bytebuddy.description.method.MethodDescription$Latent.getReturnType(MethodDescription.java:1489)
at net.bytebuddy.description.method.MethodDescription$AbstractBase.toSafeString(MethodDescription.java:1052)
at net.bytebuddy.description.TypeVariableSource$AbstractBase.findExpectedVariable(TypeVariableSource.java:174)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onTypeVariable(TypeDescription.java:2062)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onTypeVariable(TypeDescription.java:1973)
Clearly, there is something wrong on my part with regards to a missing symbolic type variable (still investigating what exactly), but I would have expected to see the IllegalArgumentException
thrown by findExpectedVariable
:
Instead, the call to toSafeString()
leads to an endless recursion. This has been observed with Byte Buddy 1.14.12.
raphw commented
This is indeed overseen. The return type is also possibly an unresolved recursive. Will be fixed in the next release.