You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Next, then run the debug build. Here is what I see on my Linux systems
$ ./bin/erl -emu_type debug
beam/erl_nif.c:4440: Lock check assertion "erts_lc_rwmtx_is_rwlocked(&erts_driver_list_lock) || erts_has_code_mod_permission()" failed!
Currently no locks are locked by the unknown thread.
zsh: IOT instruction (core dumped) ./bin/erl -emu_type debug
$
Expected behavior
The runtime should start normally.
Affected versions
I am running maint but, from the git history, it seems like this might be a few years old.
Additional context
An assertion is tripped by erts_add_taint which is transitively called by erl_init without
erts_driver_list_lock being locked
and, since erts_start_schedulers has not yet been called, erts_has_code_mod_permission will always return false
From the commit history, it looks like tracking taint information for static NIFs was deliberate. However, it looks as if the invariants checked by erts_add_taint might not be relevant to static_nifs_init since
there is no interaction with the driver list that is protected by the aforementioned lock
and the call occurs too early for any interaction with the scheduler and the creation of values for the sched_data_key TLS key
Since there are no other calls to erts_add_taint at initialization time, checking !erts_initialized in the assertion seems to be sufficient to make the error go away without affecting any post-initialization calls to erts_add_taint.
The text was updated successfully, but these errors were encountered:
Describe the bug
Calls to
erts_add_taint
check invariants that are not established when called bystatic_nif_init
.To Reproduce
First, build Erlang/OTP with one or more static NIFs. This script should work
Next, then run the debug build. Here is what I see on my Linux systems
Expected behavior
The runtime should start normally.
Affected versions
I am running
maint
but, from the git history, it seems like this might be a few years old.Additional context
An assertion is tripped by
erts_add_taint
which is transitively called byerl_init
withouterts_driver_list_lock
being lockederts_start_schedulers
has not yet been called,erts_has_code_mod_permission
will always return falseFrom the commit history, it looks like tracking taint information for static NIFs was deliberate. However, it looks as if the invariants checked by
erts_add_taint
might not be relevant tostatic_nifs_init
sincesched_data_key
TLS keySince there are no other calls to
erts_add_taint
at initialization time, checking!erts_initialized
in the assertion seems to be sufficient to make the error go away without affecting any post-initialization calls toerts_add_taint
.The text was updated successfully, but these errors were encountered: