aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2017-11-30Add syntax in try/catch to retrieve the stacktrace directlyBjörn Gustavsson
This commit adds a new syntax for retrieving the stacktrace without calling erlang:get_stacktrace/0. That allow us to deprecate erlang:get_stacktrace/0 and ultimately remove it. The problem with erlang:get_stacktrace/0 is that it can keep huge terms in a process for an indefinite time after an exception. The stacktrace can be huge after a 'function_clause' exception or a failed call to a BIF or operator, because the arguments for the call will be included in the stacktrace. For example: 1> catch abs(lists:seq(1, 1000)). {'EXIT',{badarg,[{erlang,abs, [[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20|...]], []}, {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,674}]}, {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,431}]}, {shell,exprs,7,[{file,"shell.erl"},{line,687}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]}, {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}]}} 2> erlang:get_stacktrace(). [{erlang,abs, [[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, 23,24|...]], []}, {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,674}]}, {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,431}]}, {shell,exprs,7,[{file,"shell.erl"},{line,687}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]}, {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}] 3> We can extend the syntax for clauses in try/catch to optionally bind the stacktrace to a variable. Here is an example using the current syntax: try Expr catch C:E -> Stk = erlang:get_stacktrace(), . . . In the new syntax, it would look like: try Expr catch C:E:Stk -> . . . Only a variable (not a pattern) is allowed in the stacktrace position, to discourage matching of the stacktrace. (Matching would also be expensive, because the raw format of the stacktrace would have to be converted to the cooked form before matching.) Note that: try Expr catch E -> . . . is a shorthand for: try Expr catch throw:E -> . . . If the stacktrace is to be retrieved for a throw, the 'throw:' prefix must be explicitly included: try Expr catch throw:E:Stk -> . . .
2017-11-30erl_parse: Use a new pat_expr rule for pattern expressionsBjörn Gustavsson
In the grammar file for the Erlang language, patterns are parsed as expressions. erl_lint will then weed out expressions that are not legal patterns. The rule sharing causes problems if we were to introduce new syntax, for example a pattern followed by a ':'. There would be a shift/reduce conflict, and a pattern followed by a ':' would be parsed as a remote call. Introduce a new pat_expr rule to express exactly the subset of expressions that is allowed in pattern. Note: For the moment, we must allow full expressions in case clauses to keep 'merl' working.
2017-11-30Merge branch 'bjorn/compiler/coverage'Björn Gustavsson
* bjorn/compiler/coverage: v3_codegen: Remove check of operand for bs_context_to_binary beam_jump: Eliminate a repeated clause beam_asm: No longer allow iolists as contents in chunk/2 beam_utils_SUITE: Cover more lines in beam_utils guard_SUITE: Add a test case to cover beam_dead:turn_op/1 Recognize 'nil' as a literal in beam_utils:bif_to_test/3 Cover more code in beam_bsm:btb_opt_1/3 Add test to cover a line in v3_kernel:opt_single_valued/3
2017-11-30Merge branch 'maint'Dan Gudmundsson
* maint: Avoid falling measurements testcases on slow machines stdlib: string optimize special case for ASCII stdlib: Minor unicode_util opts
2017-11-30Merge branch 'dgud/stdlib/optimize-string-lists' into maintDan Gudmundsson
* dgud/stdlib/optimize-string-lists: Avoid falling measurements testcases on slow machines stdlib: string optimize special case for ASCII stdlib: Minor unicode_util opts OTP-14670
2017-11-29Minor grammar tweak in ETS documentationIsaac Whitfield
2017-11-29Avoid falling measurements testcases on slow machinesDan Gudmundsson
2017-11-29stdlib: string optimize special case for ASCIIDan Gudmundsson
Avoid unicode_util module call for ASCII strings
2017-11-29stdlib: Minor unicode_util optsDan Gudmundsson
Exit early for Latin-1
2017-11-29Merge branch 'maint'Ingela Anderton Andin
2017-11-29Merge branch 'ingela/ssl/ERL-521/OTP-14794' into maintIngela Anderton Andin
* ingela/ssl/ERL-521/OTP-14794: ssl: Make sure all possible data is delivered
2017-11-29Merge branch 'maint'Ingela Anderton Andin
Conflicts: lib/ssl/src/ssl_connection.erl
2017-11-29Merge branch 'ingela/ssl/cleaner-code' into maintIngela Anderton Andin
* ingela/ssl/cleaner-code: ssl: Add gracefullness to dtls code ssl: Remove old softupgrade code ssl: Use genstamtem properly
2017-11-29v3_codegen: Remove check of operand for bs_context_to_binaryBjörn Gustavsson
The bs_context_to_binary instruction only allows a register operand. v3_codegen has a test to ensure that the operand is a register. That test is no longer necessary. There used to be a possibility that optimizations in sys_core_fold and the inliner could change the operand for bs_context_to_binary to a binary literal. Since 09112806c15a81b that can no longer happen, because no more optimizations are run after the introduction of the bs_context_to_binary instruction.
2017-11-28ssl: Make sure all possible data is deliveredIngela Anderton Andin
2017-11-28Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Extend the map implementation's handling of ?unit dialyzer: Use string:find() instead of string:str()
2017-11-28Merge branch 'hasse/dialyzer/maps_anon_fun/OTP-14743' into maintHans Bolinder
* hasse/dialyzer/maps_anon_fun/OTP-14743: dialyzer: Extend the map implementation's handling of ?unit dialyzer: Use string:find() instead of string:str()
2017-11-28Merge branch 'maint'Hans Nilsson
* maint: public_key: Fix failing pkix_verify_hostname_subjAltName_IP TC
2017-11-28Merge branch 'hans/ssh/public_key/fix_bad_cert_merge' into maintHans Nilsson
* hans/ssh/public_key/fix_bad_cert_merge: public_key: Fix failing pkix_verify_hostname_subjAltName_IP TC
2017-11-27Merge branch 'maint'Dan Gudmundsson
* maint: Update HOWTO with wxWidgets build examples https should be mapped to url and not seealso Update kernel appup for OTP-20.2
2017-11-27Merge branch 'dgud/erl_docgen/https2url' into maintDan Gudmundsson
* dgud/erl_docgen/https2url: Update HOWTO with wxWidgets build examples https should be mapped to url and not seealso
2017-11-27Merge branch 'siri/appups-20.2' into maintSiri Hansen
* siri/appups-20.2: Update kernel appup for OTP-20.2
2017-11-27public_key: Fix failing pkix_verify_hostname_subjAltName_IP TCHans Nilsson
Was due to an unresolved merge conflict in a453532fe31eecd8c39b5035702ee20b402fd687
2017-11-27beam_jump: Eliminate a repeated clauseBjörn Gustavsson
This clause seems to have been introduced in cac51274eb9a.
2017-11-27beam_asm: No longer allow iolists as contents in chunk/2Björn Gustavsson
The clause that converted an iolist to a binary was never executed. Note that chunk/2 is called for all chunks in the {extra_chunks,Chunks} option. This change will enforce that the contents of each chunk must be a binary (as documented).
2017-11-27beam_utils_SUITE: Cover more lines in beam_utilsBjörn Gustavsson
2017-11-27guard_SUITE: Add a test case to cover beam_dead:turn_op/1Björn Gustavsson
f9a323d10a9f5d added consistent operand order for equality comparisons. As a result, beam_dead:turn_op/1 is no longer covered. We must keep the uncovered lines in beam_dead to ensure that beam_dead can handle BEAM assembly code from another source than v3_codegen that might not follow the operand order convention. The only way to cover the lines is to use BEAM assembly in the test case.
2017-11-27Recognize 'nil' as a literal in beam_utils:bif_to_test/3Björn Gustavsson
beam_utils:bif_to_test/3 is supposed to never put a literal operand as the first operand in is_eq_exact or is_ne_exact, but 'nil' was not recognized as a literal.
2017-11-27Cover more code in beam_bsm:btb_opt_1/3Björn Gustavsson
2017-11-27Add test to cover a line in v3_kernel:opt_single_valued/3Björn Gustavsson
The uncovered line was added in 6753bbcc3fdb0.
2017-11-27Merge pull request #1545 from michalmuskala/move-optBjörn Gustavsson
Place move S x0 instructions at the end of blocks
2017-11-24Merge branch 'hans/public_key/base64_fix/OTP-14788'Hans Nilsson
* hans/public_key/base64_fix/OTP-14788: public_key: Fix bad calls to base64:*
2017-11-24ssl: Add gracefullness to dtls codeIngela Anderton Andin
Also make tls code a little more direct for easier uderstanding
2017-11-24ssl: Remove old softupgrade codeIngela Anderton Andin
This code is only relevant in version is was written in.
2017-11-24ssl: Use genstamtem properlyIngela Anderton Andin
2017-11-24Merge branch 'maint'Ingela Anderton Andin
2017-11-24Merge branch 'ingela/dtls/merge-fix' into maintIngela Anderton Andin
* ingela/dtls/merge-fix: ssl: Fix incorrect merge conflict resolution
2017-11-24ssl: Fix incorrect merge conflict resolutionIngela Anderton Andin
When handling merging of back ported Counter measurements for Bleichenbacher attack a line from DTLS was accidentally lost.
2017-11-24Merge branch 'maint'Björn Gustavsson
* maint: Use base64 encoding in crash dumps Correct parsing of sub binaries Generalize passing of options for decoding
2017-11-24Merge branch 'bjorn/base64-in-dumps/OTP-14686' into maintBjörn Gustavsson
* bjorn/base64-in-dumps/OTP-14686: Use base64 encoding in crash dumps Correct parsing of sub binaries Generalize passing of options for decoding
2017-11-23Place move S x0 instructions at the end of blocksMichał Muskała
The loader has a lot of fused instructions that include move S x0. Placing them at the end of blocks makes it possible to take advantage of this optimization more frequently.
2017-11-23Merge branch 'maint'Ingela Anderton Andin
2017-11-23fix missing document tag lost during mergeIngela Anderton Andin
2017-11-23Merge branch 'maint'Ingela Anderton Andin
2017-11-23Merge branch 'maint-18' into maintIngela Anderton Andin
2017-11-23Merge branch 'maint'Ingela Anderton Andin
2017-11-23Merge branch 'maint-19' into maintIngela Anderton Andin
2017-11-23Merge branch 'maint'Ingela Anderton Andin
Conflicts: OTP_VERSION
2017-11-23Merge branch 'maint-20' into maintIngela Anderton Andin
* maint-20: Updated OTP version Update release notes Update version numbers public_key: verify ip (both v4 and v6) public_key: Added IP4 address checks to hostname_verification tests ssl: Fix test cases to work on all test platforms public_key: Fix dialyzer spec ssl: Sessions must be registered with SNI if exists ssl: Extend hostname check to fallback to checking IP-address public_key, ssl: Handles keys so that APIs are preserved correctly ssl: Use ?FUNCTION_NAME ssl: Prepare for release ssl: Countermeasurements for Bleichenbacher attack Conflicts: lib/public_key/doc/src/public_key.xml lib/public_key/test/public_key_SUITE.erl lib/public_key/test/public_key_SUITE_data/pkix_verify_hostname_subjAltName_IP.pem lib/public_key/test/public_key_SUITE_data/verify_hostname_ip.conf lib/ssl/src/dtls_connection.erl lib/ssl/src/ssl_connection.erl lib/ssl/src/ssl_handshake.erl
2017-11-23Merge tag 'OTP-18.3.4.1.1' into maint-18Ingela Anderton Andin
=== OTP-18.3.4.1.1 === Changed Applications: - ssl-7.3.3.0.1 Unchanged Applications: - asn1-4.0.2 - common_test-1.12.1 - compiler-6.0.3 - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosNotification-1.2.1 - cosProperty-1.2 - cosTime-1.2.1 - cosTransactions-1.3.1 - crypto-3.6.3 - debugger-4.1.2 - dialyzer-2.9 - diameter-1.11.2 - edoc-0.7.18 - eldap-1.2.1 - erl_docgen-0.4.2 - erl_interface-3.8.2 - erts-7.3.1 - et-1.5.1 - eunit-2.2.13 - gs-1.6 - hipe-3.15 - ic-4.4 - inets-6.2.4 - jinterface-1.6.1 - kernel-4.2 - megaco-3.18 - mnesia-4.13.4 - observer-2.1.2 - odbc-2.11.1 - orber-3.8.1 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - parsetools-2.1.1 - percept-0.8.11 - public_key-1.1.1 - reltool-0.7 - runtime_tools-1.9.3 - sasl-2.7 - snmp-5.2.2 - ssh-4.2.2.1 - stdlib-2.8 - syntax_tools-1.7 - test_server-3.10 - tools-2.8.3 - typer-0.9.10 - webtool-0.9.1 - wx-1.6.1 - xmerl-1.3.10 Conflicts: OTP_VERSION lib/ssl/vsn.mk otp_versions.table