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

getindex() fails with Symbol-keys on Apple Silicon #52816

Closed
vlad-circadia opened this issue Jan 8, 2024 · 6 comments
Closed

getindex() fails with Symbol-keys on Apple Silicon #52816

vlad-circadia opened this issue Jan 8, 2024 · 6 comments

Comments

@vlad-circadia
Copy link

Version:

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M2 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 6 virtual cores

The bug:

julia> bar = Dict(:a=>1)
Dict{Symbol, Int64} with 1 entry:
  :a => 1

julia> bar[:a]
ERROR: KeyError: key :a not found
Stacktrace:
 [1] getindex(h::Dict{Symbol, Int64}, key::Symbol)
   @ Base ./dict.jl:498
 [2] top-level scope
   @ REPL[41]:1
@vlad-circadia
Copy link
Author

Similar error: KristofferC/OhMyREPL.jl#335

@vlad-circadia
Copy link
Author

A Linux installation has no issue:

julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 1 × Intel(R) Core(TM) i9-10980XE CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, cascadelake)
  Threads: 1 on 1 virtual cores
julia> bar = Dict(:a=>1)
Dict{Symbol, Int64} with 1 entry:
  :a => 1

julia> bar[:a]
1

@mbauman
Copy link
Sponsor Member

mbauman commented Jan 8, 2024

I cannot reproduce. Do you have anything in your startup or are you using a custom system image?

@vlad-circadia
Copy link
Author

Good point: the issue indeed is not present when julia is started without startup file:

➜  ~ julia --startup-file=no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0 (2023-12-25)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> bar = Dict(:a=>1)
Dict{Symbol, Int64} with 1 entry:
  :a => 1

julia> bar[:a]
1

In the startup file I've got:

➜  ~ cat .julia/config/startup.jl
using OhMyREPL
using Revise

OhMyREPL seems to be the culprit.

@mbauman mbauman closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
@KristofferC
Copy link
Sponsor Member

I'm quite surprised how OhMyREPL.jl can break dictionaries in general like that...

@vlad-circadia
Copy link
Author

I'm quite surprised how OhMyREPL.jl can break dictionaries in general like that...

Yeah, me too. I'd be curious to find out what's causing it though. May be it is something else that goes wrong with my setup...

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

No branches or pull requests

3 participants