We've had mysterious OTP 27 crashes for quite some time now, but I was finally able to track it down to what I believe is a bug in :ets. When the :compressed table option is used, the system either segfaults or crashes with a memory-related error on any call that traverses the entire table. In our case, it was a call to :ets.foldl/3, but other full traversals like :ets.tab2list/1 or :ets.tab2file/2 also crash.
The temporary fix to get things working is to just not use :compressed on OTP 27. Unfortunately, this has a very sizeable impact on memory:
We may want to add user-level configuration to disable indexing for those who have to run OTP 27 on very large projects, but I think that should go in another PR.
One final note: I haven't reported this upstream yet because I was trying to create a more minimal reproduction, but I've unfortunately not been able to. I'm going to spend a bit more time this morning trying to reproduce, but I'll likely submit a bug report later regardless; perhaps someone more familiar with ETS will have suggestions for how to minimally recreate the environment that's causing the crash.
Fixes #788.
We've had mysterious OTP 27 crashes for quite some time now, but I was finally able to track it down to what I believe is a bug in
:ets
. When the:compressed
table option is used, the system either segfaults or crashes with a memory-related error on any call that traverses the entire table. In our case, it was a call to:ets.foldl/3
, but other full traversals like:ets.tab2list/1
or:ets.tab2file/2
also crash.The temporary fix to get things working is to just not use
:compressed
on OTP 27. Unfortunately, this has a very sizeable impact on memory:We may want to add user-level configuration to disable indexing for those who have to run OTP 27 on very large projects, but I think that should go in another PR.
One final note: I haven't reported this upstream yet because I was trying to create a more minimal reproduction, but I've unfortunately not been able to. I'm going to spend a bit more time this morning trying to reproduce, but I'll likely submit a bug report later regardless; perhaps someone more familiar with ETS will have suggestions for how to minimally recreate the environment that's causing the crash.