aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-02-01Merge branch 'lukas/erts/fix_system_info_kernelpoll/OTP-15556' into maintLukas Larsson
* lukas/erts/fix_system_info_kernelpoll/OTP-15556: erts: Fix erlang:system_info(kernel_poll) to return correct value
2019-02-01erts: Fix erlang:system_info(kernel_poll) to return correct valueLukas Larsson
2019-02-01Merge branch 'maint'Lukas Larsson
2019-02-01fix: erts: Remove dead ERTS_MAGIC_REF_BIF_TIMERS codeLukas Larsson
2019-02-01Merge branch 'maint'Lukas Larsson
2019-02-01Merge branch 'lukas/OTP-21.3-cleanup' into maintLukas Larsson
* lukas/OTP-21.3-cleanup: erl_interface: Fix bsd makefile problem erts: Remove dead ERTS_MAGIC_REF_BIF_TIMERS code
2019-02-01erl_interface: Fix bsd makefile problemLukas Larsson
2019-02-01erts: Remove dead ERTS_MAGIC_REF_BIF_TIMERS codeLukas Larsson
Using magic refs for big timers caused too large a stress on the off_heap GC implementation to be viable, so it was never enable. The code is now broken because of other changes to we might as well remove it.
2019-02-01inets: Ignore bracket option in format_addressPéter Dimitrov
Ignore the option 'ipv6_host_with_brackets' when formatting addresses to be used in lower level functions. Change-Id: I3b7b276b37fe129ade9208519bff226e17ae7c57
2019-01-31Merge branch 'maint'Sverker Eriksson
2019-01-31Merge branch 'sverker/port-control-badarg/OTP-15555' into maintSverker Eriksson
* sverker/port-control-badarg/OTP-15555: erts: Add doc warnings for erlang:port_command|call|control erts: Add magic port control numbers
2019-01-31Fix internal consistency failure caused by beam_exceptBjörn Gustavsson
Fix a bug where the number of live registers in a `bs_get_tail` instruction was too low. Consider this example: -export([bs_get_tail/2]). bs_get_tail(Bin, Config) -> bs_get_tail_1(Bin, 0, 0, Config). bs_get_tail_1(<<_:32, Rest/binary>>, Z1, Z2, F1) -> {Rest,Z1,Z2,F1}. `beam_validator` would emit the following diagnostics: t: function bs_get_tail_1/4+2: Internal consistency check failed - please report this bug. Instruction: {func_info,{atom,t},{atom,bs_get_tail_1},4} Error: {uninitialized_reg,{x,3}}: Here is the part of the code that generates the `function_clause` exception before the optimization: {test_heap,6,4}. {put_list,{x,3},nil,{x,2}}. {put_list,{integer,0},{x,2},{x,2}}. {put_list,{integer,0},{x,2},{x,2}}. {bs_set_position,{x,1},{x,0}}. {bs_get_tail,{x,1},{x,0},3}. %3 live registers. {test_heap,2,3}. {put_list,{x,0},{x,2},{x,1}}. {move,{atom,function_clause},{x,0}}. {line,[{location,"t.erl",8}]}. {call_ext_only,2,{extfunc,erlang,error,2}}. The `bs_get_tail` instruction expects that 3 registers will be live at this point. `beam_except` rewrites the code like this: {bs_set_position,{x,1},{x,0}}. {bs_get_tail,{x,1},{x,0},3}. %Still 3. Too low. {move,{integer,0},{x,1}}. {move,{integer,0},{x,2}}. {jump,{f,3}}. Now the number of live registers in `bs_get_tail` is too low, because the `{x,3}` register will become undefined. This commit adds code to update the number of live registers in the `bs_get_tail` instruction, producing this code: {bs_set_position,{x,1},{x,0}}. {bs_get_tail,{x,1},{x,0},4}. %Adjusted to 4. {move,{integer,0},{x,1}}. {move,{integer,0},{x,2}}. {jump,{f,3}}.
2019-01-31Merge branch 'maint'Björn Gustavsson
* maint: Eliminate bogus warning when using tuple calls
2019-01-31Merge pull request #2119 from bjorng/bjorn/compiler/tuple-call/ERL-838/OTP-15552Björn Gustavsson
Eliminate bogus warning when using tuple calls
2019-01-30Eliminate bogus warning when using tuple callsBjörn Gustavsson
There would be a bogus warning when compiling the following function with the `tuple_calls` option: dispatch(X) -> (list_to_atom("prefix_" ++ atom_to_list(suffix))):doit(X). The warning would look like this: no_file: this expression will fail with a 'badarg' exception https://bugs.erlang.org/browse/ERL-838
2019-01-30[socket-nif] Preliminary windows adaptionsMicael Karlberg
Added preliminary, and temporary, windows adaptions. Basically they amount to letting all nif-callback functions returning badarg for all calls if on windows (this has been accomplished by if-defing the nif-code; if win32 then badarg else do-something). OTP-15526
2019-01-30Merge pull request #2115 from bjorng/bjorn/compiler/opt-function_clauseBjörn Gustavsson
Enhance optimization of function_clause exceptions
2019-01-30Merge branch 'peterdmv/ssl/improve-logging'Péter Dimitrov
* peterdmv/ssl/improve-logging: ssl: Improve ssl_logger Change-Id: I3b181ed527ce210af6c4a7576576fa522fb20767
2019-01-30Merge branch 'peterdmv/ssl/server-send-finished'Péter Dimitrov
* peterdmv/ssl/server-send-finished: ssl: Fix dialyzer warnings ssl: Add 'Finished' ssl: Use HKDF hash function in Transcript-Hash ssl: Improve test of 1-RTT handshake ssl: Update certificate_verify ssl: Update function build_content ssl: Fix encoding of the Certificate message ssl: Add EncryptedExtensions ssl: Fix encoding of empty extensions ssl: Fix key schedule and traffic keys ssl: Encode/decode CertificateVerify Change-Id: Ie525de276ca4ebd9f9fb0fbdc9dc3822f91834e0
2019-01-30Merge branch 'peterdmv/crypto/fix-type-specs'Péter Dimitrov
* peterdmv/crypto/fix-type-specs: crypto: Fix type spec rsa_sign_verify_opt() Change-Id: Ib7c46c850f29d583a645e78a7e87f334c784518d
2019-01-30Merge pull request #2116 from bjorng/bjorn/compiler/add-smoke-testBjörn Gustavsson
Add lib/compiler/scripts/smoke
2019-01-30Merge branch 'maint'Ingela Anderton Andin
2019-01-30Merge pull request #2109 from IngelaAndin/ingela/ssl/active-checkIngela Andin
ssl: Correct check for delayed close due to undliverd data
2019-01-30Merge branch 'maint'Péter Dimitrov
* maint: ssl: Improve openssl interop tests Change-Id: I5eec73687e9693ab5b08953c5e3db0d09cfd1690
2019-01-30Merge branch 'peterdmv/ssl/improve_openssl_interop_tests' into maintPéter Dimitrov
* peterdmv/ssl/improve_openssl_interop_tests: ssl: Improve openssl interop tests Change-Id: I65b63ddb8c8948d246e341f8c821b3b499507cb6
2019-01-29Fix spec for erl_epmd:port_pleaseLoïc Hoguin
It accepts both atoms and strings for the node and host name, plus IP tuples for the host name.
2019-01-29ssl: Improve ssl_loggerPéter Dimitrov
Improve API and delay creation of map arguments for ?LOG_DEBUG macro. Change-Id: I6956112fe64e599d33d83dfdd710cad53b8449e1
2019-01-29Add lib/compiler/scripts/smokeBjörn Gustavsson
Add `lib/compiler/scripts/smoke` for smoke testing the compiler (that is, test that the compiler does not crash during compilation). `smoke` first installs Elixir and mix. It then uses `mix` to download a number of `hex` packages and compile them. We don't intend to use `smoke` in our daily builds or Travis, but to run it manually during compiler development.
2019-01-29Enhance optimization of function_clause exceptionsBjörn Gustavsson
There is an optimization for reducing the number of instructions needed to generate a `function_clause`. After the latest improvements of the type optimization pass, that optimization is not always applied. Here is an example: -export([foo/3]). foo(X, Y, Z) -> bar(a, X, Y, Z). bar(a, X, Y, Z) when is_tuple(X) -> {X,Y,Z}. Note that the compiler internally adds a clause to each function to generate a `function_clause` exception. Thus: bar(a, X, Y, Z) when is_tuple(X) -> {X,Y,Z}; bar(A1, A2, A3, A4) -> erlang:error(function_clause, [A1,A2,A3,A4]). Optimizations will rewrite the code basically like this: bar(_, X, Y, Z) when is_tuple(X) -> {X,Y,Z}; bar(_, A2, A3, A4) -> erlang:error(function_clause, [a,A2,A3,A4]). Note the `a` as the first element of the list of arguments. It will prevent the optimization of the `function_clause` exception. The BEAM code for `bar/4` looks like this: {function, bar, 4, 4}. {label,3}. {line,[{location,"t.erl",8}]}. {func_info,{atom,t},{atom,bar},4}. {label,4}. {'%',{type_info,{x,0},{atom,a}}}. {test,is_tuple,{f,5},[{x,1}]}. {test_heap,4,4}. {put_tuple2,{x,0},{list,[{x,1},{x,2},{x,3}]}}. return. {label,5}. {test_heap,8,4}. {put_list,{x,3},nil,{x,0}}. {put_list,{x,2},{x,0},{x,0}}. {put_list,{x,1},{x,0},{x,0}}. {put_list,{atom,a},{x,0},{x,1}}. {move,{atom,function_clause},{x,0}}. {line,[{location,"t.erl",8}]}. {call_ext,2,{extfunc,erlang,error,2}}. The code after label 5 is the clause that generates the `function_clause` exception. This commit generalizes the optimization so that it can be applied for this function: {function, bar, 4, 4}. {label,3}. {line,[{location,"t.erl",8}]}. {func_info,{atom,t},{atom,bar},4}. {label,4}. {'%',{type_info,{x,0},{atom,a}}}. {test,is_tuple,{f,5},[{x,1}]}. {test_heap,4,4}. {put_tuple2,{x,0},{list,[{x,1},{x,2},{x,3}]}}. return. {label,5}. {move,{atom,a},{x,0}}. {jump,{f,3}}. For this particular function, it would be safe to omit the `move` instruction before the `{jump,{f,3}}` instruction, but it would not be safe in general to omit `move` instructions.
2019-01-29[socket-nif] The otp rcvbuf option updatedMicael Karlberg
Its now possible to set a rcvbuf (otp) option value of {N :: pos_integer(), BufSz :: pos_integer()}. This value is used for type stream and protocol tcp, when calling the function recv with length = 0 (zero). The second value, BufSz, is the actual size of the receive buffer used when calling the socket recv function, and the first value, N, is the max number of possible reads that will be performed (at most), even if there is more data to read. This is limit the effect of DoS attacks. OTP-15497
2019-01-29Merge branch 'john/compiler/refactor-validator-type-mgmt'John Högberg
* john/compiler/refactor-validator-type-mgmt: beam_validator: Add explicit assertions for fragile terms beam_validator: Refactor type management
2019-01-29ssl: Improve openssl interop testsPéter Dimitrov
openssl 1.1.x changed the default ECC curves that made testcases fail in the ECC suite. openssl s_server and s_client sent 'Illegal Parameter' alert when the CertificateVerify (client) or ServerKeyExchange (server) message was signed with a curve that was not present in openssl's default ECC curve list (x25519, secp256r1, secp521r1, secp384r1, brainpoolP256r1, brainpoolP384r1, brainpool512r1). This commit changes the default curve of make_ec_cert_chains to 'secp256r1' and explicitly configures the default curve in those testcases where the default curve of the ssl application is expected. Change-Id: I81ebe1a30b8f863b0e2836b1dad3d8bc767cc47e
2019-01-29Merge pull request #2112 from bjorng/bjorn/compiler/compilation-speedBjörn Gustavsson
Speed up the compiler when compiling the idna package
2019-01-29Merge pull request #2111 from bjorng/bjorn/compiler/not-problem/ERL-840Björn Gustavsson
Fix problems compiling Scalaris
2019-01-29Merge branch 'bjorn/compiler/beam_except'Björn Gustavsson
* bjorn/compiler/beam_except: beam_except: Eliminate unsafe function_clause translation
2019-01-28erts: Add doc warnings for erlang:port_command|call|controlSverker Eriksson
done on unknown ports.
2019-01-28erts: Add magic port control numbersSverker Eriksson
to increase the probablity of a nice badarg from erlang:port_control.
2019-01-28Merge PR-2108 from sverker/ets-doc-iter-oddity/OTP-15325Sverker Eriksson
Add ETS doc note about subtle iteration oddities
2019-01-28crypto: Fix type spec rsa_sign_verify_opt()Péter Dimitrov
Add missing type {rsa_mgf1_md, sha2} to rsa_sign_verify_opt. This commit fixes dialyzer warnings when crypto users configured explicit MGF1 hash function for RSA PSS signatures. Change-Id: Ie11b1c73fc0d111303e256a578a2fd7b0d09b18a
2019-01-28ssl: Fix dialyzer warningsPéter Dimitrov
Change-Id: Icc6c1433dba8d35f81162ef8100292bf2ba53c71
2019-01-28beam_validator: Add explicit assertions for fragile termsJohn Högberg
We haven't seen any related bugs so far, but all instructions that place a term in another ought to reject fragile inputs. It can't hurt to check.
2019-01-28beam_validator: Refactor type managementJohn Högberg
Our current type management (based on set_type_reg etc) is rather error-prone, often requiring special cases on a per-instruction basis. This commit replaces nearly all ad-hoc mechanisms with more general abstractions: * assign - Moves a term. * create_term - Creates a new term. * extract_term - Extracts a term from another, maintaining fragility as required. * update_type - Adds more type information about a register. * type_test - Helper function for type tests that subtracts on failure and meets on success.
2019-01-28beam_except: Eliminate unsafe function_clause translationBjörn Gustavsson
The translation from `error(function_clause, Args)` to a jump to the `func_info` label is not safe if there is a stack frame.
2019-01-28ssl: Add 'Finished'Péter Dimitrov
Implement Finished message on the server side. Change-Id: Ie0d054ac80f7eb47797273e1878990335112e923
2019-01-28ssl: Use HKDF hash function in Transcript-HashPéter Dimitrov
Two hash functions needed to create the CertificateVerify message. One for creating the Transcript-Hash and another for the digital signature. Transcript-Hash uses the HKDF hash of the selected cipher suite, the digital signature uses the hash defined by the selected signature scheme. Change-Id: Ife68ec123682d9aaf42c6b46cc2608e1df8be8d6
2019-01-28ssl: Improve test of 1-RTT handshakePéter Dimitrov
Change-Id: Iaffe5d6e402448f1da5e37b0e55829fa72af310d
2019-01-28ssl: Update certificate_verifyPéter Dimitrov
Change-Id: I6adacc846f938d1ca1eb1a798780cc804b501a71
2019-01-28ssl: Update function build_contentPéter Dimitrov
Change-Id: I91c5866f1400c3ad9c7eab1292c3ceb32a482c70
2019-01-28ssl: Fix encoding of the Certificate messagePéter Dimitrov
Fix encoding of extensions in CertificateEntries. Change-Id: I776a2210d2aa51cde3be5e0bc87d9beb8d63825c
2019-01-28ssl: Add EncryptedExtensionsPéter Dimitrov
Send empty EncryptedExtensions after ServerHello. Update ssl logger. Change-Id: Id57fdb52c360a1125ac1a735ee37c433bfb69a0a