Skip to content

Regression tests for intrinsics fail on M1 and Intel Macs #1993

Closed

Description

@aaronbembenek-aws

Some Kani regression tests for intrinsics fail when running on an M1 Mac.

I used the following command line invocation:

./scripts/kani-regression.sh

with Kani 0.16.0 (8527e9c)

I expected to see this happen: regression tests pass

Instead, this happened: 18 regression tests fail

failures:
    [kani] kani/Intrinsics/CopySign/copysignf32.rs
    [kani] kani/Intrinsics/CopySign/copysignf64.rs
    [kani] kani/Intrinsics/Math/Rounding/Ceil/ceilf32.rs
    [kani] kani/Intrinsics/Math/Rounding/Ceil/ceilf64.rs
    [kani] kani/Intrinsics/Math/Rounding/Floor/floorf32.rs
    [kani] kani/Intrinsics/Math/Rounding/Floor/floorf64.rs
    [kani] kani/Intrinsics/Math/Rounding/NearbyInt/nearbyintf32.rs
    [kani] kani/Intrinsics/Math/Rounding/NearbyInt/nearbyintf64.rs
    [kani] kani/Intrinsics/Math/Rounding/RInt/rintf32.rs
    [kani] kani/Intrinsics/Math/Rounding/RInt/rintf64.rs
    [kani] kani/Intrinsics/Math/Rounding/Round/roundf32.rs
    [kani] kani/Intrinsics/Math/Rounding/Round/roundf64.rs
    [kani] kani/Intrinsics/Math/Rounding/Trunc/truncf32.rs
    [kani] kani/Intrinsics/Math/Rounding/Trunc/truncf64.rs
    [kani] kani/Intrinsics/MaxNum/maxnumf32.rs
    [kani] kani/Intrinsics/MaxNum/maxnumf64.rs
    [kani] kani/Intrinsics/MinNum/minnumf32.rs
    [kani] kani/Intrinsics/MinNum/minnumf64.rs

The failures are in this form (the exact missing function differs):

Failed Checks: undefined function should be unreachable
 File: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h", line 211, in __inline_isnand

Activity

  1. added
    [C] Bug
    on Dec 13, 2022
  2. aaronbembenek-aws commented on Dec 13, 2022

    @aaronbembenek-aws
    ContributorAuthor

    Here's the definition of __inline_isnand from math.h:

    __header_always_inline int __inline_isnand(double __x) {                                          
        return __x != __x;                                                                            
    }
  3. tautschnig commented on Dec 13, 2022

    @tautschnig
    Member

    So there must be some error or warning printed by the combination of goto-cc, goto-instrument, cbmc run by CBMC on these. The above shows that, at that line, there is a definition, so the function can't be undefined...

  4. aaronbembenek-aws commented on Dec 13, 2022

    @aaronbembenek-aws
    ContributorAuthor

    Here's the definition of __inline_isnand from math.h:

    __header_always_inline int __inline_isnand(double __x) {                                          
        return __x != __x;                                                                            
    }

    FWIW, on my machine __header_always_inline expands to

    inline __attribute__ ((__always_inline__))
  5. aaronbembenek-aws commented on Dec 13, 2022

    @aaronbembenek-aws
    ContributorAuthor

    So there must be some error or warning printed by the combination of goto-cc, goto-instrument, cbmc run by CBMC on these. The above shows that, at that line, there is a definition, so the function can't be undefined...

    I'm not seeing anything obvious... I've run through the commands one at a time and the only warning I'm getting is this one from kani-compiler:

    warning: Found the following unsupported constructs:                             
                 - caller_location (1)                                               
             
             Verification will fail if one or more of these constructs is reachable. 
    
  6. tautschnig commented on Dec 14, 2022

    @tautschnig
    Member

    Could you please attach a zip archive containing the artifacts from running one of these tests with --keep-temps and also the output of --verbose?

  7. aaronbembenek-aws commented on Dec 14, 2022

    @aaronbembenek-aws
    ContributorAuthor

    I disabled the intrinsics tests and it turns out a bunch of other tests fail too; for example:

    $ kani tests/expected/trait-receiver/receiver_types.rs --harness check_box
    ...
    SUMMARY:
     ** 1 of 330 failed (8 unreachable)
    Failed Checks: undefined function should be unreachable
     File: "<built-in-additions>", line 17, in __CPROVER_deallocate

    The culprit CBMC commit is diffblue/cbmc@da4c6ec463.

    Here's a zip archive with the files for this test: receiver_types.zip

  8. added
    [F] Spurious Failure
    T-CBMC
    on Dec 14, 2022
  9. changed the title [-]Regression tests for intrinsics fail on M1 Mac[/-] [+]Regression tests for intrinsics fail on M1 and Intel Macs[/+] on Dec 19, 2022
  10. aaronbembenek-aws commented on Dec 19, 2022

    @aaronbembenek-aws
    ContributorAuthor

    The same tests fail on an Intel Mac when using CBMC 5.72.2 (and pass when using CBMC 5.72.0).

  11. tautschnig commented on Dec 22, 2022

    @tautschnig
    Member

    See my update in #2020: diffblue/cbmc#7453 will fix this bug. Thank you for reporting and bisecting!

  12. tautschnig commented on Jan 11, 2023

    @tautschnig
    Member

    While diffblue/cbmc#7453 fixed one bug, it didn't fully fix the issue. I'll post another bugfix shortly, and can even demonstrate that this was an issue with C code as well, it's not Kani/Rust specific.

  13. tautschnig commented on Jan 12, 2023

    @tautschnig
    Member

    diffblue/cbmc#7475 is the fix on the CBMC side, and I've confirmed that the above regressions now pass on macOS.

  14. removed their assignment
    on Jan 12, 2023
  15. tautschnig commented on Jan 13, 2023

    @tautschnig
    Member

    diffblue/cbmc#7453 is now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-CBMC[C] Bug[F] Spurious Failure

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions