Skip to content

Conversation

@d-netto
Copy link
Member

@d-netto d-netto commented Feb 28, 2025

PR Description

Let's enable the safepoint straggler bt printing unconditionally.

Checklist

Requirements for merging:

Copy link
Collaborator

@kpamnany kpamnany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, I suggest merging and backporting JuliaLang#57579 first, then confirming that this works as intended before we merge it.

d-netto and others added 2 commits March 2, 2025 15:17
…gler (JuliaLang#57579)

In the line of C code:

```C
const int64_t timeout = jl_options.timeout_for_safepoint_straggler_s * 1000000000;
```

`jl_options.timeout_for_safepoint_straggler_s` is an `int16_t` and
`1000000000` is an `int32_t`.

The result of `jl_options.timeout_for_safepoint_straggler_s *
1000000000` will be an `int32_t` which may not be large enough to hold
the value of `jl_options.timeout_for_safepoint_straggler_s` after
converting to nanoseconds, leading to overflow.
@d-netto d-netto force-pushed the dcn-enable-safepoint-straggler-unconditionally branch from 911ced5 to d61ad42 Compare March 2, 2025 18:18
@d-netto
Copy link
Member Author

d-netto commented Mar 2, 2025

I'd like to keep both commits in a single PR, and then, when it's time to merge we "rebase and merge" (as opposed to "squash and merge").

Anyway, this seems to work:

./julia -t8
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.2+RAI (2025-03-02)
 _/ |\__'_|_|_|\__'_|  |  dcn-enable-safepoint-straggler-unconditionally/d61ad42b07 (fork: 429 commits, 608 days)
|__/                   |

julia> function main()
           t = Threads.@spawn begin
               ccall(:uv_sleep, Cvoid, (Cuint,), 70_000)
           end
           # Force a GC
           ccall(:uv_sleep, Cvoid, (Cuint,), 10_000)
           GC.gc()
           wait(t)
       end
main (generic function with 1 method)

julia> main()
===== Thread 2 failed to reach safepoint after 60 seconds, printing backtrace below =====
thread (1) __semwait_signal at /usr/lib/system/libsystem_kernel.dylib (unknown line)

@d-netto d-netto merged commit 590b807 into v1.10.2+RAI Mar 2, 2025
2 checks passed
@d-netto d-netto deleted the dcn-enable-safepoint-straggler-unconditionally branch March 2, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants