SIGN IN SIGN UP
JuliaLang / julia UNCLAIMED

The Julia Programming Language

0 0 124 Julia

SharedArrays: Skip a `finally` step if we throw before the `shmmem_create_pid` local is defined (#61141)

In theory, if we throw on line 116 (e.g. if `getpid()` or `randstring()`
throws), then we'll enter the `finally` block before we ever define
`shmmem_create_pid`. I think this case is unlikely, but if we do hit it,
we can't perform the `remotecall_fetch` call in the `finally` block,
because `shmmem_create_pid` won't be defined.

So this PR checks if `shmmem_create_pid` is defined before doing the
`remotecall_fetch` call.

Alternatively, we could lift lines 116 and 117 out of the `try` block,
at which point it will no longer be possible (as far as I can tell) for
us to throw before defining `shmmem_create_pid`.

---

Detected by JET.
D
Dilum Aluthge committed
7f1add2407aef3ca59106d0ba6bfc54bcdb7f718
Parent: 03f7bcd
Committed by GitHub <noreply@github.com> on 3/1/2026, 3:46:17 PM