Unexpected Segfault on `deepcopy` (perhaps in GC, JL 1.4)

Hi Community,

We recently got a segfault on a deepcopy of a larger composite Julia object. This is the first of it’s kind in many years of use. We’re tracking that as an issue in the local package, with details and stacktrace via link there:

This occurred on Github Actions during regular package CI testing. This was on Julia 1.4.2, and Ubuntu 18.04. I thought I’d post a notice here in Discourse to help document Segfaults, and in case there were more events known in the wider community. An Internet search did not find anything immediately related. I will post again if we see or learn more.

The stracktrace is quite deep, but near the middle it points to deepcopy.jl and datatype.c:

...
jl_isa at /buildworker/worker/package_linux64/build/src/subtype.c:2056
jl_new_structv at /buildworker/worker/package_linux64/build/src/datatype.c:928
deepcopy_internal at ./deepcopy.jl:83
deepcopy at ./deepcopy.jl:26
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2145 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2323
#copyGraph!#46 at /home/runner/.julia/packages/DistributedFactorGraphs/E4dK8/src/services/AbstractDFG.jl:929
...

The top of the stacktrace points to gc.c

I believe this was fixed in v1.5, as v1.4 is pretty old and unsupported now. Can you upgrade?

Hi Jameson, thanks for the reply, sure yes we are on Julia 1.5 now. This was a legacy test still running on Travis at 1.4 (but error was quite unexpected). Good to know there was a fix in 1.5. I did not immediately find anything when I searched for information so thought this might help document. Thanks again.

it was this:

commit 3da2c52f4af0931e0dac7c2bbd579d340d260810
Author: Jeff Bezanson <jeff.bezanson@gmail.com>
Date:   Tue May 5 14:39:24 2020 -0400

    fix #35708, GC seeing uninitialized struct in `jl_new_struct*` (#35737)
2 Likes