Skip to content

Commit a6eee98

Browse files
committed
[Mmap] Skip ReadOnlyMemoryError test on PowerPC
1 parent 8f2b0e7 commit a6eee98

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

stdlib/Mmap/test/runtests.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,15 @@ m = Mmap.mmap(s, Vector{UInt8}, 1, sz+1)
9393
@test m[1] == 0x00
9494
close(s); finalize(m); m=nothing; GC.gc()
9595

96-
s = open(file, "r")
97-
m = Mmap.mmap(s)
98-
@test_throws ReadOnlyMemoryError m[5] = UInt8('x') # tries to setindex! on read-only array
99-
finalize(m); m=nothing; GC.gc()
96+
# See https://github.com/JuliaLang/julia/issues/32155
97+
# On PPC we receive `SEGV_MAPERR` instead of `SEGV_ACCERR` and
98+
# can thus not turn the segmentation fault into an exception.
99+
if !(Sys.ARCH === :powerpc64le || Sys.ARCH === :ppc64le)
100+
s = open(file, "r")
101+
m = Mmap.mmap(s)
102+
@test_throws ReadOnlyMemoryError m[5] = UInt8('x') # tries to setindex! on read-only array
103+
finalize(m); m=nothing; GC.gc()
104+
end
100105

101106
write(file, "Hello World\n")
102107

0 commit comments

Comments
 (0)