Closed OTP-Maintainer closed 3 years ago
sverker
said:
This looks like a process heap corruption.
Instead of finding a pointer to a node entry, it finds the value 1 which is then passed to erts_deref_node_entry().
If you have own linked in drivers or NIF modules then I would recommend running the application with debug compiled emulator and hope for an earlier nicer crash.
silviu
said:
Hello,
OK will do this. Currently we are building the VM using:
OTP_RELEASE=21.1
wget https://github.com/erlang/otp/archive/OTP-$OTP_RELEASE.zip
unzip OTP-$OTP_RELEASE.zip
cd otp-OTP-$OTP_RELEASE
./otp_build autoconf
./configure --with-dynamic-trace=lttng
export MAKEFLAGS=-j8
make
sudo rm -rf /usr/local/lib/erlang
sudo make install
There are multiple NIF libraries used but none was updated and we never hit this crash on 19.3. Only thing we did was to build VM using lttng (on 19.3 is not).
What flags we should use for debug compile?
sverker
said:
between make and install do
{noformat}
(cd erts/emulator && make debug)
{noformat}
Then start with
{noformat}
erl -emu_type debug
{noformat}
If that fails with "_erlexec: The emulator '/.../bin/beam.debug.smp' does not exist._" (which it did for me) or if you just want to skip doing a new install, then copy bin/<target>/beam.debug.smp and erl_child_setup.debug into the install directory next to beam.smp and erl_child_setup.
Note that debug VM can be a several times slower than default optimized VM.
silviu
said:
Thanks,
Running the VM in debug mode made us to discover a critical issue into one of our NIF cassandra driver:
https://github.com/silviucpp/erlcass/commit/c1a8305f0687bd8a7957078855230e66a21ddb4e
Seems debug mode have lot of memory checks. Not sure if this NIF bug is the problem of the current crash yet because that function is executed only when server starts to create all prepared statements. And also the bug is there for 2 years while we didn't had this kind of crash till now.
I'll keep you posted if anything will trigger
Silviu
Original reporter:
silviu
Affected version:OTP-21.1
Component:erts
Migrated from: https://bugs.erlang.org/browse/ERL-895