Skip to content

UBSan trap runtime missing encoding #23225

@Ivan-Velickovic

Description

@Ivan-Velickovic

Zig Version

0.14.0

Steps to Reproduce and Observed Behavior

My understanding is Zig introduced its own UBSan runtime with 0.14.0 that is now used instead of LLVM's runtime.

I use Zig to cross-compile C code in a freestanding environment so instead of printing out a stack trace etc I'm used to just getting an instruction that causes an exception when UBSan detects UB.

On ARM64 (and potentially other architectures), LLVM would encode the UB cause into the brk instruction. In a freestanding environment then you can decode it to at least get a hint of what could be going wrong.

Does the Zig runtime intend to provide that behaviour?

Expected Behavior

Trap instruction has same encoding as Zig 0.13.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions