Skip to content

Conversation

@Ne02ptzero
Copy link
Contributor

Catched with UBSAN:

runtime error: member access within misaligned address 0x51100000a040 for type 'bson_array_builder_t' (aka 'struct _bson_array_builder_t'), which requires 128 byte alignment
0x51100000a040: note: pointer points here
01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
             ^

#0 0x5bb2a5c5b759 in bson_array_builder_new [...]/mongo-c-driver/src/src/libbson/src/bson/bson.c:3662:21
#1 0x5bb2a5c65a43 in bson_append_array_builder_begin [...]/mongo-c-driver/src/src/libbson/src/bson/bson.c:3983:13

Catched with UBSAN:

    runtime error: member access within misaligned address 0x51100000a040 for type 'bson_array_builder_t' (aka 'struct _bson_array_builder_t'), which requires 128 byte alignment
    0x51100000a040: note: pointer points here
    01 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
                 ^

    #0 0x5bb2a5c5b759 in bson_array_builder_new [...]/mongo-c-driver/src/src/libbson/src/bson/bson.c:3662:21
    #1 0x5bb2a5c65a43 in bson_append_array_builder_begin [...]/mongo-c-driver/src/src/libbson/src/bson/bson.c:3983:13

Signed-off-by: Louis Solofrizzo <[email protected]>
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Ne02ptzero thank you for the contribution. Included a suggested change.

@kevinAlbs kevinAlbs changed the title libbson: use aligned alloc for bson_array_builder_t CDRIVER-5487 use aligned alloc for bson_array_builder_t Feb 26, 2024
@kevinAlbs kevinAlbs merged commit 83211f1 into mongodb:master Feb 26, 2024
kevinAlbs added a commit that referenced this pull request Feb 26, 2024
Signed-off-by: Louis Solofrizzo <[email protected]>
Co-authored-by: Kevin Albertson <[email protected]>
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