From e335b02da4e466a410d09fdd1070c63692655e74 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Mon, 21 Aug 2023 17:14:01 -0400 Subject: [PATCH 1/2] RAI: update patch for PR 50858 It was backported before it was changed, approved and merged upstream. --- base/channels.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base/channels.jl b/base/channels.jl index 35885ecd9b311..4ba95f8f91082 100644 --- a/base/channels.jl +++ b/base/channels.jl @@ -166,14 +166,13 @@ Channel(func::Function, args...; kwargs...) = Channel{Any}(func, args...; kwargs function Channel(func::Function; ctype=nothing, csize=nothing, taskref=nothing, spawn=nothing, threadpool=nothing) # The spawn= keyword argument was added in Julia v1.3, and cannot be used with the # deprecated keyword arguments `ctype=` or `csize=`. - if (ctype !== nothing || csize !== nothing) && spawn !== nothing - throw(ArgumentError("Cannot set `spawn=` in the deprecated constructor `Channel(f; ctype=Any, csize=0)`. Please use `Channel{T=Any}(f, size=0; taskref=nothing, spawn=false)` instead!")) + if (ctype !== nothing || csize !== nothing) && (spawn !== nothing || threadpool !== nothing) + throw(ArgumentError("Cannot set `spawn=` or `threadpool=` in the deprecated constructor `Channel(f; ctype=Any, csize=0)`. Please use `Channel{T=Any}(f, size=0; taskref=nothing, spawn=false, threadpool=nothing)` instead!")) end # Set the actual default values for the arguments. ctype === nothing && (ctype = Any) csize === nothing && (csize = 0) spawn === nothing && (spawn = false) - threadpool !== nothing && (spawn = true) return Channel{ctype}(func, csize; taskref=taskref, spawn=spawn, threadpool=threadpool) end From e015382634953445155c9fa4f51aba05235e8313 Mon Sep 17 00:00:00 2001 From: K Pamnany Date: Mon, 21 Aug 2023 17:12:47 -0400 Subject: [PATCH 2/2] RAI: Prepend thread ID on backtrace of critical Julia errors Along with the signal number. --- src/stackwalk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stackwalk.c b/src/stackwalk.c index 042c82bb59e16..544b3e32bb05d 100644 --- a/src/stackwalk.c +++ b/src/stackwalk.c @@ -640,6 +640,7 @@ void jl_print_native_codeloc(int sig, uintptr_t ip) JL_NOTSAFEPOINT if (sig != -1) { jl_safe_printf("signal (%d) ", sig); } + jl_safe_printf("thread (%d) ", jl_threadid()); jl_frame_t frame = frames[i]; if (!frame.func_name) { jl_safe_printf("unknown function (ip: %p)\n", (void*)ip);