-
Notifications
You must be signed in to change notification settings - Fork 152
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
"malloc(): corrupted top size" during json serialization #1587
Comments
Thanks very much for reporting this. The code surrounding this quoted key dumping has been improved and simplified since 4.2.3, so I'd be interested to see if you still get this error if you pulled the latest version (or main). Is it possible for you to check if the error exists on the latest release of Glaze? Otherwise, I can explore the older code more. It looks like your AppendStringBuffer struct should work without issue. |
Thanks for the quick reply! I just tried the
So the error happens here
|
Thanks for testing template <class T>
concept vector_like =
resizable<std::remove_cvref_t<T>> && accessible<std::remove_cvref_t<T>> && has_data<std::remove_cvref_t<T>>; Notably, your |
Thank you so much! I also needed |
Yay! I'll have to think more about how to avoid these kinds of errors in the future. Supporting raw buffers makes it difficult and I think it might be better to instead only support an explicit type like |
I'm closing this because we found a fix, but I opened #1589 to provide better feedback and avoid these issues in the future. |
Hi
After upgrading vcpkg to the new 2025.01.13 release which bumps glaze from 4.0.3 -> 4.2.3, we are getting segfaults and
malloc(): corrupted top size
for some of our glaze serialization. If I override the version back down to 4.0.3 the error disappears.The error happens during a resize call to the buffer, however I think the true cause must be due to a write/allocation happening before this.
Building with sanitize produces the following error
So it seems to point to these lines in write.hpp
We use a custom buffer implementation
AppendBuffer<std::string>
because we need to append to our string it looks like this:Perhaps you have an idea of what we are doing wrong? Otherwise let me know if I can provide more information
The text was updated successfully, but these errors were encountered: