aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-01-15Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Correct handling of parameters of opaque types
2016-01-15Merge branch 'hb/dialyzer/fix_opaque_type_parms/OTP-13237' into maintHans Bolinder
* hb/dialyzer/fix_opaque_type_parms/OTP-13237: dialyzer: Correct handling of parameters of opaque types
2016-01-15dialyzer: Correct handling of parameters of opaque typesHans Bolinder
Correction of commit d57f5e.
2016-01-14Merge branch 'maint'Sverker Eriksson
2016-01-14Merge branch 'sverk/trace-doc-typo' into maintSverker Eriksson
* sverk/trace-doc-typo: erts: Correct faulty doc for erlang:trace/3
2016-01-14erts: Correct faulty doc for erlang:trace/3Sverker Eriksson
The entire MFA tuple is replaced with 0, not just Arity.
2016-01-14Merge branch 'maint'Rickard Green
* maint: Do not allow aux work on dirty schedulers
2016-01-14Merge branch 'vinoski/dirty-sched-no-aux-work/OTP-13236' into maintRickard Green
* vinoski/dirty-sched-no-aux-work/OTP-13236: Do not allow aux work on dirty schedulers
2016-01-13Merge branch 'sverk/fvisibility-hidden/OTP-13227'Sverker Eriksson
* sverk/fvisibility-hidden/OTP-13227: erts: Allow -fvisibility=hidden for NIFs and drivers erts: Cleanup erl_driver.h for windows erts: Refactor ERL_NIF_INIT macro
2016-01-13Merge branch 'maint'Björn Gustavsson
* maint: Fix crash when attempting to update a fun as if it were a map
2016-01-13Merge branch 'bjorn/compiler/map-bug/OTP-13231' into maintBjörn Gustavsson
* bjorn/compiler/map-bug/OTP-13231: Fix crash when attempting to update a fun as if it were a map
2016-01-13Merge branch 'hb/stdlib/fix_dets_file_name/OTP-13229'Hans Bolinder
* hb/stdlib/fix_dets_file_name/OTP-13229: stdlib: Let dets:open_file() crash when given raw file name
2016-01-13stdlib: Let dets:open_file() crash when given raw file nameHans Bolinder
See also ERL-55.
2016-01-13Merge branch 'maint'Hans Bolinder
* maint: stdlib: Fix linter crash due to missing -module declaration Conflicts: lib/stdlib/test/erl_lint_SUITE.erl
2016-01-13Merge branch 'hb/stdlib/fix_linter_no_module/OTP-13230' into maintHans Bolinder
* hb/stdlib/fix_linter_no_module/OTP-13230: stdlib: Fix linter crash due to missing -module declaration
2016-01-13stdlib: Fix linter crash due to missing -module declarationHans Bolinder
The Erlang Code Linter no longer crashes if there is a -deprecated() attribute but no -module() declaration. See also ERL-62 at bugs.erlang.org.
2016-01-13Merge branch 'maint'Hans Bolinder
* maint: stdlib: fix erl_eval not using non-local function handler
2016-01-13Merge branch 'hb/stdlib/fix_erl_eval/OTP-13228' into maintHans Bolinder
* hb/stdlib/fix_erl_eval/OTP-13228: stdlib: fix erl_eval not using non-local function handler
2016-01-13stdlib: fix erl_eval not using non-local function handlerHans Bolinder
See also ERL-32 at bugs.erlang.org. Thanks to Ben Paxton.
2016-01-12Fix crash when attempting to update a fun as if it were a mapBjörn Gustavsson
The following example would cause an internal consistency failure in the compiler: f() -> ok. update() -> (fun f/0)#{u => 42}. The reason is that internally, v3_core will (incorrectly) rewrite update/0 to code similar to this: update() -> if is_map(fun f/0) -> maps:update(u, 42, fun f/0) end. Since funs are not allowed to be created in guards, incorrect and unsafe code would be generated. It is easy to fix the bug. There already is a is_valid_map_src/1 function in v3_core that tests whether the argument for the map update operation can possibly be a valid map. A fun is represented as a variable with a special name in Core Erlang, so it would not be recognized as unsafe. All we'll need to do to fix the bug is to look closer at variables to ensure they don't represent funs. That will ensure that the code is rewritten in the correct way: update() -> error({badmap,fun f/0}) end. Reported-by: Thomas Arts
2016-01-11Merge branch 'maint'Henrik Nord
Conflicts: OTP_VERSION
2016-01-11Merge branch 'maint-18' into maintHenrik Nord
2016-01-11Merge branch 'maint'Björn Gustavsson
* maint: Eliminate crash in v3_codegen
2016-01-11Eliminate crash in v3_codegenBjörn Gustavsson
The following code would crash v3_codegen: order(From) -> catch if From#{[] => sufficient} -> saint end. Before explaining the crash, first some background on the stack frame and the Y registers. Certain instructions, most notably the 'call' instructions, clobber all X registers. Before any such instruction, all X registers that have values that will be used after the call must be saved to Y registers (i.e. to the stack frame). adjust_stack/4 will be called when X registers must be saved. There is also another situation when X registers must be saved, namely within a 'catch' if we are about to execute any instruction that may cause an exception. Examples of such instructions are some guard BIFs (such as length/1) and construction of binaries or maps. Within a 'catch', X registers must be be saved because if an exception is thrown and catched all X registers will be destroyed. The same adjust_stack/4 function will be called for those instructions, but only if they occur within a 'catch'. There is actually one more complication. If there is code in a guard within a catch, the X registers should not be saved, because the code in a guard never clobbers any X registers that were alive before the guard code was entered. v3_codegen is written with the implicit assumption that code in guards never cause anything to be saved to Y registers. The code for building maps and binaries would incorrectly save X registers within a guard inside a 'catch'. For construction of binaries, that would mean that a useless but harmelss 'move' instruction was generated. But for construction of maps, the saving of the Y register would not be harmless. There would be a crash when attempting to merge #sr{} records. #sr{} records keeps track of the contents of X and Y registers. When two separate code paths are joined (e.g. at the end of 'case' statement), the register descriptors must be reconciled. Basically, the register descriptors for both paths must be identical. The #sr{} record for one path must not claim that {y,0} contains a certain value, while another path claims that {y,0} is dead. Thus, the crash occurs in sr_merge/2 when failing to reconcile the Y registers. To fix this bug this bug we will introduce a new function called maybe_adjust_stack/5. It will save X registers on the stack only if the code is inside a catch but not inside a guard. We will change all existing code to use this new function when appropriate. Reported-by: Thomas Arts
2016-01-08erts: Allow -fvisibility=hidden for NIFs and driversSverker Eriksson
as is strongly recommended by gcc man page. We use __attribute__ ((visibility("default"))) to make sure the init functions are properly exported.
2016-01-08erts: Cleanup erl_driver.h for windowsSverker Eriksson
The comment is misleading and no need to "export" static windows drivers. DRIVER_INIT for dynamic windows drivers is defined in erl_win_dyn_driver.h
2016-01-08erts: Refactor ERL_NIF_INIT macroSverker Eriksson
2016-01-08Updated OTP versionOTP-18.2.2Erlang/OTP
2016-01-08Update release notesErlang/OTP
2016-01-08Merge branch 'hans/ssh/keyboard_interactive0/OTP-13255' into maint-18Erlang/OTP
* hans/ssh/keyboard_interactive0/OTP-13255: ssh: update vsn.mk to 4.2.1 ssh: handle secondary ssh_msg_userauth_info_request message ssh: testcase for abnormal keyboard-interactive authentication
2016-01-08ssh: update vsn.mk to 4.2.1Hans Nilsson
2016-01-08ssh: handle secondary ssh_msg_userauth_info_request messageHans Nilsson
2016-01-08ssh: testcase for abnormal keyboard-interactive authenticationHans Nilsson
2016-01-08Merge branch 'maint'Björn Gustavsson
* maint: beam_bool: Fix unsafe optimization
2016-01-07Merge branch 'sverk/proc-dict-opt'Sverker Eriksson
OTP-13167 * sverk/proc-dict-opt: erts: Add new test case pdict_SUITE:mixed erts: Add 'fill_heap' to erts_debug:state_internal_state erts: Rename proc dict size to arraySize erts: Refactor proc dict with 'usedSlots' erts: Add sizeMask for faster proc dict indexing erts: Remove ProcDict.used erts: Add proc dict macros ERTS_PD_START/SIZE erts: Optimize away function "array_put" in proc dict erts: Optimize hashing in process dictionary
2016-01-07Merge branch 'sverk/hipe-mmap-config'Sverker Eriksson
* sverk/hipe-mmap-config: erts: Add config test for MAP_NORESERVE for hipe on 64-bit
2016-01-07erts: Add config test for MAP_NORESERVE for hipe on 64-bitSverker Eriksson
to get a nicer error on FreeBSD and others that does not support MAP_NORESERVE for mmap. Q: How to support this? A: Implement the "literal tag" in hipe or another way to reserve virtual address space in erl_mmap.c
2016-01-07Merge branch 'sverk/float_SUITE-arith'Sverker Eriksson
* sverk/float_SUITE-arith: erts: Add new test cases to float_SUITE
2016-01-07Merge branch 'sverk/check_process_code-fix'Sverker Eriksson
* sverk/check_process_code-fix: erts: Fix bug in check_process_code for literals
2016-01-07Merge branch 'bjorn/compiler/beam_bool/OTP-13208' into maintBjörn Gustavsson
* bjorn/compiler/beam_bool/OTP-13208: beam_bool: Fix unsafe optimization
2016-01-07beam_bool: Fix unsafe optimizationBjörn Gustavsson
beam_bool would make the following code unsafe (which would be reported by beam_validator): scotland(Echo) -> found(case Echo of Echo when true; Echo, Echo, Echo -> Echo; echo -> [] end, Echo = placed). found(_, _) -> million. Basically, beam_bool would see that the 'case' would always return the value of Echo. Thus: scotland(Echo) -> found(Echo, Echo = placed). The only problem is that beam_bool would also remove a 'move' instruction that would save Echo to the stack. Here is the assembly code for part of the function: {allocate_zero,1,1}. {move,{x,0},{y,0}}. %% Save Echo on stack. {bif,'=:=',{f,7},[{x,0},{atom,true}],{x,1}}. {bif,'=:=',{f,7},[{x,0},{atom,true}],{x,2}}. {bif,'=:=',{f,7},[{x,0},{atom,true}],{x,3}}. {bif,'and',{f,7},[{x,2},{x,3}],{x,2}}. {bif,'and',{f,7},[{x,1},{x,2}],{x,1}}. {jump,{f,8}}. {label,7}. {move,{atom,false},{x,1}}. {label,8}. {bif,'or',{f,6},[{atom,true},{x,1}],{x,1}}. {test,is_eq_exact,{f,6},[{x,1},{atom,true}]}. %% Jump never taken. {jump,{f,5}}. {label,6}. {test,is_eq_exact,{f,9},[{x,0},{atom,echo}]}. {move,nil,{x,0}}. {jump,{f,5}}. {label,9}. {test_heap,3,0}. {put_tuple,2,{x,0}}. {put,{atom,case_clause}}. {put,{y,0}}. {line,[{location,"t.erl",5}]}. {call_ext,1,{extfunc,erlang,error,1}}. {jump,{f,5}}. {label,5}. {test,is_eq_exact,{f,12},[{atom,placed},{y,0}]}. beam_bool would see that the is_eq_exact test at label 8 would always succeed. It could therefore remove most of the code before the jump to label 5. Unfortunately it also removed the essential move of Echo to the stack: {allocate_zero,1,1}. %% Instruction incorrectly removed: {move,{x,0},{y,0}}. {jump,{f,5}}. {label,5}. {test,is_eq_exact,{f,12},[{atom,placed},{y,0}]}. The root cause of the problem is that the 'move' instruction is included in the block of 'bif' instructions before label 8. Normally the 'move' instruction would not have been discarded, but because the left operand to the 'or' BIF is 'true', the entire block with 'bif' instructions are dropped. As far as I can see, there is no gain by including 'move' instructions in the first place. There is no way that better code will be produced. In fact, the entire optimization can be given up if 'move' instructions are found in the block. Thus we can fix this bug by never including any 'move' instructions in the block of 'bif' instructions. We can also remove all the code that deals with 'move' instructions within blocks. Reported-by: Thomas Arts
2015-12-30Merge branch 'maint'Rickard Green
* maint: Light weight statistics of run queue lengths Conflicts: erts/preloaded/ebin/erlang.beam
2015-12-30Merge branch 'rickard/rq-len/OTP-13201' into maintRickard Green
* rickard/rq-len/OTP-13201: Light weight statistics of run queue lengths
2015-12-30Light weight statistics of run queue lengthsRickard Green
- statistics(total_run_queue_lengths) - statistics(run_queue_lengths) - statistics(total_active_tasks) - statistics(active_tasks) Conflicts: erts/emulator/beam/erl_process.c
2015-12-30Merge branch 'maint'Rickard Green
* maint: Use monotonic time for call_time trace
2015-12-30Merge branch 'rickard/trace_call_time/OTP-13216' into maintRickard Green
* rickard/trace_call_time/OTP-13216: Use monotonic time for call_time trace
2015-12-30Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Fix asynchronous BIF timer cancellation message reply
2015-12-29Fix asynchronous BIF timer cancellation message replyRickard Green
2015-12-28Merge branch 'maint'Zandra
2015-12-28Merge branch 'zandra/update-java-versions-doc' into maintZandra
* zandra/update-java-versions-doc: update java version in documentation OTp-13221