Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precompiling gave AssertionError: fieldoffset(CheckPadAfter64, 3) == CACHELINE_SIZE #35

Closed
anandijain opened this issue Sep 21, 2021 · 6 comments · Fixed by #37
Closed

Comments

@anandijain
Copy link

(ConcurrentCollections) pkg> st
     Project ConcurrentCollections v0.1.0
      Status `~/.julia/dev/ConcurrentCollections.jl/Project.toml` (empty project)

julia> versioninfo()
Julia Version 1.7.0-rc1
Commit 9eade6195e (2021-09-12 06:45 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin20.5.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_EDITOR = code

maybe you're already aware of this. thanks for the package btw

@tkf
Copy link
Member

tkf commented Sep 21, 2021

Thanks for the report! I don't have a macOS and so I didn't know this :)

@tkf
Copy link
Member

tkf commented Sep 21, 2021

Hmm... it worked on github action: https://github.com/tkf/ConcurrentCollections.jl/pull/36/checks?check_run_id=3659030733#step:3:31

Julia Version 1.8.0-DEV.563
Commit 4f3a89e3ab (2021-09-20 19:34 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, ivybridge)

Do you mind checking this in your REPL?

julia> primitive type PadAfter64 448 end

julia> mutable struct CheckPadAfter64
           a::UInt64
           pad::PadAfter64
           b::UInt64
       end

julia> fieldoffset(CheckPadAfter64, 3)
0x0000000000000040

@anandijain
Copy link
Author

anandijain commented Sep 21, 2021

yeah notice that the action is using x86 darwin not arm.

julia> primitive type PadAfter64 448 end

julia> mutable struct CheckPadAfter64
           a::UInt64
           pad::PadAfter64
           b::UInt64
       end

julia> fieldoffset(CheckPadAfter64, 3)
0x0000000000000050

@tkf
Copy link
Member

tkf commented Sep 21, 2021

Ah, I see. Does ARM use a different alignment rule?

@anandijain
Copy link
Author

not sure, but ive run into a bunch of other issues using m1 so i figured it was related

@tkf
Copy link
Member

tkf commented Sep 21, 2021

OK, thanks. Need more digging...

Edit: clang seems to use 64 for both x84_64 and armv8 https://godbolt.org/z/PorhGc1sf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants