Segmentation fault in copy_string_to_graph

Please see the program in the attachment. I compile with:

clm -IL Platform -IL GraphCopy -exl -desc -tst -no-opt-link -ns -h 2000m TextFabric -o TextFabric

And run:

./TextFabric prep
./TextFabric load

In prep, a large (267MB) data structure is built which is stored in out.db with copy_to_string_with_names. In load, this data structure is deserialized using copy_from_string_with_names. This leads to a segmentation fault in copy_string_to_graph.c:69 (function copy_string_to_graph). Although there is some sharing, the data structure is not complex (no cycles).

When I add # i = trace_n i i; at the start of replace_desc_numbers_by_descs (graph_copy_with_names.icl), the program exits correctly. This should not have any influence, so perhaps copy_string_to_graph does not play well with the garbage collector?

segfault.tar.gz