Skip to content

UBSAN + OrcJIT crashes when code is placed at beginning of page #104505

Open
@MatzeB

Description

@MatzeB

UBSAN from LLVM >= 17.x reads 8 bytes in front of a function to look for markers. This fails when a JIT compiler like ORC-Jit places code immediately at the beginning of an mmaped section (so reading 8 byte upfront ends up in unmapped memory and crashes).

See also https://reviews.llvm.org/D148665 and the similar discussion in #65253

Not sure if ORC should/wants to do something generic to avoid users running into this. For the time being I added this workaround to one of our porjects to unblock our codebase: https://github.com/pytorch/pytorch/pull/133623/files

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions