aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2019-03-11Skip useless test in grow loop in array moduleRichard Carlsson
2019-03-11Clarify comments in array moduleRichard Carlsson
2019-03-11Get rid of useless setelement in array moduleRichard Carlsson
2019-03-11erts: Fix ets:select table fixation leak at owner changeSverker Eriksson
Symtom: ETS table remains fixed after finished ets:select* call. Problem: The decision to unfix table after a yielding ets:select* is based on table ownership, but ownership might have changed while ets:select* was yielding. Solution: Remember and pass along whether table was fixed when the traversal started.
2019-03-11stdlib: Clarify docs for ets:info(_, safe_fixed)Sverker Eriksson
It's about the *last* time the table went from unfixed to fixed, not the first time it ever did.
2019-03-11Merge branch 'john/compiler/float-opt-guard-fix'Björn Gustavsson
* john/compiler/float-opt-guard-fix: beam_ssa_opt: Fix crash in ssa_opt_float
2019-03-11Prepare releaseErlang/OTP
2019-03-11ssl: Fix transport transparancyIngela Anderton Andin
2019-03-09Optimize tail-recursive calls of BIFsBjörn Gustavsson
BEAM currently does not call BIFs at the end of a function in a tail-recursive way. That is, when calling a BIF at the end of a function, the BIF is first called, and then the stack frame is deallocated, and then control is transferred to the caller. If there is no stack frame when a BIF is called in the tail position, the loader will emit a sequence of three instructions: first an instruction that allocates a stack frame and saves the continuation pointer (`allocate`), then an instruction that calls the BIF (`call_bif`), and lastly an instruction that deallocates the stack frame and returns to the caller (`deallocate_return`). The old compiler would essentially allocate a stack frame for each clause in a function, so it would not be that common that a BIF was called in the tail position when there was no stack frame, so the three-instruction sequence was deemed acceptable. The new compiler only allocates stack frames when truly needed, so the three-instruction BIF call sequence has become much more common. This commit introduces a new `call_bif_only` instruction so that only one instruction will be needed when calling a BIF in the tail position when there is no stack frame. This instruction is also used when there is a stack frame to make it possible to deallocate the stack frame **before** calling the BIF, which may make a subsequent garbage collection at the end of the BIF call cheaper (copying less garbage). The one downside of this change is that the function that called the BIF will not be included in the stack backtrace (similar to how a tail-recursive call to an Erlang function will not be included in the backtrace). That was the quick summary of the commit. Here comes a detailed look at how BIF calls are translated by the loader. The first example is a function that calls `setelement/3` in the tail position: update_no_stackframe(X) -> setelement(5, X, new_value). Here is the BEAM code: {function, update_no_stackframe, 1, 12}. {label,11}. {line,[...]}. {func_info,{atom,t},{atom,update_no_stackframe},1}. {label,12}. {move,{x,0},{x,1}}. {move,{atom,new_value},{x,2}}. {move,{integer,5},{x,0}}. {line,[...]}. {call_ext_only,3,{extfunc,erlang,setelement,3}}. Because there is no stack frame, the `call_ext_only` instruction will be used to call `setelement/3`: {call_ext_only,3,{extfunc,erlang,setelement,3}}. The loader will transform this instruction to a three-instruction sequence: 0000000020BD8130: allocate_tt 0 3 0000000020BD8138: call_bif_e erlang:setelement/3 0000000020BD8148: deallocate_return_Q 0 Using the `call_bif_only` instruction introduced in this commit, only one instruction is needed: 000000005DC377F0: call_bif_only_e erlang:setelement/3 `call_bif_only` calls the BIF and returns to the caller. Now let's look at a function that already has a stack frame when `setelement/3` is called: update_with_stackframe(X) -> foobar(X), setelement(5, X, new_value). Here is the BEAM code: {function, update_with_stackframe, 1, 14}. {label,13}. {line,[...]}. {func_info,{atom,t},{atom,update_with_stackframe},1}. {label,14}. {allocate,1,1}. {move,{x,0},{y,0}}. {line,[...]}. {call,1,{f,16}}. {move,{y,0},{x,1}}. {move,{atom,new_value},{x,2}}. {move,{integer,5},{x,0}}. {line,[...]}. {call_ext_last,3,{extfunc,erlang,setelement,3},1}. Since there is a stack frame, the `call_ext_last` instruction will be used to deallocate the stack frame and call the function: {call_ext_last,3,{extfunc,erlang,setelement,3},1}. Before this commit, the loader would translate this instruction to: 0000000020BD81B8: call_bif_e erlang:setelement/3 0000000020BD81C8: deallocate_return_Q 1 That is, the BIF is called before deallocating the stack frame and returning to the calling function. After this commit, the loader will translate the `call_ext_last` like this: 000000005DC37868: deallocate_Q 1 000000005DC37870: call_bif_only_e erlang:setelement/3 There are still two instructions, but now the stack frame will be deallocated before calling the BIF, which could make the potential garbage collection after the BIF call slightly more efficient (copying less garbage). We could have introduced a `call_bif_last` instruction, but the code for calling a BIF is relatively large and there does not seem be a practical way to share the code between `call_bif` and `call_bif_only` (since the difference is at the end, after the BIF call). Therefore, we did not want to clone the BIF calling code yet another time to make a `call_bif_last` instruction.
2019-03-08Allow list of chunks to be given to strip*()Michael Schmidt
This allows extra chunks to be preserved for languages such as Elixir
2019-03-08Merge branch 'maint'Péter Dimitrov
* maint: inets: Fix handling of erl_script_timeout Change-Id: Ie6028000b0bd45307477d837f63c51b2620faaea
2019-03-08Merge branch 'peterdmv/inets/httpd_erl_script_timeout/ERIERL-321/OTP-15669' ↵Péter Dimitrov
into maint * peterdmv/inets/httpd_erl_script_timeout/ERIERL-321/OTP-15669: inets: Fix handling of erl_script_timeout Change-Id: I6a90408de48df6b8b01f44e0b273507bcec27b13
2019-03-08inets: Fix handling of erl_script_timeoutPéter Dimitrov
When httpd was started with 'erl_script_timeout', the value of the option was converted to milliseconds before storage. Subsequent calls to httpd:info/1 returned the input value multiplied by 1000. This change fixes the handing of erl_script_timeout by storing the timeout in seconds and converting it to milliseconds before usage. Change-Id: Ic308d83b59ad0884e053f096f995754c89adcbf4
2019-03-08Merge branch 'rickard/deprecations-removals-fix'Rickard Green
* rickard/deprecations-removals-fix: Better erl_interface deprecation warning implementation
2019-03-08beam_ssa_opt: Fix crash in ssa_opt_floatJohn Högberg
For reasons better explained in the source code, ssa_opt_float skips optimizing inside guards but it failed to do so consistently; while the pass never processed guard blocks, it was still possible to erroneously defer error checking to a guard block, crashing the compiler once it realized its state was invalid.
2019-03-08Merge branch 'sverker/master/ets-no-mbuf-trapping/OTP-15660'Sverker Eriksson
* sverker/master/ets-no-mbuf-trapping/OTP-15660: erts: Remove ets traversal yielding if heap fragment
2019-03-08Merge pull request #2088 from josevalim/jv-start-distributionSiri Hansen
Add start_distribution to kernel environment OTP-15668
2019-03-08Merge branch 'sverker/maint/ets-no-mbuf-trapping/OTP-15660' into maintSverker Eriksson
* sverker/maint/ets-no-mbuf-trapping/OTP-15660: erts: Remove ets traversal yielding if heap fragment
2019-03-08Merge branch 'maint'Anders Svensson
2019-03-08Merge branch 'anders/diameter/21.3/OTP-15654' into maintAnders Svensson
* anders/diameter/21.3/OTP-15654: Update appup for diameter 2.2 in OTP 21.3
2019-03-08Merge branch 'anders/diameter/distribution/OTP-15398' into maintAnders Svensson
* anders/diameter/distribution/OTP-15398: Add diameter_dist_SUITE to exercise diameter_dist:route_session/2 Add consistent hashing to diameter_dist:route_session/2 Add options to diameter_dist:route_session/2 node selection Add diameter_dist for ready spawn_opt callbacks Tweak/document request handler callback Document acknowledgements in transport interface Fix comment typo
2019-03-08Merge branch 'maint'Ingela Anderton Andin
2019-03-08Merge branch 'ingela/ssl/ftp/continue/chunk-timing/ERIERL-316/OTP-15666' ↵Ingela Anderton Andin
into maint * ingela/ssl/ftp/continue/chunk-timing/ERIERL-316/OTP-15666: ssl: Correct active once emulation ftp: New test case
2019-03-08Merge pull request #2173 from essen/crypto-infoHans Nilsson
Add crypto:cipher_info/1 and crypto:hash_info/1 OTP-15655
2019-03-08Merge branch 'maint'Siri Hansen
2019-03-08Merge branch 'siri/logger/file-logging-improvements' into maintSiri Hansen
* siri/logger/file-logging-improvements: [logger] Add option file_check to logger_std_h [logger] Add log file rotation by options to logger_std_h [logger] Add better control of file modes in logger_std_h [logger] Refactor logger_std_h [logger] Make sure log file is re-opened with configured file options
2019-03-08[logger] Add option file_check to logger_std_hSiri Hansen
OTP-15663 This option indicates how often the handler shall check if the log file still exists and if the inode is changed.
2019-03-08[logger] Add log file rotation by options to logger_std_hSiri Hansen
OTP-15479 OTP-15662 New configuration map for logger_std_h: #{type => file, file => file:filename(), modes => [file:mode()], max_no_bytes => pos_integer() | infinity, max_no_files => non_neg_integer(), compress_on_rotate => boolean()} For backwards compatibility, the old variant for specifying the file name via the 'type' parameter is still supported, i.e. {file,FileName} and {file,FileName,Modes}, but it is no longer documented. Rotation scheme: The current log file always has the same name, and the archived files get extensions ".0", ".1", ... The newest archive has extension ".0", and the oldest archive has the highest number. If 'compress_on_rotate' is set to true, the archived files are gzipped and get the additional extension ".gz", e.g. error.log.0.gz. Rotation is turned off by setting 'max_no_bytes' to infinity. Setting 'max_no_files' to 0 does not turn off rotation, but only specifies that no archives are to be saved.
2019-03-08ssl: Correct active once emulationIngela Anderton Andin
Conflicts: lib/ftp/test/ftp_SUITE.erl
2019-03-08ftp: New test caseIngela Anderton Andin
2019-03-07Merge branch 'sverker/maint/ets-no-mbuf-trapping/OTP-15660'Sverker Eriksson
into sverker/master/ets-no-mbuf-trapping/OTP-15660
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-07ssl: Fix get_handshake_context/2Péter Dimitrov
Split get_handshake_context/2 into two functions. The new get_handshake_context_cv/2 returns the context for the verification of CertificateVerify. Change-Id: I461eb67bda1d9c1673e463d417c3e838fca6b40c
2019-03-07Better erl_interface deprecation warning implementationRickard Green
2019-03-07Merge branch 'rickard/make-fixes-21/OTP-15657' into maintRickard Green
* rickard/make-fixes-21/OTP-15657: Remove own configured RM make variable
2019-03-07Merge branch 'rickard/make-fixes-22/OTP-15657'Rickard Green
* rickard/make-fixes-22/OTP-15657: Remove own configured RM make variable
2019-03-07Merge branch 'maint'Siri Hansen
2019-03-07Merge branch 'siri/logger/optimize-formatter/OTP-15647' into maintSiri Hansen
* siri/logger/optimize-formatter/OTP-15647: [logger] Improve formatter performance
2019-03-07[logger] Improve formatter performanceSiri Hansen
2019-03-07Merge branch 'maint'Siri Hansen
2019-03-07Merge branch 'siri/logger/bench' into maintSiri Hansen
* siri/logger/bench: [logger] Add benchmark of big log events with chars_limit and max_size [logger] Add max memory usage to statistics in logger_olp Skip logger benchmarks in normal kernel test [logger] Add benchmark of events per millisecond for handlers
2019-03-07[logger] Add benchmark of big log events with chars_limit and max_sizeSiri Hansen
2019-03-07[logger] Add max memory usage to statistics in logger_olpSiri Hansen
2019-03-07Skip logger benchmarks in normal kernel testSiri Hansen
2019-03-07[logger] Add benchmark of events per millisecond for handlersSiri Hansen
2019-03-07ssl: Test HelloRetryRequest with client authPéter Dimitrov
Change-Id: I6504d99a96ed6fc75dbdff78a6148ed39d3776c9
2019-03-07ssl: Verify signature algorithm in CVPéter Dimitrov
Verify if the signature algorithm used in the signature of CertificateVerify is one of those present in the supported_signature_algorithms field of the "signature_algorithms" extension in the CertificateRequest message. Change-Id: I7d3b5f10e3205447fb9a9a7e59b93568d1696432
2019-03-07Merge branch 'maint'Ingela Anderton Andin
2019-03-07Merge branch 'ingela/ftp/chunk-timing/ERIERL-316/OTP-15659' into maintIngela Anderton Andin
* ingela/ftp/chunk-timing/ERIERL-316/OTP-15659: ftp: Correct test case ftp: Fix timing bug