Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions test/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -633,20 +633,3 @@ end
@test n_avail(c) == 0
end
end

# Issue #49507: stackoverflow in type inference caused by close(::Channel, ::Exception)
@testset "close(::Channel, ::StackOverflowError)" begin
ch = let result = Channel()
foo() = try
foo()
catch e;
close(result, e)
end

foo() # This shouldn't fail with an internal stackoverflow error in inference.

result
end

@test (try take!(ch) catch e; e; end) isa StackOverflowError
end
17 changes: 17 additions & 0 deletions test/stack_overflow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,20 @@ let exename = Base.julia_cmd()
@show readchomperrors(`$exename -e "f() = f(); f()"`)
@show readchomperrors(`$exename -e "f() = f(); fetch(@async f())"`)
end

# Issue #49507: stackoverflow in type inference caused by close(::Channel, ::Exception)
@testset "close(::Channel, ::StackOverflowError)" begin
ch = let result = Channel()
foo() = try
foo()
catch e;
close(result, e)
end

foo() # This shouldn't fail with an internal stackoverflow error in inference.

result
end

@test (try take!(ch) catch e; e; end) isa StackOverflowError
end