Skip to content

Quickstart example panics on rust v1.80+ (aarch64-apple-darwin , bug of apple's bag of tools) #1252

Open
@peitalin

Description

@peitalin

I'm running cargo test on this example: https://docs.near.org/build/smart-contracts/quickstart and getting panics on the set_then_get_greeting() test:

thread 'tests::set_then_get_greeting' panicked at core/src/panicking.rs:221:5:
unsafe precondition(s) violated: ptr::replace requires that the pointer argument is aligned and non-null

Commenting out the log!() line resolves the issue.
I'm running:

rustc 1.82.0 (f6e511eec 2024-10-15)
cargo-near-near 0.11.0
near-cli-rs 0.15.1

Reverting back to rustc 1.79-aarch64-apple-darwin fixes the issues, seems like a similar issue to this:
https://stackoverflow.com/questions/78952340/unsafe-preconditions-violated-ptrreplace-requires-that-the-pointer-argument

Rust versions after v1.79 panic:

stable: 1.80, 1.81, 1.82 panics
beta 1.83 panics
nightly 1.84 panics

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      NEW❗

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions