Closed tmaklin closed 6 months ago
Hi! I fixed the problem, it was due to some files remaining in the memory cache after the completion of a build task, that after some time were offloaded to disk on a directory that was already deleted. Now I remove the files associated with a task every time it finishes.
thanks!!
Link to files + code that reproduce the crash on my system (Fedora 39 Linux 6.6.13-200.fc39.x86_64) at the end.
Description
GGCAT API seems to have a bug where using the API to build many (> 100) graphs from the same instance initialized with
prefer_memory: true
eventually causes a panic with error message:I looked more into this by making the panicking function (
create_writing_underlying_file
in parallel-processor) print the file it's attempting to access, and the panic seems to be caused by the instance going into a state where it thinks that it has run out of memory after building some of the graphs. The first graphs are built normally in memory (no temporary files are created) but after a while the building seems to switch to 100% on disk. This eventually causes a crash with the error:because the file
tmp/build_graph_02d33ca3-550c-42c5-b3f2-993a06afe332/maximal-links.207
doesn't exist in the temporary directory.I also tried calling run_assembler directly but it results in the same crash, so it seems like the API isn't the issue.
Code
Reproducing
Download the files from https://drive.google.com/file/d/11wj5h6D40zgQcncmCbNRhBT73HeFiAec/view?usp=sharing and run using
cargo build --release && target/release/ggcat-tmpfiles-crash
.