Skip to content

Mmap.mmap regression from Julia 1.10.0 to 1.10.1 #54203

@JakeZw

Description

@JakeZw

I use the Raspberry PI for some work. This includes using the Package BaremetalPi to set pins high or low. This all works well with Julia 1.10.0 but not with 1.10.1. This is explained in more detail on discourse here.

The problem lies in Mmap as explained in Post 6 of the discourse link and repeated here. All commands were given on a Raspberry PI 4 with 8 Gig RAM. Julia was installed using Juliaup.

The output from 1.10.0 which is working is:

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 (aarch64-linux-gnu)
  CPU: 4 Ã Cortex-A72
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, cortex-a72)
  Threads: 1 on 4 virtual cores

julia> using Mmap

julia> io = open("/dev/gpiomem", "w+")
IOStream(<file /dev/gpiomem>)

julia> gpiomap = Mmap.mmap(io, Vector{UInt32}, (1024,), 0, grow=false)
1024-element Vector{UInt32}:
 0x21200900
 0x00040264
 0x12040000
 0x3fffffff
 0x00000064
 0x00000000
 0x00000000
 0x6770696f
 0x6770696f
 0x6770696f
          â®
 0x6770696f
 0x6770696f
 0x6770696f
 0x6770696f
 0x6770696f
 0x6770696f
 0x6770696f
 0x6770696f
 0x6770696f

And from 1.10.1 which errors is:

julia> versioninfo()
Julia Version 1.10.1
Commit 7790d6f0641 (2024-02-13 20:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (aarch64-linux-gnu)
  CPU: 4 Ã Cortex-A72
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, cortex-a72)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

julia> using Mmap

julia> io = open("/dev/gpiomem", "w+")
IOStream(<file /dev/gpiomem>)

julia> gpiomap = Mmap.mmap(io, Vector{UInt32}, (1024,), 0, grow=false)
ERROR: IOError: filesize: Illegal seek for <file /dev/gpiomem>
Stacktrace:
 [1] filesize(s::IOStream)
   @ Base ./iostream.jl:226
 [2] mmap(io::IOStream, ::Type{Vector{UInt32}}, dims::Tuple{Int64}, offset::Int64; grow::Bool, shared::Bool)
   @ Mmap ~/.julia/juliaup/julia-1.10.1+0.aarch64.linux.gnu/share/julia/stdlib/v1.10/Mmap/src/Mmap.jl:215
 [3] top-level scope
   @ REPL[4]:1

Version 1.10.2 has the same issue, I have not tested on 1.10.3 release candidate.

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