Skip to content

fix: random crash atexit with multithread julia#763

Open
dpinol wants to merge 1 commit intoJuliaPy:mainfrom
Avatar-Cognition:fix-atexit-crash
Open

fix: random crash atexit with multithread julia#763
dpinol wants to merge 1 commit intoJuliaPy:mainfrom
Avatar-Cognition:fix-atexit-crash

Conversation

@dpinol
Copy link
Copy Markdown
Contributor

@dpinol dpinol commented Apr 21, 2026

Invoke Base._atexit instead of jl_atexit_hook to avoid invoking finalizers, which might crash with multithread julia

Invoke Base._atexit instead of jl_atexit_hook to avoid invoking finalizers, which might crash with multithread julia
@cjdoris
Copy link
Copy Markdown
Member

cjdoris commented May 7, 2026

Hmm I'd rather not rely on any more Julia internals (Base._atexit).

Perhaps jl_atexit_hook is being called from multiple threads and is not thread safe? Perhaps a lock and ensuring it only gets called once will.fox your issue.

Do you have a MWE for your issue?

@dpinol
Copy link
Copy Markdown
Contributor Author

dpinol commented May 7, 2026

Perhaps jl_atexit_hook is being called from multiple threads and is not thread safe? Perhaps a lock and ensuring it only gets called once will.fox your issue.

Do you have a MWE for your issue?

Will work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants