On a VM with SMP disable it happens to see the following error that causes the immediate termination of the VM itself.
This happens using 2 sockets (one push one sub) belonging to 2 different contexts.
enif_send: env==NULL on non-SMP VM 3494 abort
VM on which the error occurs
Erlang R14B02 (erts-5.8.3) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]
error seems to come from the emulator https://github.com/erlang/otp/blob/dev/erts/emulator/beam/erl_nif.c#L318
it will not work on non-SMP VMs, as enif_send can't work without SMP