aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2016-06-02Eliminate crash for map updates in guardsBjörn Gustavsson
beam_validator would complain that x(1) is uninitialized in a test_heap instruction when attempting to compile the following code with sys_core_fold turned off: foo(M) when not (M#{true := 0}); [M] -> ok. Simplified, the generated BEAM assembly code looked like this: test is_map BadMap x(0) put_map_exact Fail x(0) => x(1) ... jump BooleanStuff BadMap: move ok => x(1) jump Fail BooleanStuff: ... move Boolean => x(2) jump Build Fail: move false => x(2) Build: test_heap 2 3 %% x(0), x(1), x(2) must be live. ... That is, if put_map_exact failed, control would transfer to the label Fail without initializing x(1). Fix that by making sure that x(1) is initilized even if put_map_exact fails: test is_map BadMap x(0) put_map_exact BadLbl x(0) => x(1) ... jump OkLbl BadLbl: move ok => x(1) jump Fail OkLbl: jump BooleanStuff BadMap: move ok => x(1) jump Fail BooleanStuff: ... move Boolean => x(2) jump Build Fail: move false => x(2) Build: test_heap 2 3 %% x(0), x(1), x(2) must be live. ... Note that this situation is rare, and that other optimization passes (beam_dead and beam_jump in particular) will clean up this mess.
2016-06-01beam_block: Eliminate crash in beam_utilsBjörn Gustavsson
Somewhat simplified, beam_block would rewrite the target for the first instruction in this code sequence: move x(0) => y(1) gc_bif '+' 1 x(0) => y(0) move y(1) => x(1) move nil => x(0) call 2 local_function/2 The resulting code would be: move x(0) => x(1) %% Changed target. gc_bif '+' 1 x(0) => y(0) move x(1) => y(1) %% Operands swapped (see 02d6135813). move nil => x(0) call 2 local_function/2 The resulting code is not safe because the x(1) will be killed by the gc_bif instruction. 7a47b20c3a cleaned up move optimizations and would reject the optimization if the target was an X register and an allocating instruction was found. To avoid this bug, the optimization must be rejected even if the target is a Y register.
2016-06-01Merge branch 'bjorn/compiler/beam_validator'Björn Gustavsson
* bjorn/compiler/beam_validator: Add additional coverage and smoke test of beam_validator beam_validator: Strengthen validation of match states beam_validator: Use a record representing the match context
2016-06-01Merge branch 'joedevivo/ssl/PR-1063/OTP-13635'Ingela Anderton Andin
* joedevivo/ssl/PR-1063/OTP-13635: ssl:recv timeout() can be 0
2016-05-31Merge branch 'rickard/rt-dep-erts-kernel-stdlib-sasl'Rickard Green
* rickard/rt-dep-erts-kernel-stdlib-sasl: Bumped runtime dependencies between erts, kernel, stdlib, sasl
2016-05-31Merge branch 'rickard/ts-platform-id'Rickard Green
* rickard/ts-platform-id: Update TS platform_id with off-heap msgq
2016-05-31Merge branch 'ingela/ssl/test-timeouts'Ingela Anderton Andin
* ingela/ssl/test-timeouts: ssl: Increase timeouts due to slow test machines
2016-05-31ssl: Increase timeouts due to slow test machinesIngela Anderton Andin
2016-05-31Merge branch 'kostis/hipe-cleanup-19-rc1'Sverker Eriksson
2016-05-31Add additional coverage and smoke test of beam_validatorBjörn Gustavsson
2016-05-31beam_validator: Strengthen validation of match statesBjörn Gustavsson
We want to find bugs in the compiler during compilation. Validation of match contexts was weak, which could allow serious bugs in the generated code to slip through.
2016-05-31beam_validator: Use a record representing the match contextBjörn Gustavsson
Using a record will make it much easier to add additional information.
2016-05-31Merge branch 'bjorn/compiler/misc'Björn Gustavsson
* bjorn/compiler/misc: Eliminate unsafe use of Y registers beam_validator: Add is_bitstring/1 as a safe BIF beam_validator: Remove uncovered line Teach beam_utils:is_pure_test/1 to handle is_bitstr and is_function2 beam_utils: Simplify handling of 'return' to eliminate uncovered line beam_jump: Clean up handling of labels before func_info beam_expect: Correctly handle blocks with multiple allocs v3_codegen: Don't confuse beam_validator v3_codegen: Correct code generation for an error/1 call in a guard beam_receive: Don't crash when encountering nonsensical code
2016-05-31Code rewrites to avoid exported vars warningsKostis Sagonas
2016-05-31Code rewrites to avoid exported vars compiler warningsKostis Sagonas
2016-05-31Define, export and use a hipe_icode:params() typeKostis Sagonas
2016-05-31Fix name of compiler option and the related warningsKostis Sagonas
2016-05-31Cleanups in hipe/main and hipe/rtlKostis Sagonas
* Rewrite matching statements in ?when_option macro to form that silences dialyzer's unmatched_return warnings * Treat compiler warnings as errors when compiling files in main
2016-05-31Eliminate stupid if constructKostis Sagonas
2016-05-31Use type name, not record notation, in specsKostis Sagonas
2016-05-31Various cleanups and simplificationsKostis Sagonas
2016-05-31Add missing type declarations to a recordKostis Sagonas
2016-05-31Make a type opaqueKostis Sagonas
2016-05-31Cosmetic cleanupsKostis Sagonas
2016-05-31Add compiler option -Werror to MakefilesKostis Sagonas
and correct the name of another, erroneously spelt, option in the process.
2016-05-31Merge branch 'sverker/dialyzer/erlang-halt'Sverker Eriksson
2016-05-31ssl:recv timeout() can be 0Joe DeVivo
gen_tcp:recv allows this, and if you're doing something like Transport:recv(Socket, 0, 0), TCP will work and SSL will exit with function_clause There were other cases of this throughout the module. This PR cleans them all up.
2016-05-31Merge branch 'binarin/better-ssl-diagnostics/PR-1060/ERL-774/OTP-13632'Ingela Anderton Andin
* binarin/better-ssl-diagnostics/PR-1060/ERL-774/OTP-13632: ssl: Remove error logger reports ssl: Better error handling of keys rejected by crypto Improve SSL diagnostics
2016-05-31ssl: Remove error logger reportsIngela Anderton Andin
We do not want error reports that can leek secret information into the logs.
2016-05-31ssl: Better error handling of keys rejected by cryptoIngela Anderton Andin
2016-05-31Improve SSL diagnosticsAlexey Lebedeff
There are a lot of cases where `ssl` application just returns unhelpful `handshake failure` or `internal error`. This patch tries to provide better diagnostics so operator can debug his SSL misconfiguration without doing hardcore erlang debugging. Here is an example escript that incorrectly uses server certificate as a client one: https://gist.github.com/binarin/35c34c2df7556bf04c8a878682ef3d67 With the patch it is properly reported as an error in "extended key usage".
2016-05-31Merge branch 'egil/erts/cuddle-tests'Björn-Egil Dahlberg
* egil/erts/cuddle-tests: stdlib: Fix small inconsistencies in ets_SUITE stdlib: Strengthen or relax test cases kernel: Don't test negative time values in file info erts: Fix free_mem calculation in bs_construct tests
2016-05-31Merge remote-tracking branch 'origin/ingela/ssl/dtls-test-cuddle'Ingela Anderton Andin
* origin/ingela/ssl/dtls-test-cuddle: ssl: Fix TLS version handling in dtls adepted tests
2016-05-31Merge branch 'dgud/wx/fix-seqfault-in-cleanup'Dan Gudmundsson
* dgud/wx/fix-seqfault-in-cleanup: wx: Fix occasional seq fault after appliction stops
2016-05-30Merge branch 'margnus1/llvm-upgrades/PR-1070'Sverker Eriksson
2016-05-30Update TS platform_id with off-heap msgqRickard Green
2016-05-30Merge branch 'sverker/crypto/gcm-evp-bug/ERL-144'Sverker Eriksson
2016-05-30Reintroduce erlang:halt/0/1 in erl_bif_types.erlSverker Eriksson
Removed in f9cb80861f169743 when changed impl from C to Erlang. But seems they are needed to keep dialyzer tests happy. Also improved bif_SUITE:shadow_comments to include all exported in module erlang, not just the "snifs". ...which detected that apply/2 was missing Shadowed comment as well.
2016-05-30Merge branch 'dgud/wx/quote-atoms-in-specs'Dan Gudmundsson
* dgud/wx/quote-atoms-in-specs: wx: Quote atoms in types and specs
2016-05-30Merge branch 'dgud/stdlib/relax-proc_lib-initial-call/OTP-13623'Dan Gudmundsson
* dgud/stdlib/relax-proc_lib-initial-call/OTP-13623: Relax translation of initial calls
2016-05-30Eliminate unsafe use of Y registersBjörn Gustavsson
If the Core Erlang optimization were turned off (using no_copt), the optimization passes for Beam assembly could generate unsafe code that did not initialize all Y registers before (for example) a call instruction. To fix this, beam_dead should not attempt to remove stores to Y registers. That is not safe if there is an exception-generating instruction inside a try...catch block.
2016-05-30beam_validator: Add is_bitstring/1 as a safe BIFBjörn Gustavsson
beam_validator wrongly complained that the following was not safe because it didn't know that is_bitstring/1 is safe: food(Curriculum) -> [try is_bitstring(functions) catch _ -> 0 end, Curriculum]. While we are it, also add a new bif_SUITE test suite to cover some more code in beam_validator.
2016-05-30beam_validator: Remove uncovered lineBjörn Gustavsson
The raise/3 instruction is specially handled, thus there is no need for bif_type/3 to handle raise/3 (also, the number of arguments was incorrect, so it could never have matched).
2016-05-30Teach beam_utils:is_pure_test/1 to handle is_bitstr and is_function2Björn Gustavsson
The 'is_bitstr' and 'is_function2' tests are pure. The corresponding BIFs have different names; thus the default call to erl_internal:new_type_test/2 is not sufficient.
2016-05-30wx: Fix occasional seq fault after appliction stopsDan Gudmundsson
There seems to be a timeing dependent double delete when doing reference cleanup after wx:destroy(). wxGraphicsObjects can thus not be free'ed by wx in the cleanup phase. A guess is that the underlying rendering context deletes all graphics objects without careeing about wxWidgets reference counting.
2016-05-30Merge branch 'kostis/beam_disasm-entry-type/PR-1072'Björn Gustavsson
* kostis/beam_disasm-entry-type/PR-1072: Declare the type of function entry points Export label() type
2016-05-27ssl: Fix TLS version handling in dtls adepted testsIngela Anderton Andin
2016-05-27stdlib: Fix small inconsistencies in ets_SUITEBjörn-Egil Dahlberg
2016-05-27stdlib: Strengthen or relax test casesBjörn-Egil Dahlberg
In particular, valgrind needs a lot of time for certain tests.
2016-05-27kernel: Don't test negative time values in file infoBjörn-Egil Dahlberg