Skip to content

Misaligned memory reads in lmdb #257

@ahoppen

Description

@ahoppen

To reproduce run

UBSAN_OPTIONS=halt_on_error=true ~/swift-latest/usr/bin/swift test --sanitize=undefined --filter testBackgroundIndexingHappensWithLowPriority

Output

Test Case '-[SourceKitLSPTests.BackgroundIndexingTests testBackgroundIndexingHappensWithLowPriority]' started.
/Users/alex/src/sourcekit-lsp/.command-line-build/checkouts/indexstore-db/lib/Database/lmdb/mdb.c:5916:14: runtime error: load of misaligned address 0x000109ddfffd for type 'unsigned short', which requires 2 byte alignment
0x000109ddfffd: note: pointer points here
 f6 57 eb d1 cf fb 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
             ^ 
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/alex/src/sourcekit-lsp/.command-line-build/checkouts/indexstore-db/lib/Database/lmdb/mdb.c:5916:14 in 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions