Age | Commit message (Collapse) | Author |
|
|
|
Fix rounding bug in float_to_list/2
|
|
|
|
* fhunleth/binary_to_integer_chec/PR-1671/OTP-14879:
Fail if ':' is passed to binary_to_integer/2
|
|
* maint:
stdlib: Handle Unicode when formatting stacktraces
|
|
Example symptom:
1> float_to_list(0.145, [{decimals,1}]).
"0.2"
There were two problems in sys_double_to_chars_fast
1. Most serious was adding 0.55555555 / (10^D) instead of 0.5 / (10^D)
which imposed a 5.5% risk of a faulty rounding up.
2. Using fixpoint for frac_part which lost significant bits if F < 0.5
|
|
See also ERL-553 and ERL-544 (commit c3ddb0f).
|
|
* maint:
Fix encoding of filenames in stacktraces
|
|
* rickard/file-encoding-stacktraces/OTP-14847/ERL-544:
Fix encoding of filenames in stacktraces
|
|
|
|
|
|
Before:
1> binary_to_integer(<<":">>, 16).
3
After:
1> binary_to_integer(<<":">>, 16).
** exception error: bad argument
in function binary_to_integer/2
called as binary_to_integer(<<":">>,16)
Prior to this change, both list_to_integer/2 and binary_to_integer/2
would convert strings with values between ASCII '9' up to '0'+base for
base > 10. For example, when converting in base 16, you could pass ':',
';', '<', '=', '>', and '?' without getting an exception. This was due
to a missing check in c2int_is_invalid_char().
This change adds the missing check and a regression test for passing
':'. It also simplifies the code and tightens up an out-of-bounds check
to make it off-by-one rather than off-by-two.
|
|
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.
|
|
|
|
|
|
Symptom: "Closing pipe in state Waiting. Event lost?"
Snake oil:
Do erlang:yield() instead of busy spinning in "Waiting" state.
|
|
Add syntax in try/catch to retrieve the stacktrace directly
|
|
|
|
|
|
|
|
|
|
|
|
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 introduces a way to retrieve erlang terms from NIF IO queues
without having to resort to copying.
OTP-14797
|
|
|
|
|
|
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
|
|
* 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.
|
|
* 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
...
|
|
Fix broken receive mark after an exception
OTP-14782
|
|
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.
|
|
and remove ugly encoding fallback as {fun, ...}
DFLAGS_NEW_FUN_TAGS has been supported by vm/erl_interface/jinterface
since R13 or even older.
Renamed test case obsolete_funs to term2bin_tuple_fallbacks
and removed test for {fun,...} fallback
and added missing test for bitstring fallback {Binary, Bits}.
|
|
for set/get_internal_state calls.
|
|
to handle "lookup without refc++" correctly
which was introduced in 4dcb2ae7810a507b701a30072b2f514cab7ebbdb.
When decrementing refc to zero (in try_delete or prepare_try_delete)
we must always wait thread progress to make sure no thread has done
lookup without refc++ and is just about to do refc++ and thereby revive
the DistEntry. That is, we wait for a potential other thread to either
do refc++ or drop its pointer to the DistEntry.
And if that other thread does refc++ (in erts_ref_dist_entry)
it must also do the extra refc++ for the scheduled pending delete.
|
|
Add 'used' option for binary_to_term/2
|
|
|
|
|
|
When a ref is created before performing a receive that will only
receive message containing that ref, there is a compiler optimization
to avoid scanning messages that can't possible contain the newly
created ref.
Magnus Lång pointed out that the implementation of the optimization
is flawed. Exceptions or recursive calls could cause the receive
operation to scan the receive queue from a position beyond the expected
message (that is, the message containing the ref would never be
matched out). See the receive_opt_exception/1 and receive_opt_recursion/1
test cases in receive_SUITE.
It turns out that we can simplify the implementation of the
optimization while fixing the bug (suggested by Magnus Lång). We
actually don't need the c_p->msg.mark field. It is enough to have
c_p->msg.saved_pos; if it is non-zero, it is a valid position in the
message qeueue. All we need to do is to ensure that we clear
c_p->msg.saved_pos when a receive is exited normally or abnormally.
We can clear c_p->msg.saved_pos in JOIN_MESSAGE(), since it is called
both when leaving a receive because a message matched and because there
was a timeout and the 'after' clause was executed. In addition, we
need to clear c_p->msg.saved_pos when an exception is caught.
https://bugs.erlang.org/browse/ERL-511
|
|
Symptom: random rpc net_adm:ping returned pang
Use monitor_node to wait for failed connection
before we try to connect again.
|
|
for "+hmqd off_heap"
|
|
* sverker/systask-reqid-bug:
erts: Fix bug in systask scheduling
|
|
* sverker/systask-reqid-bug:
erts: Fix bug in systask scheduling
|