Skip to content

Panic in write_plt_entry_bytes:278 #5005

@mokhaled2992

Description

@mokhaled2992

I'm getting a panic and the stacktrace points at the line shown below. This happens at the very early stages when I initialize my JIT and try to declare some functions. Any hints on how to solve this?

    unsafe fn write_plt_entry_bytes(plt_ptr: *mut [u8; 16], got_ptr: NonNull<AtomicPtr<u8>>) {
        ...................
        plt_val[2..6].copy_from_slice(&i32::to_ne_bytes(i32::try_from(what - at).unwrap()));
        ...................
    }

More info

  • I'm running on x86_64 and Ubuntu 20.
  • My JIT only declares some external rust functions and creates a wrapper function that calls those.
  • I previously ran into another memory execution permissions problem and was pointed to use the feature flag selinux-fix which solved that problem (see Cranelift JITModule and multithreading  #4980 (comment)).
  • Disabling is_pic obviously solves this panic, is that a bug?

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