aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
AgeCommit message (Collapse)Author
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-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.
2018-07-13erts: Fix bug where break would not trigger on windowsLukas Larsson
This bug was introduced in 988f5f5e8061ce2. The aux_thread needs to be poked as it is the thread that handles all break actions.
2018-07-13Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers Fix trace_info/2 Provide build support for standalone corba repo Fix release notes for OTP-21.0.2 Move to a dirty scheduler even when we have pending system tasks
2018-07-13Fix a rare crash when matching on literal mapsJohn Högberg
When matching on a literal map, the map is placed into the general scratch register first. This is fine in isolation, but when the key to be matched was in a Y register it would also be placed in the scratch register, overwriting the map and crashing the emulator.
2018-07-12Merge branch 'john/erts/fix-dirty-reschedule-bug/OTP-15154' into maint-21Erlang/OTP
* john/erts/fix-dirty-reschedule-bug/OTP-15154: Move to a dirty scheduler even when we have pending system tasks
2018-07-12Fix trace_info/2Rickard Green
2018-07-12erts: Fix bug in crash dump generationSverker Eriksson
Symptom: emulator core dumps during crash dump generation. Problem: erts_dump_lit_areas did not grow correctly to always be equal or larger than number of loaded modules. The comment about twice the size to include both curr and old did not seem right. The beam_ranges structure contains *all* loaded module instances until they are removed when purged.
2018-07-10erts: Fix buggy calls to erts_sys_explicit_8bit_getenvSverker Eriksson
Two of them only affect valgrind builds and the one for ERL_CRASH_DUMP_NICE seems benign. Return value changed in c2d70945dce9cb09d5d7120d6e9ddf7faac8d230 old -> new -1 -> 0 not found 0 -> 1 found ok 1 -> -1 found but too big
2018-07-05beam_debug: Fix printing of floating point registersBjörn Gustavsson
2018-07-04Merge branch 'maint-21' into maintJohn Högberg
* maint-21: Updated OTP version Update release notes Update version numbers Eliminate a crash in the beam_jump pass stdlib: Fix a 'chars_limit' bug Fix a race condition when generating async operation ids Fix internal compiler error for map_get/2 beam_type: Fix unsafe optimization public_key: Remove moduli 5121 and 7167 Thoose were added by 598629aeba9de98e8cdf5637043eb34e5d407751 but are not universaly supported.
2018-07-03Use fallback pollset for stdin and friends when using kqueueJohn Högberg
This is a hack to make the "noshell" option work; kqueue can poll these fds but will not report EV_EOF. This may be common to all all pipes but we have no way to tell whether an fd is a pipe or not.
2018-06-29Merge branch 'john/erts/inet-drv-race/OTP-15158/ERL-654' into maint-21Erlang/OTP
* john/erts/inet-drv-race/OTP-15158/ERL-654: Fix a race condition when generating async operation ids
2018-06-29Merge branch 'john/erts/merge-OTP-15067' into maint-21Erlang/OTP
* john/erts/merge-OTP-15067: Don't enqueue system tasks if target process is in fail_state Fix erroneous schedule of freed/exiting processes Fix deadlock in run queue evacuation Fix memory leak of processes that died in the run queue
2018-06-28Fix a race condition when generating async operation idsJohn Högberg
The counter used for generating async operation ids was a plain int shared between all ports, which was incorrect but mostly worked fine since the ids only had to be unique on a per-port basis. However, some compilers (notably GCC 8.1.1) generated code that assumed that this value didn't change between reads. Using a shortened version of enq_async_w_tmo as an example: int id = async_ref++; op->id = id; //A return id; //B In GCC 7 and earlier, `async_ref` would be read once and assigned to `id` before being incremented, which kept the values at A and B consistent. In GCC 8, `async_ref` was read when assigned at A and read again at B, and then incremented, which made them inconsistent if we raced with another port. This commit fixes the issue by removing `async_ref` altogether and replacing it with a per-port counter which makes it impossible to race with someone else.
2018-06-27Move to a dirty scheduler even when we have pending system tasksJohn Högberg
When a system task was enqueued on a process between being scheduled and the check altered in this commit, we'd run dirty code on a normal scheduler as the RUNNING_SYS flag wasn't set and we wouldn't migrate back. This change migrates us to a dirty scheduler instead, which will immediately bounce us back to a normal scheduler where RUNNING_SYS will be set appropriately. This is caught fairly reliably by process_SUITE:system_task_failed_enqueue on machines with a lot of cores.
2018-06-26Merge branch 'maint-21' into maintJohn Högberg
* maint-21: Updated OTP version Prepare release Fix unsafe optimization when running beam_block the second time Fix environment case sensitivity issues on Windows
2018-06-25Merge branch 'john/erts/merge-OTP-15067' into maintJohn Högberg
* john/erts/merge-OTP-15067: Don't enqueue system tasks if target process is in fail_state Fix erroneous schedule of freed/exiting processes Fix deadlock in run queue evacuation Fix memory leak of processes that died in the run queue
2018-06-21Fix environment case sensitivity issues on WindowsJohn Högberg
2018-06-20Merge branch 'lukas/erts/etp-aux-work-fixes' into maintLukas Larsson
* lukas/erts/etp-aux-work-fixes: erts: Update etp-commands with correct aux_flags
2018-06-18erts: Update etp-commands with correct aux_flagsLukas Larsson
2018-06-18Update copyright yearHenrik Nord
2018-06-14Merge branch 'john/erts/fix-process-schedule-after-free/OTP-15067/ERL-573' ↵John Högberg
into john/erts/merge-OTP-15067
2018-06-14Don't enqueue system tasks if target process is in fail_stateJohn Högberg
The fail state wasn't re-checked in the state change loop; only the FREE state was checked. In addition to that, we would leave the task in the queue when bailing out which could lead to a double-free. This commit backports active_sys_enqueue from master to make it easier to merge onwards.
2018-06-14Fix erroneous schedule of freed/exiting processesJohn Högberg
When scheduled out, the process was never checked for the FREE state before rescheduling, which meant that a system task could sneak in and cause a double-free later on.
2018-06-13erts: Fix MacOS pollset bugSverker Eriksson
that could cause clearing of fd-bits past allocated bit-vectors. Bug introduced on master by 988f5f5e8061ce2e135a314ca782788eda478a06
2018-06-13Merge branch 'sverker/ets-auto-unfix-delete-race/OTP-15109' into maint-20Erlang/OTP
* sverker/ets-auto-unfix-delete-race/OTP-15109: erts: Fix race between ets table deletion and auto-unfix
2018-06-12erts: Fix monitor_SUITE:remote_remove_monitorSverker Eriksson
to actually run remote on the slave node that it starts.
2018-06-11Merge branch 'sverker/process-info-exiting'Sverker Eriksson
* sverker/process-info-exiting: erts: Fix incoming signal handling for exiting process
2018-06-11erts: Fix incoming signal handling for exiting processSverker Eriksson
Seen symptom: handle_process_info() called with is_alive=1 on exiting process, reading broken Process.u.initial.module atom overwritten by Process.u.terminate pointer. Solution: Let erts_proc_sig_handle_incoming() do nothing if process is already exiting.
2018-06-11Merge branch 'lukas/kernel/logger-config/OTP-13295'Lukas Larsson
* lukas/kernel/logger-config/OTP-13295: erts: Fix emulator log messages to use erlang:system_time kernel: Add LOGGER_SERVER_TAG to logger_server
2018-06-07Merge branch 'sverker/ets-auto-unfix-delete-race/OTP-15109'Sverker Eriksson
* sverker/ets-auto-unfix-delete-race/OTP-15109: erts: Fix race between ets table deletion and auto-unfix
2018-06-07erts: Fix race between ets table deletion and auto-unfixSverker Eriksson
Bug exists since ets-refs were introduced in 20.0 0d6dc895744c34c9c52fd42f4801a8a941864ae3. Problem: 1. Process A fixates table T. 2. Process B starts deleting table T (either by ets:delete or exit) and does tid_clear(). 3. Process A exits and does proc_cleanup_fixed_table() and get NULL from btid2tab() and deallocates DbFixation. 4. Process B continues deleting table in free_fixations_locked() and finds the deallocated DbFixation in the fixing_procs tree. Solution: Wait with tid_clear() until after free_fixations_locked() has traversed the fixing_procs tree.