aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2019-07-02Merge branch 'poroh/erts/sched-stuck-fix/OTP-15941' into maint-21Erlang/OTP
* poroh/erts/sched-stuck-fix/OTP-15941: Infinite cycle fixed on try to change run queue (if it has already changed concurrently)
2019-07-02Merge branch 'sverker/system_info-procs-bug/ERL-979/OTP-15909' into maint-21Erlang/OTP
* sverker/system_info-procs-bug/ERL-979/OTP-15909: Fix fatal bug in erts_proc_sig_signal_size
2019-07-02Merge branch 'john/erts/lists_subtract_fixes/OTP-15938/OTP-15939' into maint-21Erlang/OTP
* john/erts/lists_subtract_fixes/OTP-15938/OTP-15939: erts: Fix integer overflow in loader erts: Fix integer overflow in list subtraction
2019-07-01erts: Fix integer overflow in loaderJohn Högberg
qsort expects the comparison function to return an int; returning an `Sint` may yield nonsensical results.
2019-07-01erts: Fix integer overflow in list subtractionJohn Högberg
CMP_TERM returned an `Sint`, which overflowed the `int` used in erl_rbtree for storing the comparison, causing list subtraction to behave strangely.
2019-06-28Infinite cycle fixed on try to change run queue (if it has already changed ↵Dmitry Poroh
concurrently)
2019-06-19Fix fatal bug in erts_proc_sig_signal_sizeSverker Eriksson
called by erlang:process_info(memory) erlang:system_info(procs) crash dump break menu Will crash VM if process has a pending monitor DOWN signal in its queue.
2019-06-17Merge branch 'rickard/dist-exit2/21/OTP-15867' into maint-21Erlang/OTP
* rickard/dist-exit2/21/OTP-15867: Don't disconnect on remote exit/2 with old incarnation as recipient
2019-06-17Merge branch ↵Erlang/OTP
'sverker/erts/process-info-reductions-idle-proc/ERL-964/OTP-15865' into maint-21 * sverker/erts/process-info-reductions-idle-proc/ERL-964/OTP-15865: erts: Improve test of process_info(reductions) Revert "erts: Force process_info(reductions) as signal"
2019-06-17Merge branch 'rickard/dist-exit2/20/OTP-15867' into ↵Rickard Green
rickard/dist-exit2/21/OTP-15867 * rickard/dist-exit2/20/OTP-15867: Don't disconnect on remote exit/2 with old incarnation as recipient
2019-06-17Don't disconnect on remote exit/2 with old incarnation as recipientRickard Green
2019-06-04Revert "erts: Force process_info(reductions) as signal"Sverker Eriksson
This reverts commit 70dbf671a8196110d2aee2e7507afc2c2c75183f. As the comment of 70dbf671a8 itself indicates, that "fix" is not really necessary. It has, however, the bad effect of always consuming reductions of the process you want to know reduction from, that is you can't meassure reduction count without affecting it.
2019-06-03Merge branch ↵Erlang/OTP
'sverker/seq-trace-label-old-heap-bug/ERL-700/OTP-15849/OTP-15858/OTP-15859' into maint-21 * sverker/seq-trace-label-old-heap-bug/ERL-700/OTP-15849/OTP-15858/OTP-15859: erts: Fix faulty spec for seq_trace:set_token/2 erts: Fix seq_trace:print/2 for arbitrary labels erts: Fix bug in seq_trace:set_token(label,_)
2019-06-03Merge branch 'bjorn/erts/fix-wrong-class/ERIERL-367/OTP-15834' into maint-21Erlang/OTP
* bjorn/erts/fix-wrong-class/ERIERL-367/OTP-15834: Fix sticky class in exception
2019-05-28erts: Fix seq_trace:print/2 for arbitrary labelsSverker Eriksson
Would raise badarg if Label was not atom or small integer.
2019-05-28erts: Fix bug in seq_trace:set_token(label,_)Sverker Eriksson
If internal seq-trace tuple is on old heap an incorrect ref from old to new heap was made.
2019-05-23Fix sticky class in exceptionBjörn Gustavsson
When catching an exception re-throwing with a changed class, the class could be changed to the original class if the exception got caught and rethrown in (for example) an after block: sticky_class() -> try try throw(reason) catch throw:Reason:Stack -> erlang:raise(error, Reason, Stack) end after ok end.
2019-05-14Merge branch 'john/erts/fix-xxx_to_existing_atom-overflow/ERL-944/OTP-15819' ↵Erlang/OTP
into maint-21 * john/erts/fix-xxx_to_existing_atom-overflow/ERL-944/OTP-15819: erts: Fix buffer overflow in xxx_to_existing_atom
2019-05-13erts: Fix buffer overflow in xxx_to_existing_atomJohn Högberg
2019-05-06Merge branch 'sverker/process_info-reductions-fix/OTP-15793' into maint-21Erlang/OTP
* sverker/process_info-reductions-fix/OTP-15793: erts: Force process_info(reductions) as signal erts: Fix another bug in process_info(reductions)
2019-05-03erts: Force process_info(reductions) as signalSverker Eriksson
Not 100% sure this is needed to get correct reductions as the direct query is not done if process is RUNNING anyway.
2019-04-24erts: Fix another bug in process_info(reductions)Sverker Eriksson
to disregard consumed virtual reductions which are not aggregated into p->reds and if included may cause reduction count go backwards.
2019-03-29Merge branch 'sverker/process_info-reductions-fix/OTP-15709' into maint-21Erlang/OTP
* sverker/process_info-reductions-fix/OTP-15709: erts: Fix bug in process_info(reductions) erts: Use ptr_val for pointer in gc msg copy
2019-03-28erts: Fix bug in process_info(reductions)Sverker Eriksson
returning incorrect result as * current process might not be RUNNING in which case REDS_IN is actually used as def_arg_reg[5] * FCALLS might not have been swapped out * the SAVED_CALLS case was wrong and returned number of reds left
2019-03-28erts: Use ptr_val for pointer in gc msg copySverker Eriksson
Cherry-pick: 3d7d66b84b69f3eb42e8bcd8dc510b6676e31cac Without this fix asserts would trigger in debug build but nothing else would break.
2019-03-27erts: Handle all signal types when clearing seq_trace tokenJohn Högberg
We walk through all signal queues in the system when clearing seq_trace, so we must be prepared to encounter all kinds of signals.
2019-03-21Merge branch 'max-au/erts/dirty_scheduler_shutdown/PR-2172/OTP-15690' into ↵Erlang/OTP
maint-21 * max-au/erts/dirty_scheduler_shutdown/PR-2172/OTP-15690: erts: release dirty runqueue lock before entering endless loop when BEAM is shutting down # Conflicts: # erts/emulator/beam/erl_process.c
2019-03-21erts: release dirty runqueue lock before entering endless loop when BEAM is ↵Maxim Fedorov
shutting down This patch fixes a problem happening when BEAM is shutting down. It is possible for a dirty scheduler to take the lock, and keep it, when the system is shutting down. It may also happen that a normal scheduler decides to schedule some dirty job (example is major garbage collection that results in migrating the process into dirty CPU queue), and hangs trying to take the lock that will never be released. To fix the problem, either release the lock before entering endless wait loop, or reverse the order in which schedulers are stopped. Either fix works, and, of course, it works even better to apply both.
2019-03-20Fix reception of resume signal on process executing dirtyRickard Green
If a suspend/resume signal pair was sent to a process while it was executing dirty the resume counter on the process got into an inconsistent state. This in turn could cause the process to enter a suspended state indefinitely.
2019-03-07Merge branch 'sverker/ets-no-mbuf-trapping/OTP-15660'Sverker Eriksson
into sverker/maint/ets-no-mbuf-trapping/OTP-15660
2019-03-07erts: Remove ets traversal yielding if heap fragmentSverker Eriksson
Many heap fragments do no longer make the GC slow. Even worse, we are not guaranteed that a yield will provoke a GC removing the fragments, which might lead to a one-yield-per-bucket scenario if the heap fragment(s) still remains after each yield.
2019-03-04Merge branch 'siri/logger/os-timestamp/OTP-15625' into maintSiri Hansen
* siri/logger/os-timestamp/OTP-15625: Update preloaded [logger] Change timestamp from erlang:system_time to os:system_time
2019-02-22erts: Fix macro redefinitionBjörn-Egil Dahlberg
LIST_NEXT and LIST_PREV causes macro redefinitions from other include files. beam/erl_ao_firstfit_alloc.c:103:9: warning: 'LIST_NEXT' macro redefined [-Wmacro-redefined] ^ /usr/include/sys/queue.h:507:9: note: previous definition is here ^ 1 warning generated. beam/erl_bestfit_alloc.c:125:9: warning: 'LIST_NEXT' macro redefined [-Wmacro-redefined] ^ /usr/include/sys/queue.h:507:9: note: previous definition is here ^
2019-02-22[logger] Change timestamp from erlang:system_time to os:system_timeSiri Hansen
This is to align the timestamps with external logs.
2019-02-20Merge branch 'sverker/erts/term_to_binary-reductions/ERL-774/OTP-15514' into ↵Sverker Eriksson
maint * sverker/erts/term_to_binary-reductions/ERL-774/OTP-15514: erts: Consume reductions for strings in term_to_binary erts: Reduce number of list traversals in term_to_binary
2019-02-20erts: Consume reductions for strings in term_to_binarySverker Eriksson
Cost per string byte, but we still don't yield mid-string.
2019-02-20Merge branch 'sverker/enif_consume_timeslice-dirty-nop/OTP-15604' into maintSverker Eriksson
* sverker/enif_consume_timeslice-dirty-nop/OTP-15604: erts: Make enif_consume_timeslice no-op on dirty sched
2019-02-19Merge branch 'sverker/heart-nice-exit/OTP-15599' into maintSverker Eriksson
* sverker/heart-nice-exit/OTP-15599: erts: Avoid heart killing a nicely exiting emulator
2019-02-18erts: Make enif_consume_timeslice no-op on dirty schedSverker Eriksson
2019-02-15erts: Reduce number of list traversals in term_to_binarySverker Eriksson
by patching list length when we reach end of list. And remove unnecessary traversals in is_string and is_external_string beyond the max length for STRING_EXT.
2019-02-15Merge pull request #2140 from ↵Björn Gustavsson
bjorng/bjorn/erts/persistent_term-default/ERL-843/OTP-15576 Add persistent_term:get(Key, DefaultValue)
2019-02-14erts: Avoid heart killing a nicely exiting emulatorSverker Eriksson
Symptom: Heart kills exiting emulator before is has flushed all ports and with HEART_KILL_SIGNAL=SIGABRT it may also produce unnecessary core dumps from doing init:reboot() for example. Problem: Heart port is closed together with all the others in handle_reap_ports() which is detected by heart OS process. Solution 1: Leave the heart port alone in handle_reap_ports() and let it be closed by OS when emulator exists. It doesn't need to be flushed anyway. Solution 2: When heart OS process gets EOF on connection let it wait max 5 seconds for emulator process to self terminate before trying to kill it.
2019-02-14Merge pull request #2118 from kjellwinblad/fix_valgrind_problem_bignum OTP-15583Kjell Winblad
Fix bug in binary:encode_unsigned causing a read of uninitialized memory
2019-02-14Merge branch 'john/erts/spectre-configure-flag-otp_20/OTP-15430/ERIERL-237' ↵Erlang/OTP
into maint-20 * john/erts/spectre-configure-flag-otp_20/OTP-15430/ERIERL-237: Allow disabling retpoline in interpreter loop Add a ./configure flag for spectre mitigation
2019-02-14Merge pull request #2113 from richcarl/optional-tuple-callsBjörn Gustavsson
Optional tuple calls OTP-15580
2019-02-14Add persistent_term:get(Key, DefaultValue)Björn Gustavsson
https://bugs.erlang.org/browse/ERL-843
2019-02-11Merge branch 'sverker/enif_select-faulty-assert' into maintSverker Eriksson
* sverker/enif_select-faulty-assert: erts: Fix faulty debug assert in enif_select
2019-02-11Merge branch 'sverker/map-from-ks-vs-bug/OTP-15567' into maintSverker Eriksson
* sverker/map-from-ks-vs-bug/OTP-15567: erts: Add test for bug in enif_make_maps_from_arrays erts: Fix bug in erts_map_from_ks_and_vs
2019-02-06erts: Fix faulty debug assert in enif_selectSverker Eriksson
2019-02-06Merge tag 'OTP-21.2' into sverker/map-from-ks-vs-bugSverker Eriksson