souffle
souffle copied to clipboard
Stateful functors sometimes crash on prebuilt souffle, work correctly when built locally
Hi,
We've noticed crashes on code using stateful functors that occur only when using the prebuilt souffle
packages.
Setup a github action on our souffle-addon repository (used by Gigahorse), demonstrating this:
- job
build-and-test
runs on a container which includes souffle 2.4.1 built inside it. All commands are executed successfully. - job
build-and-test-with-package
gets the prebuilt package, crashes when runninglists_test.dl
The crash throws the following stack trace:
souffle lists_test.dl
souffle: /souffle/src/include/souffle/datastructure/ConcurrentFlyweight.h:290: const Key& souffle::ConcurrentFlyweight<LanesPolicy, Key, Hash, KeyEqual, KeyFactory>::fetch(souffle::ConcurrentFlyweight<LanesPolicy, Key, Hash, KeyEqual, KeyFactory>::lane_id, souffle::ConcurrentFlyweight<LanesPolicy, Key, Hash, KeyEqual, KeyFactory>::index_type) const [with LanesPolicy = souffle::ConcurrentLanes; Key = std::__cxx11::basic_string<char>; Hash = std::hash<std::__cxx11::basic_string<char> >; KeyEqual = std::equal_to<std::__cxx11::basic_string<char> >; KeyFactory = souffle::details::Factory<std::__cxx11::basic_string<char> >; souffle::ConcurrentFlyweight<LanesPolicy, Key, Hash, KeyEqual, KeyFactory>::lane_id = long unsigned int; souffle::ConcurrentFlyweight<LanesPolicy, Key, Hash, KeyEqual, KeyFactory>::index_type = long unsigned int]: Assertion `Idx < SlotCount.load(std::memory_order_relaxed)' failed.
Aborted (core dumped
The crash is caused by the following snippet in the lists_test.dl
:
.decl BreakSouffle(x:StringList)
BreakSouffle(["ddd", nil]).
BreakSouffle(@list_append(["ddd", nil], "ddd")) :- BreakSouffle(["ddd", nil]).
.output BreakSouffle