Skip to content

atomic_cell::is_lock_free test fails on armv7-unknown-linux-gnueabihf #918

Closed
@decathorpe

Description

@decathorpe

Building crossbeam-utils 0.8.12 on Fedora Linux, I get a new test failure on 32-bit ARM:

---- is_lock_free stdout ----
thread 'is_lock_free' panicked at 'assertion failed: `(left == right)`
  left: `true`,
 right: `false`', tests/atomic_cell.rs:36:5

According to the line numbers, the assertion that fails is this one:

    // Sizes of both types must be equal, and the alignment of `u64` must be greater or equal than
    // that of `AtomicU64`. In i686-unknown-linux-gnu, the alignment of `u64` is `4` and alignment
    // of `AtomicU64` is `8`, so `AtomicCell<u64>` is not lock-free.
    assert_eq!(
        AtomicCell::<u64>::is_lock_free(),
        cfg!(not(crossbeam_no_atomic_64))
            && cfg!(any(
                target_pointer_width = "64",
                target_pointer_width = "128"
            ))
    );

Looks like the assumptions made in this test aren't correct on 32-bit ARM?

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