Age | Commit message (Collapse) | Author |
|
putenv(3) and friends aren't thread-safe regardless of how you slice
it; a global lock around all environment operations (like before)
keeps things safe as far as our own operations go, but we have
absolutely no control over what libc or a library dragged in by a
driver/NIF does -- they're free to call getenv(3) or putenv(3)
without honoring our lock.
This commit solves this by setting up an "emulated" environment which
can't be touched without going through our interfaces. Third-party
libraries can still shoot themselves in the foot but benign uses of
os:putenv/2 will no longer risk crashing the emulator.
|
|
|
|
by suppressing DOP_MONITOR_P, DOP_MONITOR_P_EXIT and DOP_DEMONITOR_P
if not supported by the remote node.
In 17e198d6ee60f7dec9abfed272cf4226aea44535
I changed the behavior of erlang:monitor
to not raise badarg for c-nodes but instead create
a monitor to only supervise the connection.
But I forgot to prevent DOP_MONITOR_P and friends from being
sent to the node that does not expect them.
Note: We test both DFLAG_DIST_MONITOR and DFLAG_DIST_MONITOR_NAME
for the node to support process monitoring. This is because
erl_interface is buggy as it sets DFLAG_DIST_MONITOR without
really supporting it.
ToDo: Should erl_interface stop setting DFLAG_DIST_MONITOR
or should we change the meaning of these flags?
|
|
We should break out when out of reductions.
|
|
* sverker/async-auto-connect/OTP-14370: (37 commits)
Move new|abort_connection_id to erts_internal
Refactor erts_dsig_prepare argument dep(p)
Cleanup net_kernel
Improve connection aborting
Abort all pending connections if net_kernel terminates
erts: Put pending DistrEntry in separate list
Refactor auto_connect into an outline function
Remove unused ERTS_DSP_RWLOCK
fix erlang specs and preloaded
erts: Keep magic ref to DistEntry in net_kernel
Allow DistEntries in ETS
Remove faulty assert
erts: Transcode tuple fallbacks
erts: Ensure enc_term_int() always do progress
erl_interface: Add tuple fallback tests
erl_interface: Refactor ei_accept_SUITE
Add optimistic DFLAG_DIST_HOPEFULLY for pending connections
erts: Fix auto-connect toward erl_interface/jinterface
erts: Let send(_,_,[noconnect]) enqueue msg on pending connection.
Remove obsolete erlang:dgroup_leader
...
|
|
* maint:
Fix triggering of node monitors
Conflicts:
erts/emulator/beam/dist.c
|
|
* rickard/node-mon-proc-exit-race/OTP-14781:
Fix triggering of node monitors
|
|
and drop _id suffix.
|
|
Don't need to be pointer-pointer
|
|
|
|
|
|
|
|
and abort_pending_connection into own utility function.
|
|
to make sure it's kept alive.
|
|
Send may have failed, port exit with dist_entry cleaned up
and then new pending connection with queued messages.
|
|
When finalizing outgoing distribution messages
we transcode them into using tuple fallbacks if the
receiver does not support bitstrings and export-funs.
This can only happen if the message was first encoded toward
a pending connection when the receiver was unknown.
It's an optimistic approach optmimized for modern beam nodes,
that expect real bitstrings and funs (since <R13).
Only erl_interface/jinterface lack this support.
|
|
to avoid tuple fallbacks for export funs and bitstrings.
ToDo: Re-encode if receiver turn out to be erl_interface/jinterface.
|
|
|
|
|
|
|
|
|
|
|
|
Removed distribution_SUITE:applied_monitor_node
as it seems to test apply of trapping BIF
and monitor_node does not trap anymore.
|
|
|
|
|
|
* rickard/dist/OTP-14459:
Fix setnode/3 and erts_net_message()
|
|
|
|
Conflicts:
erts/emulator/beam/bif.c
erts/emulator/beam/dist.c
erts/emulator/beam/dist.h
erts/emulator/beam/erl_bif_info.c
erts/emulator/beam/erl_node_tables.c
erts/emulator/beam/erl_node_tables.h
erts/emulator/beam/external.c
|
|
|
|
|
|
|
|
|
|
|
|
This refactor was done using the unifdef tool like this:
for file in $(find erts/ -name *.[ch]); do unifdef -t -f defile -o $file $file; done
where defile contained:
#define ERTS_SMP 1
#define USE_THREADS 1
#define DDLL_SMP 1
#define ERTS_HAVE_SMP_EMU 1
#define SMP 1
#define ERL_BITS_REENTRANT 1
#define ERTS_USE_ASYNC_READY_Q 1
#define FDBLOCK 1
#undef ERTS_POLL_NEED_ASYNC_INTERRUPT_SUPPORT
#define ERTS_POLL_ASYNC_INTERRUPT_SUPPORT 0
#define ERTS_POLL_USE_WAKEUP_PIPE 1
#define ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE 1
#undef ERTS_HAVE_PLAIN_EMU
#undef ERTS_SIGNAL_STATE
|
|
The implementation is still hidden behind ERTS_ENABLE_LOCK_COUNT, and
all categories are still enabled by default, but the actual counting can be
toggled at will.
OTP-13170
|
|
|
|
|
|
|
|
|
|
|
|
Conflicts:
erts/emulator/beam/erl_binary.h
erts/emulator/beam/erl_monitors.c
erts/emulator/beam/erl_nif.c
erts/emulator/beam/global.h
erts/emulator/test/nif_SUITE_data/nif_SUITE.c
|
|
* fix-source-typos: (25 commits)
Fixed typos in system/doc
Fixed typos in lib/xmerl
Fixed typos in lib/wx
Fixed typos in lib/stdlib
Fixed typos in lib/snmp
Fixed typos in lib/ssl
Fixed typos in lib/ssh
Fixed typos in PKCS-8.asn1 file
Fixed typos in lib/parsetools
Fixed typos in lib/orber
Fixed typos in lib/mnesia
Fixed typos in lib/megaco
Fixed typos in lib/kernel
Fixed typos in lib/jinterface
Fixed typos in lib/inets
Fixed typos in lib/hipe
Fixed typos in lib/eunit
Fixed typos in lib/erl_interface
Fixed typos in lib/eldap
Fixed typos in lib/edoc
...
|
|
A magic destructor can return 0 and thereby take control
and prolong the lifetime of a magic binary.
|
|
|
|
|
|
|
|
* maint:
Atomic reference count of binaries also in non-SMP
Conflicts:
erts/emulator/beam/erl_fun.c
|
|
NIF resources was not handled in a thread-safe manner in the runtime
system without SMP support.
As a consequence of this fix, the following driver functions are now
thread-safe also in the runtime system without SMP support:
- driver_free_binary()
- driver_realloc_binary()
- driver_binary_get_refc()
- driver_binary_inc_refc()
- driver_binary_dec_refc()
|
|
A magic destructor can return 0 and thereby take control
and prolong the lifetime of a magic binary.
|
|
|