Skip to content

TestMul_64bit fails assertion on macOS aarch64 #413

@amoeba

Description

@amoeba

Describe the bug, including details regarding any error messages, version, and platform.

This assertion fails for me on my local macOS aarch64 machine against a very recent checkout:

assert.Greater(t, sqrtMinInt, int(math.Sqrt(math.MinInt64)))

I tested with,

$ go test -race -tags assert ./...
-- >8 -- 
--- FAIL: TestMul_64bit (0.00s)
    math_64bit_test.go:31:
        	Error Trace:	/Users/bryce/src/apache/arrow-go/internal/utils/math_64bit_test.go:31
        	Error:      	"-2147483648" is not greater than "0"
        	Test:       	TestMul_64bit
-- >8 -- 

The line of code in the test seems to have platform-specific behavior, specifically what int(math.Sqrt(math.MinInt64)) evaluates to:

  • On macOS aarch64, int(math.Sqrt(math.MinInt64)) = 0
  • In an amd64 VM, int(math.Sqrt(math.MinInt64)) = -9223372036854775808

Component(s)

Other

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions