Skip to content

Conversation

@neuecc
Copy link
Member

@neuecc neuecc commented Feb 3, 2025

Fix #2149

SymbolStartAction of MsgPack00xMessagePackAnalyzer calls new QualifiedNamedTypeName().
The constructor of QualifiedNamedTypeName can surprisingly cause Stackoverflow.
The problem was fixed by setting recursionGuard.

I don't know why recursionGuard is made optional.
There are already several bug reports about this, and it seems to be dangerous code.
Also, generating a QualifiedNamedTypeName for every symbol seems like a high cost.

@AArnott
Copy link
Collaborator

AArnott commented Feb 3, 2025

I don't know why recursionGuard is made optional.

probably a bad call on my part. Feel free to make it mandatory.

Also, generating a QualifiedNamedTypeName for every symbol seems like a high cost.

I declared that type as it was the only way I could sanely track the many different paths a type can be found at. Also, the C# compiler creates tons of objects during compilation so it didn't strike me as a bad idea. But if you know a better way, that's great.

@neuecc
Copy link
Member Author

neuecc commented Feb 4, 2025

Well, regarding the Source Generator, if we're going to continue maintaining it, it seems like I'll need to rebuild it from scratch.

@neuecc neuecc merged commit 892b897 into master Feb 4, 2025
3 checks passed
@neuecc neuecc deleted the fix-stackoverflow branch February 4, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source Generator Compilation Error: Stack overflow

3 participants