Skip to content

Windows / cranelift: misaligned pointer dereference #101

Description

@enizor

frawk is built using --no-default-features (to prevent the known jemalloc issue), in debug mode with rust 1.70 (that landed the alignment check in debug),

C:\[...]\Documents\frawk>target\debug\frawk -B cranelift  "{print $1}" Cargo.toml
thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x10 but is 0x419779fffe', src\codegen\intrinsics.rs:953:19
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:578
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:67
   2: core::panicking::panic_misaligned_pointer_dereference
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:174
   3: frawk::codegen::intrinsics::load_var_int
             at .\src\codegen\intrinsics.rs:953
   4: <unknown>

When running in release mode, UB happens and nothing is printed

C:\[...]\Documents\frawk>target\release\frawk -B cranelift  "{print $1}" Cargo.toml

C:\[...]\Documents\frawk>

Using the interpreter backend works as expected:

C:\[...]\Documents\frawk>target\debug\frawk -B interp  "{print $1}" Cargo.toml
[package]
name
version
authors
edition
[...]

I don't really know how to debug further, I'd love to help if you got some directions for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions