aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-03-02beam_type: Make sure to kill all dependencies when killing a registerBjörn Gustavsson
Make sure to kill all dependencies when a register is killed. For example, in the following code, when the type information for {x,0} is killed in the last instruction, there will still be type information for {x,1} referring to {x,0}: {get_tuple_element,{x,0},0,{x,1}}. {test,is_eq_exact,{f,5},[{x,1},{atom,tag}]}. {get_tuple_element,{x,0},1,{x,2}}. {get_tuple_element,{x,0},2,{x,0}}. This does not seems to have caused any problems in the past, but it may cause problems in the future with a register allocator that reuses register more aggressively.
2018-03-02beam_type: Refactor simplifications of instructionsBjörn Gustavsson
2018-03-02beam_type: Refactor updating of the type databaseBjörn Gustavsson
The function tdb_update/2 is problematic. It does not distinguish between assigning a register with a new value and updating information about a register that is used a as source in a test instruction. That was not a problem in practice when there were very few types, but bugs started to be noticed as more types were added. (For example, when a register was overwritten with a new value, the type for the old value stored in the same register could linger in some cases.) Introduce separate functions tdb_store/3 and tdb_meet/3 for assigning a new value to a register and for updating type information for a register referenced as as source, respectively. Also stricten verification of the types that gets stored into the type database.
2018-03-02beam_block: Fix unsafe sinking of get_tuple_element/3Björn Gustavsson
In the following code: {get_tuple_element,{x,0},0,{x,1}}. {put_tuple,2,{x,1}}. {put,{atom,badmap}}. {put,{x,0}}. {move,{x,1},{x,0}}. beam_block would move the get_tuple_element/3 instruction and eliminate the move/2 instruction: {put_tuple,2,{x,1}}. {put,{atom,badmap}}. {put,{x,0}}. {get_tuple_element,{x,0},0,{x,0}}. That is not correct, since the result of the tuple building in {x,1} is now ignored.
2018-02-26Merge branch 'maint'Sverker Eriksson
2018-02-26Merge branch 'sverker/enif_self-doc' into maintSverker Eriksson
* sverker/enif_self-doc: erts: Clarify enif_self docs
2018-02-26Merge branch 'maint'Lukas Larsson
2018-02-26Merge branch 'lukas/kernel/dist_SUITE_corefile_ignore' into maintLukas Larsson
* lukas/kernel/dist_SUITE_corefile_ignore: kernel: Ignore cores in erl_distribution_SUITE
2018-02-26Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/erl_trace.c
2018-02-26Merge branch 'maint'John Högberg
* maint: Update advanced.xml
2018-02-26Merge branch 'lukas/erts/dirty_trace_clean_fix/OTP-14938' into maintLukas Larsson
* lukas/erts/dirty_trace_clean_fix/OTP-14938: erts: Delay cleanup of removed tracer on dirty scheds
2018-02-26erts: Delay cleanup of removed tracer on dirty schedsLukas Larsson
It is not simple to do the correct de-allocation on a dirty schedulers, so we just delay it until this process runs on a normal scheduler.
2018-02-26Merge pull request #1715 from erlang/KennethL-patch-1Kenneth Lundin
Update advanced.xml with correct default for number of processes
2018-02-26Merge pull request #1719 from josevalim/jv-faster-dialyzer-md5Hans Bolinder
dialyzer: Compute MD5s using the .beam file (OTP-14937)
2018-02-26Merge branch 'john/erts/nif-binary-iovec-fixes/OTP-14845/OTP-14931/OTP-14932'John Högberg
* john/erts/nif-binary-iovec-fixes/OTP-14845/OTP-14931/OTP-14932: Suggest using enif_make_new_binary when possible Make enif_make_binary return heap binaries if possible Expand ErlNifBinary by another word for future additions Unconditionally transfer ownership to the created term Tweak asserts and explain why the copy buf doesn't use the tmp obj list Free temporary iovecs through the tmp object list Add a helper function for attaching tmp objects to NIF environments
2018-02-26Suggest using enif_make_new_binary when possibleJohn Högberg
While enif_make_binary will create heap-binaries from ErlNifBinaries when possible now, enif_alloc_binary still allocates a Binary* off-heap which is avoided entirely with enif_make_new_binary.
2018-02-26Make enif_make_binary return heap binaries if possibleJohn Högberg
This does not avoid allocating a ProcBin since we still need to release the binary somehow (and using the tmp obj list is slightly slower since it's an unavoidable off-heap allocation), but it does give us a hard limit on how long said ProcBin will live, which is a lot better than before. OTP-14845
2018-02-26Expand ErlNifBinary by another word for future additionsJohn Högberg
When fixing OTP-14931/14932 we had to settle for a solution that decreased performance in a few corner cases like multiple calls to enif_make_binary, as the other options on the table required extra fields which would have broken ABI compatibility. This is ABI-compatible since the fields are unused and at the end.
2018-02-26Unconditionally transfer ownership to the created termJohn Högberg
This fixes two corner-cases: 1) We will no longer return an invalid term when a binary inspected on environment A is used in enif_make_binary on environment B 2) A double-free in this sequence of events: * enif_alloc_binary(size, &bin); * enif_ioq_enq_binary(ioq, &bin, skip); * enif_make_binary(env, &bin); * enif_make_binary(env, &bin); OTP-14931 OTP-14932
2018-02-26Tweak asserts and explain why the copy buf doesn't use the tmp obj listJohn Högberg
2018-02-26Free temporary iovecs through the tmp object listJohn Högberg
Attaching to a ProcBin is the fastest way to delay the release of an already allocated Binary, but alloc_tmp_obj is a lot faster when starting from scratch since it usually uses temp_alloc.
2018-02-23Add a helper function for attaching tmp objects to NIF environmentsJohn Högberg
2018-02-23erts: Clarify enif_self docsSverker Eriksson
2018-02-23Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Correct a parameterized opaque types bug
2018-02-23Merge branch 'hasse/dialyzer/fix_opaque_bug/OTP-14925/ERL-565' into maintHans Bolinder
* hasse/dialyzer/fix_opaque_bug/OTP-14925/ERL-565: dialyzer: Correct a parameterized opaque types bug
2018-02-23Merge pull request #1723 from jhogberg/john/erts/ets-whereis/OTP-14884John Högberg
Add ets:whereis/1 for resolving table names -> tid()
2018-02-23Merge branch 'maint'Hans Bolinder
* maint: stdlib: Correct a minor epp bug
2018-02-23Merge branch 'hasse/stdlib/minor_fix_epp' into maintHans Bolinder
* hasse/stdlib/minor_fix_epp: stdlib: Correct a minor epp bug
2018-02-22Merge branch 'raimo/stdlib/rand-polish-stat-tests'Raimo Niskanen
* raimo/stdlib/rand-polish-stat-tests: Decrease tolerance a wee bit Repeat stat tests to only fail for systematic errors Fix histogram and outlier checks
2018-02-22Merge branch 'maint'Hans Nilsson
* maint: ssh: Fix hanging engine test case on an old outdated version
2018-02-22Merge branch 'hans/ssh/cuddle_tests' into maintHans Nilsson
* hans/ssh/cuddle_tests: ssh: Fix hanging engine test case on an old outdated version
2018-02-22ssh: Fix hanging engine test case on an old outdated versionHans Nilsson
OpenSSL 1.0.1s-freebsd 1 Mar 2016
2018-02-22Merge branch 'maint'Hans Nilsson
* maint: Updated OTP version Prepare release ssh: Add option save_accepted_host ssh: No error message for signal kill ssh: Dont repeat supervisor defaults in map fields ssh: Move starting of channel child to ssh_channel_sup ssh: Test case for sup tree when shell server proc times out Conflicts: OTP_VERSION
2018-02-22Merge branch 'maint-20' into maintHans Nilsson
* maint-20: Updated OTP version Prepare release ssh: Add option save_accepted_host ssh: No error message for signal kill ssh: Dont repeat supervisor defaults in map fields ssh: Move starting of channel child to ssh_channel_sup ssh: Test case for sup tree when shell server proc times out
2018-02-22Clarify the named_table option to ets:new/2John Högberg
2018-02-22Add ets:whereis/1 for resolving table names -> tid()John Högberg
2018-02-21Compute MD5s in dialyzer using the .beam fileJosé Valim
The previous mechanism was based on the core file which meant that for every module in the PLT, we had to fetch its .beam file, retrieve Erlang AST, compile that down to core, serialize it into a binary and then get its MD5. In a project with stdlib, kernel, elixir and a small application in the PLT, relying only on the .beam sped up --check_plt from 10s to 0.8s.
2018-02-21Fix spec for beam_lib:all_chunks/1José Valim
2018-02-21Updated OTP versionOTP-20.2.4Erlang/OTP
2018-02-21Prepare releaseErlang/OTP
2018-02-21Merge branch 'hans/ssh/limit_knownhosts/OTP-14935' into maint-20Erlang/OTP
* hans/ssh/limit_knownhosts/OTP-14935: ssh: Add option save_accepted_host
2018-02-21Merge branch 'hans/ssh/no_error_for_kill/OTP-14930' into maint-20Erlang/OTP
* hans/ssh/no_error_for_kill/OTP-14930: ssh: No error message for signal kill
2018-02-21Merge branch 'hans/ssh/supervisor_timeout/OTP-14907' into maint-20Erlang/OTP
* hans/ssh/supervisor_timeout/OTP-14907: ssh: Dont repeat supervisor defaults in map fields ssh: Move starting of channel child to ssh_channel_sup ssh: Test case for sup tree when shell server proc times out
2018-02-21ssh: Add option save_accepted_hostHans Nilsson
2018-02-21stdlib: Correct a minor epp bugHans Bolinder
The bug was introduced in 87a0af4 (R18).
2018-02-21Merge PR-1708 from philipstears OTP-14934Sverker Eriksson
Optimize non-strict equality check of binaries differing in size
2018-02-21Merge branch 'maint'John Högberg
2018-02-21Merge branch 'john/runtime_tools/fix-sysinfo-to-file-formatting' into maintJohn Högberg
* john/runtime_tools/fix-sysinfo-to-file-formatting: Fix regression introduced in d468fcbb / OTP-14816
2018-02-21Decrease tolerance a wee bitRaimo Niskanen
2018-02-21Repeat stat tests to only fail for systematic errorsRaimo Niskanen