Age | Commit message (Collapse) | Author |
|
|
|
efile_drv is gone and so is the need for file-specific DTrace. The
new implementation works fine with the normal tracing mechanism so
there's nothing preventing anyone from making an erl_tracer nif
that forward these events to DTrace.
|
|
|
|
There doesn't seem to be any science behind the long delays, and
the (newly introduced) dry run forces us to eat them twice, so
they've been shortened to more reasonable values.
|
|
Code loading is done through dirty IO now, causing the
dirty_scheduler_exit tests to fail as they block their own progress
by invoking erts_debug:dirty_io(wait, _); the spawned processes
will exit normally before we have a chance to kill them.
To get around this, we perform a dry run to ensure that all required
code is loaded. It isn't particularly pretty (or fast) but it saves
us the hassle of maintaining a module list (cf. embedded mode).
|
|
This test is irrelevant as the new implementation doesn't use async
threads.
|
|
This improves the latency of file operations as dirty schedulers
are a bit more eager to run jobs than async threads, and use a
single global queue rather than per-thread queues, eliminating the
risk of a job stalling behind a long-running job on the same thread
while other async threads sit idle.
There's no such thing as a free lunch though; the lowered latency
comes at the cost of increased busy-waiting which may have an
adverse effect on some applications. This behavior can be tweaked
with the +sbwt flag, but unfortunately it affects all types of
schedulers and not just dirty ones. We plan to add type-specific
flags at a later stage.
sendfile has been moved to inet_drv to lessen the effect of a nasty
race; the cooperation between inet_drv and efile has never been
airtight and the socket dying at the wrong time (Regardless of
reason) could result in fd aliasing. Moving it to the inet driver
makes it impossible to trigger this by closing the socket in the
middle of a sendfile operation, while still allowing it to be
aborted -- something that can't be done if it stays in the file
driver.
The race still occurs if the controlling process dies in the short
window between dispatching the sendfile operation and the dup(2)
call in the driver, but it's much less likely to happen now.
A proper fix is in the works.
--
Notable functional differences:
* The use_threads option for file:sendfile/5 no longer has any
effect.
* The file-specific DTrace probes have been removed. The same
effect can be achieved with normal tracing together with the
nif__entry/nif__return probes to track scheduling.
--
OTP-14256
|
|
|
|
If a NIF monitor fired while the resource was present in an ETS
table, the lock checker would erroneously report a lock order
violation.
This has no effect outside of debug builds.
|
|
This introduces a way to retrieve erlang terms from NIF IO queues
without having to resort to copying.
OTP-14797
|
|
|
|
Document enif_realloc and pointer alignment guarantees
|
|
* maint:
Fix max atom size overflow on 64-bits Erlang by lowering the MAX_ATOM_TABLE_SIZE
Fix integer overflow when set a large maximum value for atom table
|
|
Fix integer overflow when set a large maximum value for atom table
OTP-14796
|
|
|
|
|
|
|
|
|
|
|
|
When compiling Erlang source code, the literal area for the
module can only contain data types that have a literal
syntax.
However, it is possible to sneak in other data types
(such as references) in the literal pool by compiling from
abstract or assembly code. Those "fake literals" would work
fine, but would crash the runtime system when the module containing
the literals was purged.
Although fake literals are not officially supported, the
runtime should not crash when attempting to use them.
Therefore, fix the garbage collection of literals and releasing
of literal areas.
https://bugs.erlang.org/browse/ERL-508
|
|
* maint:
Use base64 encoding in crash dumps
Correct parsing of sub binaries
Generalize passing of options for decoding
|
|
* bjorn/base64-in-dumps/OTP-14686:
Use base64 encoding in crash dumps
Correct parsing of sub binaries
Generalize passing of options for decoding
|
|
The retry loop wasn't working anyway as it tested fd<0
instead of res.
So, there is no real semantic change here.
|
|
|
|
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.
|
|
|
|
This will reduce the size of crash dumps, especially if
there are large binaries.
|
|
MAX_ATOM_TABLE_SIZE
Currently, the max atom size on 64-bits Erlang is
((UWORD_CONSTANT(1) << 32) = 4294967296
This number will cause the range of atom size to be displayed as
[8192-0].
Also, the +t option for max atom size will be parsed as a long type, and
assigned to a int variable erts_atom_table_size (erl_init.c),
which will cause integer overflow if the number is larger than the
maximum value a 4-bytes signed integer can hold
((1 << 31) - 1) = 2147483647
Therefore, during the comparison
erts_atom_table_size < MIN_ATOM_TABLE_SIZE
any number above 2147483647 will be come negative, and causing
the condition to be true, which then errored out as bad atom table size.
Hence, the actual max atom size is same as the max signed int value.
|
|
When setting maximum atom table size using +t option, there will be a
integer overflow for a large size.
$ erl +t2147482625
ll_alloc: Cannot allocate 18446744073692774400 bytes of memory
(of type "atom_tab").
The overflow is caused by the arithmetic operations on int type.
When 2147482625 + 1024 it will become -2147483647 due to the signed
integerger overflow. Then the result will be resized to Uint type, which
is a unsigned long type, the negative int will first be expand to 64
bits long via sign extension, then change to unsigned type, which
becomes 18446744073692774400.
The fix is done by convert `limit` to Uint type before doing any
arithmetic operation. This will expand variable to 64 bits long type via
zero extension, then the following operation are all positive, therefore
no overflow will happen.
Note: here we assume the int `limit` passed in is always positive. If
some future change cause the `limit` passed in maybe negative, then the
current fix will also cause overflow.
|
|
HiPE: Optimise receives matching unique references
|
|
* maint:
Updated OTP version
Prepare release
ssh: testcases for space trailing Hello msg
ssh: Don't remove trailing WS in Hello msg
ssh: dialyzer fixes
ssh: Fix broken error handling during session setup
Remove invalid EINTR loop around close(2)
Conflicts:
OTP_VERSION
|
|
* maint-20:
Updated OTP version
Prepare release
ssh: testcases for space trailing Hello msg
ssh: Don't remove trailing WS in Hello msg
ssh: dialyzer fixes
ssh: Fix broken error handling during session setup
Remove invalid EINTR loop around close(2)
Conflicts:
lib/ssh/test/ssh_options_SUITE.erl
|
|
|
|
* lukas/system/improve_profile_docs/OTP-14633:
erts: Add term2bin note about encoding guarantee
Fix broken link in INSTALL howto
system: Add info to profiling effeciency guide
Update message queue and pinfo binary docs
kernel: Clarify gen_tcp:listen documentation
system: Add External OSS tools section to profiling guilde
|
|
|
|
* lukas/docs/xmllint_fixes/OTP-14721:
ssl/ssh: Remove/ignore unused XML_FILES doc files
Refactor xmllint check and make it fail on failure
Add toplevel xmllint make target
Conflicts:
lib/crypto/doc/src/Makefile
|
|
* bjorn/make_port/OTP-14704:
Avoid using the efile driver in test suites
|
|
* lukas/stdlib/maps_iterators/OTP-14012:
erts: Limit size of first iterator for hashmaps
Update primary bootstrap
Update preloaded modules
erts: Remove erts_internal:maps_to_list/2
stdlib: Make io_lib and io_lib_pretty use maps iterator
erts: Implement batching maps:iterator
erts: Implement maps path iterator
erts: Implement map iterator using a stack
stdlib: Introduce maps iterator API
Conflicts:
bootstrap/lib/stdlib/ebin/io_lib.beam
bootstrap/lib/stdlib/ebin/io_lib_pretty.beam
erts/emulator/beam/bif.tab
erts/preloaded/ebin/erlang.beam
erts/preloaded/ebin/erts_internal.beam
erts/preloaded/ebin/zlib.beam
|
|
|
|
|
|
This function is no longer needed as maps:iterator has
now been implemented.
|
|
This iterator implementation fetches multiple elements to
iterate over in one call to erts_internal:maps_next instead
of one at a time. This means that the memory usage will go
up for the iterator as we are buffering elements, but the
usage is still bounded.
In this implementation the max memory usage is 1000 words.
Using this approach makes the iterator as fast as using
maps:to_list, so maps:iterator/2 has been removed.
|
|
|
|
The efile driver will soon be reimplemented as a BIF.
Instead of opening a port based on efile, use hd(erlang:ports()). It
is a reasonable safe assumption that the runtime will continue to use
use at least some ports.
|
|
|