aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
AgeCommit message (Collapse)Author
2018-09-17Merge branch 'john/erts/improve-list-reverse-trapping/OTP-15199' into maintJohn Högberg
* john/erts/improve-list-reverse-trapping/OTP-15199: Improve trapping in lists:reverse/2 Fix unsafe use of lists:reverse/1
2018-09-13Improve trapping in lists:reverse/2John Högberg
If the process had more free space than reductions it could run a lot longer than it was supposed to. It didn't honor the number of reductions going in either, nor did it bump reductions when returning its result or erroring out. This commit also removes this function from a work function in scheduler_SUITE as it's extremely sensitive to the number of reductions spent in the test, causing equal_and_high_with_part_time_max to fail on some machines.
2018-09-12Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers erts: Fix "Prevent inconsistent node lists" fix Fix include-path regression caused by dd0a39c Restore default SIGTERM behaviour for port programs
2018-09-11Merge branch 'sverker/erts/fix-aborted-pending-connection-race/OTP-15296' ↵Erlang/OTP
into maint-21 * sverker/erts/fix-aborted-pending-connection-race/OTP-15296: erts: Fix "Prevent inconsistent node lists" fix
2018-09-11erts: Fix "Prevent inconsistent node lists" fixSverker Eriksson
done in a31216200bdee2c04b3fb3ae5e26607674715c8a that could cause a new pending connection to be incorrectly aborted.
2018-09-10Restore default SIGTERM behaviour for port programsRickard Green
erl_child_setup program ignores TERM signals as of ERTS version 10.0 (cff8dce0). This setting was unfortunately inherited by port programs. This commit restores handling of TERM signals in port programs to the default behavior. That is, terminate the process.
2018-09-06Merge branch 'rickard/pcre-8.42/OTP-15217' into maintRickard Green
* rickard/pcre-8.42/OTP-15217: Update PCRE from version 8.41 to version 8.42
2018-09-06Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers kernel: Fix missing abort_connection in net_kernel Prevent inconsistent node lists Fix an endless rescheduling loop when a process is executing process_info(self(), ...)
2018-09-06Merge pull request #1943 from max-au/handle_signals_before_dirty_gcRickard Green
Fix an endless rescheduling loop when a process is executing process_… OTP-15275
2018-09-05Merge branch 'rickard/dist-entry-gc-fix/OTP-15279' into maint-21Erlang/OTP
* rickard/dist-entry-gc-fix/OTP-15279: Prevent inconsistent node lists
2018-09-05Prevent inconsistent node listsRickard Green
If net_kernel "forgets" to abort a connection (as it currently might), the garbage collection of a distribution entry could cause node lists to enter an inconsistent state.
2018-09-05Merge branch 'sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278' into maintSverker Eriksson
* sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278: erts: Refactor ets FixedDeletion allocations erts: Fix ets memstat false leak of FixedDeletion
2018-09-04Fix an endless rescheduling loop when a process is executing ↵Maxim Fedorov
process_info(self(), ...) It is possible that a process has to yield before completing process_info BIF when it runs out of reductions. If this BIF is called by the process itself, it does not send a signal but executes in the context of a process. If it has to yield, it turns F_LOCAL_SIGS_ONLY flag on, which means new signals won't be fetched from the outer message queue. When the same process needs to execute dirty system code (e.g. dirty GC) it has to be run on a dirty scheduler. However signals enqueued into outer queue cause it to be rescheduled on a normal scheduler. F_LOCAL_SIGS_ONLY prevent outer queue signals delivery, creating an endless rescheduling loop. This commit disengages F_LOCAL_SIG_ONLY if process needs to execute dirty code in order to complete signal delivery and allow process to be moved to dirty run queue.
2018-09-04Merge PR-1920 from saleyn/float_to_list OTP-15276Sverker Eriksson
Fix bug in compact representation of float_to_list/2
2018-09-03erts: Refactor ets FixedDeletion allocationsSverker Eriksson
2018-09-03erts: Fix ets memstat false leak of FixedDeletionSverker Eriksson
causing erlang:memory to report too much ets memory.
2018-09-03ops.tab: Fix potentially unsafe optimization of raise/2Björn Gustavsson
The operands for the raise/2 instruction are almost always in x(2) and x(1). Therefore the loader translates the raise/2 instruction to an i_raise/0 instruction which uses the values in x(2) and x(1). If the operands happens to be in other registers, the loader inserts move/2 instruction to move them to x(2) and x(1). The problem is that x(3) is used as a temporary register when generating the move/2 instructions. That is unsafe if the Value operand for raise/2 is x(3). Thus: raise x(0) x(3) will be translated to: move x(0) x(3) move x(3) x(1) move x(3) x(2) i_raise The Trace will be written to both x(2) and x(1). The current compiler will never use x(3) for the Value operand, so there is no need to patch previous releases. But a future compiler version might allocate registers differently.
2018-08-31Fix an endless rescheduling loop when a process is executing ↵Maxim Fedorov
process_info(self(), ...) It is possible that a process has to yield before completing process_info BIF when it runs out of reductions. If this BIF is called by the process itself, it does not send a signal but executes in the context of a process. If it has to yield, it turns F_LOCAL_SIGS_ONLY flag on, which means new signals won't be fetched from the outer message queue. When the same process needs to execute dirty system code (e.g. dirty GC) it has to be run on a dirty scheduler. However signals enqueued into outer queue cause it to be rescheduled on a normal scheduler. F_LOCAL_SIGS_ONLY prevent outer queue signals delivery, creating an endless rescheduling loop. This commit disengages F_LOCAL_SIG_ONLY if process needs to execute dirty code in order to complete signal delivery and allow process to be moved to dirty run queue.
2018-08-30Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers Fix missing 'in' trace events during 'running' trace
2018-08-29Merge branch 'rickard/running-trace-fix/ERL-713/OTP-15269' into maint-21Erlang/OTP
* rickard/running-trace-fix/ERL-713/OTP-15269: Fix missing 'in' trace events during 'running' trace
2018-08-27Fix bug in compact representation of float_to_list/2Serge Aleynikov
2018-08-27Fix missing 'in' trace events during 'running' traceRickard Green
'in' trace events could be lost when a process had to be rescheduled on another scheduler type (normal <-> dirty).
2018-08-21Merge branch 'rickard/fix-suspend-monitor-down/OTP-15237/ERL-704' into maintRickard Green
* rickard/fix-suspend-monitor-down/OTP-15237/ERL-704: Fix incoming suspend monitor down
2018-08-20Fix incoming suspend monitor downRickard Green
An incoming suspend monitor down wasn't handled correct when the local monitor half had been removed with an emulator crash as result.
2018-08-15merge branch 'lukas/erts/fd_driver-fix_pollset_delete/ERL-692/OTP-15236' ↵Lukas Larsson
into maint erts: Delete fd from poll-set when closing fd_driver port
2018-08-10Merge branch 'rickard/full-cache-nif-env/OTP-15223/ERL-695' into maint-21Erlang/OTP
* rickard/full-cache-nif-env/OTP-15223/ERL-695: Fix caching of NIF environment when executing dirty # Conflicts: # erts/emulator/beam/erl_nif.c
2018-08-10Merge branch 'dotsimon/ref_ordering_bug/OTP-15225' into maint-21Erlang/OTP
* dotsimon/ref_ordering_bug/OTP-15225: Fixed #Ref ordering bug Test #Ref ordering in lists and ets
2018-08-10erts: Delete fd from poll-set when closing fd_driver portLukas Larsson
2018-08-09Merge branch 'rickard/full-cache-nif-env/OTP-15223/ERL-695' into maintRickard Green
* rickard/full-cache-nif-env/OTP-15223/ERL-695: Fix caching of NIF environment when executing dirty
2018-08-09Fix caching of NIF environment when executing dirtyRickard Green
2018-08-09Fixed #Ref ordering bugSimon Cornish
2018-08-09Test #Ref ordering in lists and etsSimon Cornish
2018-08-08Update PCRE from version 8.41 to version 8.42Rickard Green
2018-08-07Fixed #Ref ordering bugSimon Cornish
2018-08-07Test #Ref ordering in lists and etsSimon Cornish
2018-08-03erts: Fix seq_trace to not clear token for system messagesLukas Larsson
A lot of erts internal messages used behind APIs to create non-blocking calls, e.g. port_command, would cause the seq_trace token to be cleared from the caller when it should not. This commit fixes that and adds asserts that makes sure that all messages sent have to correct token set. Fixes: ERL-602
2018-08-03Merge branch 'lukas/erts/fix_udp_realloc_bug' into maintLukas Larsson
* lukas/erts/fix_udp_realloc_bug: erts: Limit the automatic max buffer for UDP to 2^16 erts: Free udp buffer when getting EAGAIN
2018-08-03Merge branch 'lukas/erts/etoomanyrefs_forker/OTP-15210' into maintLukas Larsson
* lukas/erts/etoomanyrefs_forker/OTP-15210: erts: Handle EMFILE errors in forker_driver for write
2018-07-31mikpe/erts-erl_alloc-missing-alignment/PR-1897/OTP-15208Lukas Larsson
erl_alloc: align ErtsAllocatorState_t
2018-07-30erts: Limit the automatic max buffer for UDP to 2^16Lukas Larsson
There is no reason to have a larger buffer than this as the recvmsg call will never return more data. OTP-15206
2018-07-30erts: Handle EMFILE errors in forker_driver for writeLukas Larsson
Before this change, if a write to the uds failed due to EMFILE to ETOOMANYREFS the entire vm would crash. This change makes it so that an SIGCHLD is simulated to that the error is propagated to the user instead of terminating the VM.
2018-07-30Merge branch 'lukas/erts/win_break_poll_thread_fix/OTP-15205' into maintLukas Larsson
* lukas/erts/win_break_poll_thread_fix/OTP-15205: erts: Fix bug where break would not trigger on windows
2018-07-30erl_alloc: align ErtsAllocatorState_tMikael Pettersson
2018-07-26Merge branch 'maint-21' into maintJohn Högberg
2018-07-18Merge branch 'sverker/erl_interface/valgrind/OTP-15171' into maintSverker Eriksson
* sverker/erl_interface/valgrind/OTP-15171: erl_interface: Fix bug in ei_*receive_msg* functions erl_interface: Seal test case memory leaks erl_interface: Initialize erl_errno to zero erts: Remove use of VALGRIND_PRINTF_XML erl_interface: Add valgrind ability for test port programs erts: Fix benign bug in cerl for valgrind erts: Fix buggy calls to erts_sys_explicit_8bit_getenv
2018-07-18erts: Remove use of VALGRIND_PRINTF_XMLSverker Eriksson
which only existed in a patched version of valgrind (by pan) no longer used. Instead we use standard VALGRIND_PRINTF which will end up like this if valgrind log format is XML and valgrind version >= 3.9: <clientmsg> <tid>7</tid> <threadname>3_scheduler</threadname> <text>Test case #20 ei_encode_SUITE:test_ei_encode_long/1 </text> </clientmsg> Note the extra trailing whitespace that may occure before </text>.
2018-07-18Merge branch 'john/erts/kqueue-stdin-polling/OTP-15169/ERL-647' into maint-21Erlang/OTP
* john/erts/kqueue-stdin-polling/OTP-15169/ERL-647: Use fallback pollset for stdin and friends when using kqueue
2018-07-18Merge branch 'john/erts/fix-literal-map-elements/OTP-15184' into maint-21Erlang/OTP
* john/erts/fix-literal-map-elements/OTP-15184: Fix a rare crash when matching on literal maps
2018-07-16Merge branch 'sverker/crash-dump-crash-literals/OTP-15181' into maintSverker Eriksson
* sverker/crash-dump-crash-literals/OTP-15181: erts: Fix bug in crash dump generation
2018-07-16erts: Free udp buffer when getting EAGAINLukas Larsson
Only SCPT should keep the recv buffer when going into select. If UDP does it, it will result in many more memory allocations than there should be which can be very detrimental to performance.