My julia code has segfault only on exit - is there a way to simply stop julia without calling into this finalization stuff

schlichtanders
Tue, 21 Nov 2023 15:52:56 +0000
General Usage

I just opened an issue for a segmentation fault with RCall which only happens on exit

github.com/JuliaInterop/RCall.jl

Segmentation fault on closing julia

opened 03:18PM - 21 Nov 23 UTC

schlichtanders

Hello, I just want to report that I run into a segmentation fault when closing …Julia again (aftr using RCall). ``` [1847] signal (11.1): Segmentation fault in expression starting at none:0 ijl_eh_restore_state at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/rtutils.c:265 _atexit at ./initdefs.jl:416 jfptr__atexit_46096.clone_1 at /usr/local/julia/lib/julia/sys.so (unknown line) _jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined] ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940 jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined] ijl_atexit_hook at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/init.c:280 jl_repl_entrypoint at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/jlapi.c:718 main at julia (unknown line) unknown function (ip: 0x7f95e9ce41c9) __libc_start_main at /lib/x86_[64](https://github.com/jolin-io/JolinWorkspaceTemplate/actions/runs/6945307045/job/18894379623?pr=54#step:11:65)-linux-gnu/libc.so.6 (unknown line) unknown function (ip: 0x4010b8) Allocations: 32734049 (Pool: 32[70](https://github.com/jolin-io/JolinWorkspaceTemplate/actions/runs/6945307045/job/18894379623?pr=54#step:11:71)1[76](https://github.com/jolin-io/JolinWorkspaceTemplate/actions/runs/6945307045/job/18894379623?pr=54#step:11:77)1; Big: 32288); GC: 42 ``` I have no minimal example, but I guess it could have something todo with me using an R function inside an async julia task, which somehow is not correctly finalized or prevents some other part from finalizing. The above error occurs on a docker container build on top julia:1.9, while when I run it on my local laptop, the same code does not throw an error, but hangs infinitely.

I would like to find a workaround, i.e. somehow kill Julia without running into those finalizers which cause segmentation fault.

It is really funny that everything works, only exiting Julia is the difficult part

2 posts - 2 participants