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

Fix va_list reuse #54

Merged
merged 1 commit into from
Sep 1, 2024
Merged

Conversation

junjihashimoto
Copy link
Collaborator

LOG function calls vsnprintf with the same va_list twice, but it is not allowed.
It throws segfault sometimes.
This PR copies the va_list not to reuse it.
https://stackoverflow.com/questions/2288680/reuse-of-va-list

@austinvhuang
Copy link
Contributor

Thanks for the catch. it feels kind of messy to call vsnprintf twice in the first place to get the size, and then to need to copy the va_list to facilitate that, but I don't have a better solution for now so we'll go with this at least until we find a cleaner solution.

@austinvhuang austinvhuang merged commit 85302c1 into AnswerDotAI:main Sep 1, 2024
1 check passed
@junjihashimoto junjihashimoto deleted the fix/va_list branch September 2, 2024 01:14
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.

2 participants