Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackOverflowError during exception reporting #1618

Open
raner opened this issue Apr 21, 2024 · 1 comment
Open

StackOverflowError during exception reporting #1618

raner opened this issue Apr 21, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@raner
Copy link

raner commented Apr 21, 2024

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:

https://github.com/raphw/byte-buddy/blob/0a91a85d741c1e0b5d8eeef98f7842e5cbc1496e/byte-buddy-dep/src/main/java/net/bytebuddy/description/TypeVariableSource.java#L171C1-L178C1

Instead, the call to toSafeString() leads to an endless recursion. This has been observed with Byte Buddy 1.14.12.

@raphw raphw self-assigned this Apr 22, 2024
@raphw raphw added the question label Apr 22, 2024
@raphw raphw added this to the 1.14.14 milestone Apr 22, 2024
@raphw
Copy link
Owner

raphw commented Apr 22, 2024

This is indeed overseen. The return type is also possibly an unresolved recursive. Will be fixed in the next release.

@raphw raphw added bug and removed question labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants