Skip to content

Commit

Permalink
don't print task backtrace for GC threads (JuliaLang#51413) (#78)
Browse files Browse the repository at this point in the history
GC threads don't have tasks associated with them.
  • Loading branch information
kpamnany authored and RAI CI (GitHub Action Automation) committed Jan 24, 2024
1 parent 7256d86 commit 1c43970
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stackwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,12 +1158,18 @@ JL_DLLEXPORT void jl_print_backtrace(void) JL_NOTSAFEPOINT
jlbacktrace();
}

extern int gc_first_tid;

// Print backtraces for all live tasks, for all threads, to jl_safe_printf stderr
JL_DLLEXPORT void jl_print_task_backtraces(int show_done) JL_NOTSAFEPOINT
{
size_t nthreads = jl_atomic_load_acquire(&jl_n_threads);
jl_ptls_t *allstates = jl_atomic_load_relaxed(&jl_all_tls_states);
for (size_t i = 0; i < nthreads; i++) {
// skip GC threads since they don't have tasks
if (gc_first_tid <= i && i < gc_first_tid + jl_n_gcthreads) {
continue;
}
jl_ptls_t ptls2 = allstates[i];
if (ptls2 == NULL) {
continue;
Expand Down
5 changes: 5 additions & 0 deletions uv_constants.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-mmacosx-version-min=11.0

-P
-I/Users/dnetto/RAI/julia-RAI/usr/include
16

0 comments on commit 1c43970

Please sign in to comment.