Skip to content

Commit d8cb3b2

Browse files
add test
1 parent 19391ab commit d8cb3b2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/regex.jl

+8
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,11 @@ end
245245
@test match(re, "ababc").match === SubString("ababc", 3:5)
246246
end
247247
end
248+
249+
@testset "#57817: Don't free Regex during exit finalizer calls" begin
250+
# this shouldn't segfault
251+
cmd = `$(Base.julia_cmd()) -t2 --startup-file=no -e 're = Regex(""); Threads.@spawn match(re, "", 1, UInt32(0))'`
252+
for i in 1:10
253+
@test success(pipeline(cmd, stderr=stderr))
254+
end
255+
end

0 commit comments

Comments
 (0)