Skip to content

Fix enum sizes#149

Merged
quinnj merged 4 commits intoJuliaDatabases:masterfrom
ancapdev:enum-sizes
Jan 13, 2026
Merged

Fix enum sizes#149
quinnj merged 4 commits intoJuliaDatabases:masterfrom
ancapdev:enum-sizes

Conversation

@ancapdev
Copy link
Collaborator

@ancapdev ancapdev commented Jan 7, 2026

Enums in C are int, which are 4 bytes. Using single bytes is valid for representation, but not when sharing memory across the Julia/C boundary. This seems to fix the iteration example in #145.

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.64%. Comparing base (6e1e3f4) to head (98bf551).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/bson.jl 50.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #149   +/-   ##
=======================================
  Coverage   80.64%   80.64%           
=======================================
  Files          11       11           
  Lines        1648     1648           
=======================================
  Hits         1329     1329           
  Misses        319      319           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ancapdev
Copy link
Collaborator Author

ancapdev commented Jan 8, 2026

To the maintainers, do you have a governance process for packages under this org? For example, is there a set of assigned maintainers to each package that can be contacted to push through changes? This particular bug is critical and needs patching for 1.12 usage. I've made a few patches myself to this package over the years and wouldn't mind being added to the maintainers list and help get changes merged in.

ancapdev and others added 3 commits January 13, 2026 08:07
Tests the specific crash scenario from issue JuliaDatabases#145 where iterating over
BSON documents containing binary data would segfault on Julia 1.12.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@quinnj
Copy link
Member

quinnj commented Jan 13, 2026

Thanks for the fix! This is a great catch - the C enum size mismatch was indeed causing stack corruption on Julia 1.12.

I've pushed a test case for the specific crash scenario from #145 to ensure we don't regress.

Regarding your question about governance: we'd love to have you help maintain the package! I'll follow up on getting you added as a maintainer.

@quinnj quinnj merged commit 7e625d1 into JuliaDatabases:master Jan 13, 2026
9 of 10 checks passed
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