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

Use-after-free when calling a derive more than once #3

Closed
8BitMate opened this issue May 18, 2020 · 0 comments
Closed

Use-after-free when calling a derive more than once #3

8BitMate opened this issue May 18, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@8BitMate
Copy link
Owner

I get a use-after-free error when calling the same derive macro more than once. It seems to be related to this issue. I didn't notice this problem in any of the tests, as it only happens when making a procedural macro. It seems the issue has to with using std::thread::LocalKey.

The issue may be resolved by removing the cashing inside the library! macro. However, I'm not entirely sure how we can remove the cashing of the Parent structs without making things incorrect.

Alternatively, it may be possible to replace all the occurrences of Ident inside the crate defined types, as the issue may be related to storing Span information between two calls to the same derive macro.

@8BitMate 8BitMate added the bug Something isn't working label May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant