Age | Commit message (Collapse) | Author |
|
|
|
* lukas/erts/spawn_opt_max_heap_tc_fix:
erts: Fix process_SUITE:max_heap tests
|
|
|
|
|
|
If the main lock is not taken then any process running
on a dirty scheduler may cause all kinds of problems.
|
|
Conflicts:
erts/emulator/beam/bif.c
erts/preloaded/ebin/erlang.beam
erts/preloaded/ebin/erts_internal.beam
erts/preloaded/ebin/prim_file.beam
|
|
* lukas/erts/set_logger_process/OTP-15375:
Update preloaded modules
erts: Add erlang:system_flag(system_logger,_)
|
|
This flag allows logger and other components to set the
process which log messages from ERTS are to be sent.
|
|
* maint:
Fix passing large integers as base to integer_to_X/2
|
|
I noticed this seconds after merging... :(
|
|
* maint:
Implement integer_to_list/2 and integer_to_binary/2 as CIFs
Accept base in all integer-printing functions
Document cleanup semantics for atomics and counters
|
|
This makes them roughly as fast as integer_to_list/1 and
integer_to_binary/1.
|
|
|
|
* maint:
Remove an unused variable
Spawn prim_file helper as a system process
|
|
* john/erts/prim_file-init-restart/OTP-15495/ERL-821:
Remove an unused variable
Spawn prim_file helper as a system process
|
|
|
|
Custom message format for enif_select
|
|
Make sure to flush all queued emulator logger messages
before starting the test. The trap_exit_badarg could sometimes
leave messages and since the handler and messages now are
handled in different processes this becomes a problem.
|
|
|
|
|
|
Use microops for BIFs
|
|
|
|
|
|
|
|
* lukas/erts/inet_pktopts_old_linux/OTP-15494:
erts: Fix inet pktopts on very old linux kernels
|
|
|
|
* sverker/big-band-bug/ERL-804/OTP-15487:
erts: Fix bug in 'band' of two negative numbers, one big
|
|
maint-21
* sverker/fix-atomics-get-large-unsigned/PR-2061/OTP-15486:
erts: Fix possible heap corruption getting atomics
|
|
Conflicts:
erts/preloaded/ebin/atomics.beam
erts/preloaded/ebin/counters.beam
erts/preloaded/ebin/erl_prim_loader.beam
erts/preloaded/ebin/erl_tracer.beam
erts/preloaded/ebin/erlang.beam
erts/preloaded/ebin/erts_code_purger.beam
erts/preloaded/ebin/erts_dirty_process_signal_handler.beam
erts/preloaded/ebin/erts_internal.beam
erts/preloaded/ebin/erts_literal_area_collector.beam
erts/preloaded/ebin/init.beam
erts/preloaded/ebin/otp_ring0.beam
erts/preloaded/ebin/persistent_term.beam
erts/preloaded/ebin/prim_buffer.beam
erts/preloaded/ebin/prim_eval.beam
erts/preloaded/ebin/prim_file.beam
erts/preloaded/ebin/prim_inet.beam
erts/preloaded/ebin/prim_zip.beam
erts/preloaded/ebin/zlib.beam
|
|
* lukas/erts/fix-seq_trace-reset_trace/OTP-15490:
erts: Fix seq_trace:reset_trace dirty gc bug
erts: Use sys_memcpy in copy_one_frag
|
|
|
|
* sverker/big-band-bug/ERL-804/OTP-15487:
erts: Fix bug in 'band' of two negative numbers, one big
|
|
maint
* sverker/fix-atomics-get-large-unsigned/PR-2061/OTP-15486:
erts: Fix possible heap corruption getting atomics
|
|
* sverker/erts/prim_file-perm-own-bigendian/OTP-15485:
erts: Fix warning and potential big-endian-bug in prim_file
|
|
Make length/1 yielding
|
|
The guard BIF `length/1` would calculate the length of the list in one
go without yielding, even if the list was were long. To make it even
worse, the call to `length/1` would only cost a single reduction.
This commit reimplements `length/1` so that it eats a number of
reductions proportional to the length of the list, and yields if the
available reductions run out.
|
|
Similar bug as for bxor fixed by abc4fd372d476821448dfb9
Ex:
1> io:format("~.16B\n", [-16#1110000000000000000 band (-1)]).
-1120000000000000000
Wrong result for
(-X bsl WS) band -Y.
where
X is any positive integer
WS is erlang:system_info(wordsize)*8*N where N is 1 or larger
Y is any positive integer smaller than (1 bsl WS)
Fix:
The subtraction of 1 (for 2-complement conversion)
must be carried along all the way to the last words.
|
|
This allows bif1/2/3 to share the main part of the code.
The price is that we always need to copy all three temporary registers
when error handling in bodies, but that should be infrequent.
Additionally it makes it a bit harder to read the disasembly since now
the arguments to BIFs are in the reverse order.
|
|
Add missing annotations in instrs.tab
|
|
|
|
* lukas/erts/fix_lit_msg_copy_in_gc:
erts: Use ptr_val for pointer in gc msg copy
|
|
Due to comparison as a signed integer, when getting an unsigned atomic
in the range 2^63-1..2^64-1 (when the most significant bit was set), the
heap could get corrupted when the integer was retrieved: hsz would get
set to zero, but the code proceeded to build a bignum.
Steps to reproduce (at least on x86_64):
$ erl
1> A = atomics:new(1,[{signed,false}]).
2> atomics:put(A,1,18446744073709551615).
3> atomics:get(A,1).
At the last step, the shell would print some garbage and hang.
|
|
for set_permission and set_owner.
|
|
When seq_trace:reset_trace could be called while a
process was doing a dirty GC. This triggered a race
where all signals was moved to the internal signal
queue during the GC which in turn caused the a heap
overrun problem.
This fix makes it so that the main and msgq lock are
taken before the clear. This will make sure that we
are allowed to do the clear.
|
|
|
|
Dispatching a function and return never use the next instruction.
It's unlikely for raw_raise to use the next instruction.
|
|
Simplify implementation of GC BIFs
|
|
Summary: This commit simplifies the implementation of the "GC BIFs" so
that they no longer need to do a garbage collection, removing duplicate
code for all GC BIFs in the runtime system, as well as potentially
reducing the size of the loaded BEAM code by using shorter
instructions calling those BIFs.
A GC BIF is a guard BIF that will do a garbage
collection if it needs to build anything on the heap.
For example, `abs/1` is a GC BIF because it might need to
allocate space on the heap (if the result is a floating point
number or the resulting integer is a bignum).
Before R12, a guard BIF (such as `abs/1`) that need to allocate
heap space would allocate outside of process's main heap, in
a heap fragment.
GC BIFs were introduced in R12B to support literals. During garbage
collection it become necessary to quickly test whether a term was
a literal. To make the check simple, guards BIFs were no longer
allowed to create heap fragments. Instead GC BIFs were introduced.
In OTP 19, the implementation of literals was changed to support
storing messages in heap fragments outside of the main heap for a
process. That change again made it allowed for guard BIFs to create
heap fragments when they need to build terms on the heap.
It would even be possible for the guard BIFs to build directly
on the main heap if there is room there, because the compiler
assumes that a new `test_heap/2` instruction must be emitted
when building anything after calling a GC BIF. (We don't do that
in this commit; see below.)
This commit simplifies the implementation of the GC BIFs in
the runtime system.
Each GC BIF had a dual implementation: one that was used when the GC
BIF was called directly and one used when it was called via
`apply/3`. For example, `abs/1` was implemented in `abs_1()` and
`erts_gc_abs_1()`. This commit removes the GC version of each BIF. The
other version that allocates heap space using `HAlloc()` is updated to
use the new `HeapFragOnlyAlloc()` macro that will allocate heap
space in a heap fragment outside of the main heap.
Because the BIFs will allocate outside of the main heap, the same
`bif` instructions used by nonbuilding BIFs can be used for the
(former) GC BIFs. Those instructions don't use the macros that save
and restore the heap and stack pointers (SWAPOUT/SWAPIN). If the
former GC BIFs would build on the main heap, either new instructions
would be needed, or SWAPOUT/SWAPIN instructions would need to be added
to the `bif` instructions.
Instructions that call the former GC BIFs don't need the operand
that specifies the number of live X registers. Therefore, the
instructions that call the BIFs are usually one word shorter.
|
|
* bjorn/erts/remove-faulty-assertion:
erl_bif_list: Remove faulty assertion
|
|
* maint:
Fix reading beyond end of bignum in integer squaring
|