diff options
101 files changed, 1653 insertions, 547 deletions
diff --git a/erts/doc/src/erl_cmd.xml b/erts/doc/src/erl_cmd.xml index cbf47eca12..f6a36ecffd 100644 --- a/erts/doc/src/erl_cmd.xml +++ b/erts/doc/src/erl_cmd.xml @@ -1081,7 +1081,7 @@ $ <input>erl \ </item> <tag><marker id="+pad"/><c>+pad true|false</c></tag> <item> - <p>Since: OTP @OTP-18374@</p> + <p>Since: OTP 25.3</p> <p> The boolean value used with the <c>+pad</c> parameter determines the default value of the diff --git a/erts/doc/src/erl_dist_protocol.xml b/erts/doc/src/erl_dist_protocol.xml index 8dd99b01fc..389e967f5f 100644 --- a/erts/doc/src/erl_dist_protocol.xml +++ b/erts/doc/src/erl_dist_protocol.xml @@ -560,7 +560,7 @@ io:format("old/unused name ~ts at port ~p, fd = ~p ~n", A bug introduced in OTP 25.0 may cause OTP 25 nodes to reject connection attempts from OTP 23 and 24 nodes that are not using <c>epmd</c> to gain version information about the remote node. - This is fixed in OTP @OTP-18404@. + This is fixed in OTP 25.3. </p> </note> <section> diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 908b3c7c7a..ea0cb1f988 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6285,7 +6285,7 @@ receive_replies(ReqId, N, Acc) -> <func> <name name="process_flag" arity="2" clause_i="1" - anchor="process_flag_async_dist" since="OTP @OTP-18374@"/> + anchor="process_flag_async_dist" since="OTP 25.3"/> <fsummary> Enable or disable fully asynchronous distributed signaling for the calling process. @@ -6806,7 +6806,7 @@ receive_replies(ReqId, N, Acc) -> <c>{async_dist, Enabled}</c> </tag> <item> - <p>Since: OTP @OTP-18374@</p> + <p>Since: OTP 25.3</p> <p> Current value of the <seeerl marker="erlang#process_flag_async_dist"> @@ -8061,7 +8061,7 @@ true</pre> <c>{async_dist, Enabled}</c> </tag> <item> - <p>Since: OTP @OTP-18374@</p> + <p>Since: OTP 25.3</p> <p> Set the <seeerl marker="erlang#process_flag_async_dist"> @@ -11104,7 +11104,7 @@ Metadata = #{ pid => pid(), <func> <name name="system_info" arity="1" clause_i="79" - anchor="system_info_async_dist" since="OTP @OTP-18374@"/> <!-- async_dist --> + anchor="system_info_async_dist" since="OTP 25.3"/> <!-- async_dist --> <name name="system_info" arity="1" clause_i="14" anchor="system_info_dist" since=""/> <!-- creation --> <name name="system_info" arity="1" clause_i="16" since="OTP 18.0"/> <!-- delayed_node_table_gc --> @@ -11119,7 +11119,7 @@ Metadata = #{ pid => pid(), <taglist> <tag><marker id="system_info_async_dist"/><c>async_dist</c></tag> <item> - <p>Since: OTP @OTP-18374@</p> + <p>Since: OTP 25.3</p> <p> Returns the value of the command line argument <seecom marker="erl#+pad">+pad <boolean></seecom> diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 6aa4444a03..7f74df820d 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -31,6 +31,170 @@ </header> <p>This document describes the changes made to the ERTS application.</p> +<section><title>Erts 13.2</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p>Fixed a bug on Windows where + <c>file:read_file_info/1</c> would fail for files with + corrupt metadata.</p> + <p> + Own Id: OTP-18348 Aux Id: GH-6356 </p> + </item> + <item> + <p> + Fix <c>process_info(_, binary)</c> to again include + "writable binaries" which were lost in OTP-25.0. Writable + binaries are an optimization used when binaries are + appended upon in a loop.</p> + <p> + Own Id: OTP-18373 Aux Id: PR-6574, GH-6573 </p> + </item> + <item> + <p> + Fix rare race when receiving fragmented messages on a + terminating connection. Could potentially cause memory + leaks as well as double free crashes. Bug exists since + OTP 22.0.</p> + <p> + Own Id: OTP-18382 Aux Id: PR-6585 </p> + </item> + <item> + <p> + Fixed bug that could maybe cause problems when a file + descriptor number is closed by a linked in driver and + then opened (reused) and passed to <c>enif_select</c> by + a NIF. No actual symptoms seen, only failed internal + assertions in debug build.</p> + <p> + Own Id: OTP-18391</p> + </item> + <item> + <p> + The runtime system could crash when tracing a process + executing on a dirty scheduler.</p> + <p> + Own Id: OTP-18398 Aux Id: PR-6495, GH-6448, GH-5984 </p> + </item> + <item> + <p>In the binary syntax, attempting to match out integers + with size exceeding 2 GiB could crash the runtime + system.</p> + <p> + Own Id: OTP-18406 Aux Id: GH-6701 </p> + </item> + <item> + <p>Fixed edge case in floating-point negation where <c>A + = 0.0, B = -A</c> did not produce <c>B = -0.0</c> on + x86_64 JIT.</p> + <p> + Own Id: OTP-18411 Aux Id: GH-6717 </p> + </item> + <item> + <p>Fixed an issue in the JIT that could crash the + emulator on some platforms.</p> + <p> + Own Id: OTP-18418</p> + </item> + <item> + <p> + Added meta data to the windows installer.</p> + <p> + Own Id: OTP-18429 Aux Id: PR-6587 GH-4232 GH-6537 </p> + </item> + <item> + <p>Fixed ETS insertion order into <c>bag</c> and + <c>duplicate_bag</c> of tuples with identical keys when + passed in a list to <c>ets:insert/2</c>. The insert order + has been head-to-tail but was accidentally changed in OTP + 23.0. For <c>bag</c> it was reverted (tail-to-head), + while for <c>duplicate_bag</c> it was sometimes reverted + depending on the length of the list and number of + "reductions" left for the calling process.</p> <p>This + fix changes the insert order of <c>ets:insert/2</c> back + to always be head-to-tail of the list argument.</p> + <p> + Own Id: OTP-18434 Aux Id: PR-6752 </p> + </item> + <item> + <p>With the JIT for AArch64 (AMD64), calling <c>bxor</c> + in with non-integer arguments in a guard would crash the + runtime system.</p> + <p> + Own Id: OTP-18454 Aux Id: PR-6839 </p> + </item> + <item> + <p> + Fix bug regarding process flag <c>max_heap_size</c>. + Could cause strange behavior when a process was killed + due to exceeding the limit.</p> + <p> + Own Id: OTP-18457 Aux Id: PR-6816 </p> + </item> + <item> + <p> + Fixed binary comprehensions to be similar to other + creation of binary data with respect to its contribution + of triggering garbage collection.</p> + <p> + Own Id: OTP-18458</p> + </item> + <item> + <p>In rare circumstances, when a process exceeded its + allowed heap size set by option <c>max_heap_size</c>, it + would not be killed as it should be, but instead enter a + kind of zombie state it would never get out of.</p> + <p> + Own Id: OTP-18463 Aux Id: PR-6858 </p> + </item> + <item> + <p>Instead of crashing, the <c>list_to_integer/1</c> and + <c>list_to_integer/2</c> BIFs now raise the + <c>system_limit</c> exception for overlong lists that + can't be converted to integers. Similarly, the + <c>string:to_integer/1</c> BIF now returns + <c>{error,system_limit}</c> for overlong lists.</p> + <p> + Own Id: OTP-18475 Aux Id: PR-6897 </p> + </item> + <item> + <p> + Active process aliases of a process at its termination + leaked memory.</p> + <p> + Own Id: OTP-18496 Aux Id: GH-6947, PR-6953 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Support for fully asynchronous distributed signaling + where send operations <em>never</em> block. This + functionality is by default disabled and can be enabled + per process. For more information see the documentation + of <seeerl + marker="erts:erlang#process_flag_async_dist"><c>process_flag(async_dist, + Bool)</c></seeerl>.</p> + <p> + Own Id: OTP-18374 Aux Id: PR-6632 </p> + </item> + <item> + <p>Added the <c>+JPperf no_fp</c> option to explicitly + disable Erlang frame pointers otherwise added when using + the <c>+JPperf map</c> option.</p> + <p> + Own Id: OTP-18426</p> + </item> + </list> + </section> + +</section> + <section><title>Erts 13.1.5</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/erts/emulator/test/map_SUITE.erl b/erts/emulator/test/map_SUITE.erl index f2208fb6aa..e64311c2e5 100644 --- a/erts/emulator/test/map_SUITE.erl +++ b/erts/emulator/test/map_SUITE.erl @@ -1890,8 +1890,8 @@ cmp(M1, M2, Exact) -> cmp_maps(M1, M2, Exact) -> case {maps:size(M1),maps:size(M2)} of {S,S} -> - {K1,V1} = lists:unzip(term_sort(maps:to_list(M1))), - {K2,V2} = lists:unzip(term_sort(maps:to_list(M2))), + {K1,V1} = lists:unzip(cmp_key_sort(maps:to_list(M1))), + {K2,V2} = lists:unzip(cmp_key_sort(maps:to_list(M2))), case cmp(K1, K2, true) of 0 -> cmp(V1, V2, Exact); @@ -1915,6 +1915,10 @@ cmp_others(T1, T2, _) -> {false,false} -> 1 end. +cmp_key_sort(L) -> + lists:sort(fun(A,B) -> cmp(A,B,true) =< 0 end, + L). + map_gen(Pairs, Size) -> {_,L} = lists:foldl(fun(_, {Keys, Acc}) -> KI = rand:uniform(size(Keys)), diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl index 3b9aa4df30..4b1c9491bc 100644 --- a/erts/emulator/test/num_bif_SUITE.erl +++ b/erts/emulator/test/num_bif_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2021. All Rights Reserved. +%% Copyright Ericsson AB 1997-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/erts/vsn.mk b/erts/vsn.mk index 620fd45b16..c9cabd73d4 100644 --- a/erts/vsn.mk +++ b/erts/vsn.mk @@ -18,7 +18,7 @@ # %CopyrightEnd% # -VSN = 13.1.5 +VSN = 13.2 # Port number 4365 in 4.2 # Port number 4366 in 4.3 diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml index 4d9d8204b7..c8e8e4a3e3 100644 --- a/lib/common_test/doc/src/notes.xml +++ b/lib/common_test/doc/src/notes.xml @@ -33,6 +33,22 @@ <file>notes.xml</file> </header> +<section><title>Common_Test 1.24</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Renamed undocumented macro <c>CT_PEER/3</c> to + <c>CT_PEER_REL/3</c>.</p> + <p> + Own Id: OTP-18460</p> + </item> + </list> + </section> + +</section> + <section><title>Common_Test 1.23.3</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/common_test/vsn.mk b/lib/common_test/vsn.mk index 4c6aab9f25..472bde9027 100644 --- a/lib/common_test/vsn.mk +++ b/lib/common_test/vsn.mk @@ -1 +1 @@ -COMMON_TEST_VSN = 1.23.3 +COMMON_TEST_VSN = 1.24 diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml index a2510f1426..af671ff7ba 100644 --- a/lib/compiler/doc/src/notes.xml +++ b/lib/compiler/doc/src/notes.xml @@ -32,6 +32,46 @@ <p>This document describes the changes made to the Compiler application.</p> +<section><title>Compiler 8.2.4</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p>Fixed a bug that would cause the compiler to hang.</p> + <p> + Own Id: OTP-18378 Aux Id: GH-6604 </p> + </item> + <item> + <p>Fixed a crash when compiling code that contained + <c>maybe</c> expressions.</p> + <p> + Own Id: OTP-18381 Aux Id: GH-6601 </p> + </item> + <item> + <p>Constructing a binary with an explicit size of + <c>all</c> for a binary segment would crash the + compiler.</p> + <p> + Own Id: OTP-18407 Aux Id: GH-6707 </p> + </item> + <item> + <p>The compiler would generate incorrect code for the + following type of expression:</p> + <p><c>Pattern = BoundVar1 = . . . = BoundVarN = + Expression</c></p> + <p>An exception should be raised if any of the bound + variables have different values than <c>Expression</c>. + The compiler would generate code that would cause the + bound variables to be bound to the value of + <c>Expression</c>whether the value matched or not.</p> + <p> + Own Id: OTP-18470 Aux Id: GH-6873, PR-6877 </p> + </item> + </list> + </section> + +</section> + <section><title>Compiler 8.2.3</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/compiler/src/beam_ssa_codegen.erl b/lib/compiler/src/beam_ssa_codegen.erl index 1e1374c484..08b0e5d856 100644 --- a/lib/compiler/src/beam_ssa_codegen.erl +++ b/lib/compiler/src/beam_ssa_codegen.erl @@ -157,13 +157,11 @@ assert_exception_block(Blocks) -> add_parameter_annos([{label, _}=Entry | Body], Anno) -> ParamTypes = maps:get(parameter_info, Anno, #{}), - Annos = maps:fold( - fun(K, V, Acc) when is_map_key(K, ParamTypes) -> - Info = map_get(K, ParamTypes), - [{'%', {var_info, V, Info}} | Acc]; - (_K, _V, Acc) -> - Acc - end, [], maps:get(registers, Anno)), + Annos = [begin + Info = map_get(K, ParamTypes), + {'%', {var_info, V, Info}} + end || K := V <- map_get(registers, Anno), + is_map_key(K, ParamTypes)], [Entry | sort(Annos)] ++ Body. @@ -515,10 +513,8 @@ prefer_xregs_prune(#cg_set{anno=#{clobbers:=true}}, _, _) -> #{}; prefer_xregs_prune(#cg_set{dst=Dst}, Copies, St) -> DstReg = beam_arg(Dst, St), - F = fun(_, Alias) -> - beam_arg(Alias, St) =/= DstReg - end, - maps:filter(F, Copies). + #{V => Alias || V := Alias <- Copies, + beam_arg(Alias, St) =/= DstReg}. %% prefer_xregs_call(Instruction, Copies, St) -> Instruction. %% Given a 'call' or 'old_make_fun' instruction rewrite the arguments @@ -548,12 +544,11 @@ do_prefer_xreg(#b_var{}=A, Copies, St) -> do_prefer_xreg(A, _, _) -> A. merge_copies(Copies0, Copies1) when map_size(Copies0) =< map_size(Copies1) -> - maps:filter(fun(K, V) -> - case Copies1 of - #{K:=V} -> true; - #{} -> false - end - end, Copies0); + #{K => V || K := V <- Copies0, + case Copies1 of + #{K := V} -> true; + #{} -> false + end}; merge_copies(Copies0, Copies1) -> merge_copies(Copies1, Copies0). diff --git a/lib/compiler/src/beam_ssa_opt.erl b/lib/compiler/src/beam_ssa_opt.erl index 851573a82b..13e4114319 100644 --- a/lib/compiler/src/beam_ssa_opt.erl +++ b/lib/compiler/src/beam_ssa_opt.erl @@ -990,7 +990,7 @@ cse_successors([#b_set{op={succeeded,_},args=[Src]},Bif|_], Blk, EsSucc, M0) -> %% We must remove the substitution for Src from the failure branch. #b_blk{last=#b_br{succ=Succ,fail=Fail}} = Blk, M = cse_successors_1([Succ], EsSucc, M0), - EsFail = maps:filter(fun(_, Val) -> Val =/= Src end, EsSucc), + EsFail = #{Var => Val || Var := Val <- EsSucc, Val =/= Src}, cse_successors_1([Fail], EsFail, M); false -> %% There can't be any replacement for Src in EsSucc. No need for diff --git a/lib/compiler/src/beam_ssa_pre_codegen.erl b/lib/compiler/src/beam_ssa_pre_codegen.erl index e1b5f59738..e3406f12de 100644 --- a/lib/compiler/src/beam_ssa_pre_codegen.erl +++ b/lib/compiler/src/beam_ssa_pre_codegen.erl @@ -2993,8 +2993,8 @@ init_free(Res) -> #{x:=Xs0} = Free1 = maps:from_list(Free0), Xs = init_xregs(Xs0), Free = Free1#{x:=Xs}, - Next = maps:fold(fun(K, V, A) -> [{{next,K},length(V)}|A] end, [], Free), - maps:merge(Free, maps:from_list(Next)). + Next = #{{next,K} => length(V) || K := V <- Free}, + maps:merge(Free, Next). init_free_1([{_,{prefer,{x,_}=Reg}}|Res]) -> [{x,Reg}|init_free_1(Res)]; diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl index 5419090ddc..725eb9ee29 100644 --- a/lib/compiler/src/beam_ssa_type.erl +++ b/lib/compiler/src/beam_ssa_type.erl @@ -378,11 +378,7 @@ init_sig_st(StMap, FuncDb) -> wl=wl_defer_list(Roots, wl_new()) }. init_sig_roots(FuncDb) -> - maps:fold(fun(Id, #func_info{exported=true}, Acc) -> - [Id | Acc]; - (_, _, Acc) -> - Acc - end, [], FuncDb). + [Id || Id := #func_info{exported=true} <- FuncDb]. init_sig_args([Root | Roots], StMap, Acc) -> #opt_st{args=Args0} = map_get(Root, StMap), diff --git a/lib/compiler/src/beam_types.erl b/lib/compiler/src/beam_types.erl index 35e164d707..cf81c34670 100644 --- a/lib/compiler/src/beam_types.erl +++ b/lib/compiler/src/beam_types.erl @@ -1137,7 +1137,7 @@ lub_bs_matchable(UnitA, UnitB) -> lub_tuple_elements(MinSize, EsA, EsB) -> Es0 = lub_elements(EsA, EsB), - maps:filter(fun(Index, _Type) -> Index =< MinSize end, Es0). + #{Index => Type || Index := Type <- Es0, Index =< MinSize}. lub_elements(Es1, Es2) -> Keys = if @@ -1368,12 +1368,11 @@ verified_normal_type(#t_tuple{size=Size,elements=Es}=T) -> %% union). 'any' is prohibited since it's implicit and should never be %% present in the map, and a 'none' element ought to have reduced the %% entire tuple to 'none'. - maps:fold(fun(Index, Element, _) when is_integer(Index), - 1 =< Index, Index =< Size, - Index =< ?TUPLE_ELEMENT_LIMIT, - Element =/= any, Element =/= none -> - verified_type(Element) - end, [], Es), + _ = [verified_type(Element) || + Index := Element <- Es, + is_integer(Index), 1 =< Index, Index =< Size, + Index =< ?TUPLE_ELEMENT_LIMIT, + Element =/= any, Element =/= none], T. %%% diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index ee5f49d03a..e4a5965dd1 100644 --- a/lib/compiler/src/beam_validator.erl +++ b/lib/compiler/src/beam_validator.erl @@ -2073,7 +2073,7 @@ init_stack(Tag, Y, Vst) -> init_stack(Tag, Y - 1, create_tag(Tag, allocate, [], {y,Y}, Vst)). trim_stack(From, To, Top, #st{ys=Ys0}=St) when From =:= Top -> - Ys = maps:filter(fun({y,Y}, _) -> Y < To end, Ys0), + Ys = #{Reg => Val || {y,Y}=Reg := Val <- Ys0, Y < To}, St#st{numy=To,ys=Ys}; trim_stack(From, To, Top, St0) -> Src = {y, From}, @@ -2128,9 +2128,7 @@ prune_x_regs(Live, #vst{current=St0}=Vst) when is_integer(Live) -> ({y,_}) -> true end, Fragile0), - Xs = maps:filter(fun({x,X}, _) -> - X < Live - end, Xs0), + Xs = #{Reg => Val || {x,X}=Reg := Val <- Xs0, X < Live}, St = St0#st{fragile=Fragile,xs=Xs}, Vst#vst{current=St}. diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl index 3443f43959..809924c7f3 100644 --- a/lib/compiler/src/v3_kernel.erl +++ b/lib/compiler/src/v3_kernel.erl @@ -1565,9 +1565,7 @@ group_value(_, Us, Cs) -> Map = group_values(Cs, #{}), %% We must sort the grouped values to ensure consistent %% order from compilation to compilation. - sort(maps:fold(fun (_, Vcs, Css) -> - [{Us,reverse(Vcs)}|Css] - end, [], Map)). + sort([{Us,reverse(Vcs)} || _ := Vcs <- Map]). group_values([C|Cs], Acc) -> Val = clause_val(C), diff --git a/lib/compiler/vsn.mk b/lib/compiler/vsn.mk index 5b5306e4d3..0a39fcf419 100644 --- a/lib/compiler/vsn.mk +++ b/lib/compiler/vsn.mk @@ -1 +1 @@ -COMPILER_VSN = 8.2.3 +COMPILER_VSN = 8.2.4 diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml index cfe135808b..954d5cd664 100644 --- a/lib/crypto/doc/src/notes.xml +++ b/lib/crypto/doc/src/notes.xml @@ -31,6 +31,31 @@ </header> <p>This document describes the changes made to the Crypto application.</p> +<section><title>Crypto 5.1.3</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + A user defined runtime library path configured using + <c>--with-ssl-rpath=<PATHS></c> could fail to be + enabled.</p> + <p> + Own Id: OTP-18384 Aux Id: PR-6596 </p> + </item> + <item> + <p> + Ensure that <c>configure</c> fails if a user defined + runtime library path has been passed by the user, but + cannot set.</p> + <p> + Own Id: OTP-18408</p> + </item> + </list> + </section> + +</section> + <section><title>Crypto 5.1.2</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/crypto/vsn.mk b/lib/crypto/vsn.mk index d9fae2abd7..41dfbaef97 100644 --- a/lib/crypto/vsn.mk +++ b/lib/crypto/vsn.mk @@ -1 +1 @@ -CRYPTO_VSN = 5.1.2 +CRYPTO_VSN = 5.1.3 diff --git a/lib/debugger/doc/src/notes.xml b/lib/debugger/doc/src/notes.xml index 5835ff15f5..6b2188130d 100644 --- a/lib/debugger/doc/src/notes.xml +++ b/lib/debugger/doc/src/notes.xml @@ -33,6 +33,20 @@ <p>This document describes the changes made to the Debugger application.</p> +<section><title>Debugger 5.3.1</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p>Fixed a bug that would cause analysis to crash.</p> + <p> + Own Id: OTP-18372 Aux Id: GH-6580 </p> + </item> + </list> + </section> + +</section> + <section><title>Debugger 5.3</title> <section><title>Improvements and New Features</title> diff --git a/lib/debugger/vsn.mk b/lib/debugger/vsn.mk index bac7f4b6ae..e98a61d2b3 100644 --- a/lib/debugger/vsn.mk +++ b/lib/debugger/vsn.mk @@ -1 +1 @@ -DEBUGGER_VSN = 5.3 +DEBUGGER_VSN = 5.3.1 diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml index 50c5d28c2e..fe859092f7 100644 --- a/lib/dialyzer/doc/src/notes.xml +++ b/lib/dialyzer/doc/src/notes.xml @@ -32,6 +32,51 @@ <p>This document describes the changes made to the Dialyzer application.</p> +<section><title>Dialyzer 5.0.5</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p>Fixed a bug that would cause analysis to crash.</p> + <p> + Own Id: OTP-18372 Aux Id: GH-6580 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + <section><title>Dialyzer 5.0.4</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/dialyzer/vsn.mk b/lib/dialyzer/vsn.mk index dc8f066894..965a949121 100644 --- a/lib/dialyzer/vsn.mk +++ b/lib/dialyzer/vsn.mk @@ -1 +1 @@ -DIALYZER_VSN = 5.0.4 +DIALYZER_VSN = 5.0.5 diff --git a/lib/erl_docgen/priv/dtd/common.dtd b/lib/erl_docgen/priv/dtd/common.dtd index b8fc0e3af4..9825e9e9b9 100644 --- a/lib/erl_docgen/priv/dtd/common.dtd +++ b/lib/erl_docgen/priv/dtd/common.dtd @@ -54,6 +54,7 @@ <!ATTLIST list type (ordered|bulleted) "bulleted" > <!ELEMENT taglist (tag,item+)+ > <!ELEMENT tag (#PCDATA|c|i|em|br|%refs;|marker|anno)* > +<!ATTLIST tag since CDATA #IMPLIED> <!ELEMENT item (%inline;|%block;|warning|note|change|dont|do|quote|table)* > <!-- References --> diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl index caed4219ef..77b301347a 100644 --- a/lib/erl_docgen/priv/xsl/db_html.xsl +++ b/lib/erl_docgen/priv/xsl/db_html.xsl @@ -1251,10 +1251,15 @@ <xsl:template match="taglist/tag"> <xsl:param name="chapnum"/> - <dt> + <dt class="title-link"> <strong> <xsl:apply-templates/> </strong> + <xsl:if test="string-length(@since) > 0"> + <div class="title-since since"> + <xsl:value-of select="@since"/> + </div> + </xsl:if> </dt> </xsl:template> diff --git a/lib/erl_docgen/src/docgen_xml_to_chunk.erl b/lib/erl_docgen/src/docgen_xml_to_chunk.erl index a795b205c2..d607a09b17 100644 --- a/lib/erl_docgen/src/docgen_xml_to_chunk.erl +++ b/lib/erl_docgen/src/docgen_xml_to_chunk.erl @@ -485,13 +485,23 @@ transform_types(Dom,Acc) -> transform_taglist(Attr,Content) -> Items = - lists:map(fun({tag,A,C}) -> - {dt,A,C}; + lists:map(fun({tag,_A,_C}=Tag) -> + transform_tag(Tag); ({item,A,C}) -> {dd,A,C} end, Content), {dl,Attr,Items}. +transform_tag({tag, Attr0, C}) -> + Attr1 = lists:map(fun({since,Vsn}) -> + {since, + unicode:characters_to_binary(Vsn)}; + (A) -> + A + end, + Attr0), + {dt,Attr1,C}. + %% if we have {func,[],[{name,...},{name,....},...]} %% we convert it to one {func,[],[{name,...}] per arity lowest first. transform_funcs([Func|T],Acc) -> diff --git a/lib/erl_interface/doc/src/notes.xml b/lib/erl_interface/doc/src/notes.xml index 2f44a32707..a1bb84f224 100644 --- a/lib/erl_interface/doc/src/notes.xml +++ b/lib/erl_interface/doc/src/notes.xml @@ -31,6 +31,37 @@ </header> <p>This document describes the changes made to the Erl_interface application.</p> +<section><title>Erl_Interface 5.3.1</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Accept connection setup from OTP 23 and 24 nodes that are + not using epmd.</p> + <p> + Own Id: OTP-18404 Aux Id: GH-6595, PR-6625 </p> + </item> + </list> + </section> + + + <section><title>Known Bugs and Problems</title> + <list> + <item> + <p> + The <c>ei</c> API for decoding/encoding terms is not + fully 64-bit compatible since terms that have a + representation on the external term format larger than 2 + GB cannot be handled.</p> + <p> + Own Id: OTP-16607 Aux Id: OTP-16608 </p> + </item> + </list> + </section> + +</section> + <section><title>Erl_Interface 5.3</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/erl_interface/vsn.mk b/lib/erl_interface/vsn.mk index f06a7e869b..badd74c6da 100644 --- a/lib/erl_interface/vsn.mk +++ b/lib/erl_interface/vsn.mk @@ -1,2 +1,2 @@ -EI_VSN = 5.3 +EI_VSN = 5.3.1 ERL_INTERFACE_VSN = $(EI_VSN) diff --git a/lib/eunit/doc/src/notes.xml b/lib/eunit/doc/src/notes.xml index 3274d27baf..1f1786159c 100644 --- a/lib/eunit/doc/src/notes.xml +++ b/lib/eunit/doc/src/notes.xml @@ -33,6 +33,40 @@ </header> <p>This document describes the changes made to the EUnit application.</p> +<section><title>Eunit 2.8.2</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + <section><title>Eunit 2.8.1</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/eunit/vsn.mk b/lib/eunit/vsn.mk index 4dd7b82355..81508f8ab4 100644 --- a/lib/eunit/vsn.mk +++ b/lib/eunit/vsn.mk @@ -1 +1 @@ -EUNIT_VSN = 2.8.1 +EUNIT_VSN = 2.8.2 diff --git a/lib/ftp/doc/src/notes.xml b/lib/ftp/doc/src/notes.xml index f70986e2bc..b131eee82b 100644 --- a/lib/ftp/doc/src/notes.xml +++ b/lib/ftp/doc/src/notes.xml @@ -33,7 +33,41 @@ <file>notes.xml</file> </header> - <section><title>Ftp 1.1.3</title> + <section><title>Ftp 1.1.4</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + +<section><title>Ftp 1.1.3</title> <section><title>Fixed Bugs and Malfunctions</title> <list> diff --git a/lib/ftp/vsn.mk b/lib/ftp/vsn.mk index b4ca2de88b..fa0034ec4b 100644 --- a/lib/ftp/vsn.mk +++ b/lib/ftp/vsn.mk @@ -19,6 +19,6 @@ # %CopyrightEnd% APPLICATION = ftp -FTP_VSN = 1.1.3 +FTP_VSN = 1.1.4 PRE_VSN = APP_VSN = "$(APPLICATION)-$(FTP_VSN)$(PRE_VSN)" diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index a27dea627a..d935ad2f11 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2002</year><year>2022</year> + <year>2002</year><year>2023</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -33,7 +33,69 @@ <file>notes.xml</file> </header> - <section><title>Inets 8.2.2</title> + <section><title>Inets 8.3</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + With this change, handling of URI to a folder, with + missing trailing / and a query component present is + fixed.</p> + <p> + Own Id: OTP-18472 Aux Id: DAFH-1592 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Adds more type information to the <c>inets</c> app, thus + improving the errors that static analysis tools can + detect.</p> + <p> + The addition of type information to records and the + updates to function heads help static analysis tools to + understand that some values in the records cannot be + <c>'undefined'</c>, thus making static tools to type + check correctly more modules in the <c>inets</c> app</p> + <p> + Own Id: OTP-18390 Aux Id: PR-6661 </p> + </item> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + +<section><title>Inets 8.2.2</title> <section><title>Fixed Bugs and Malfunctions</title> <list> diff --git a/lib/inets/src/http_client/httpc_internal.hrl b/lib/inets/src/http_client/httpc_internal.hrl index 8e35bfef4f..344b6a2620 100644 --- a/lib/inets/src/http_client/httpc_internal.hrl +++ b/lib/inets/src/http_client/httpc_internal.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2021. All Rights Reserved. +%% Copyright Ericsson AB 2005-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk index 17c0f94f46..99285501c5 100644 --- a/lib/inets/vsn.mk +++ b/lib/inets/vsn.mk @@ -19,6 +19,6 @@ # %CopyrightEnd% APPLICATION = inets -INETS_VSN = 8.2.2 +INETS_VSN = 8.3 PRE_VSN = APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)" diff --git a/lib/jinterface/doc/src/notes.xml b/lib/jinterface/doc/src/notes.xml index 544bcb0eb2..01eda410cc 100644 --- a/lib/jinterface/doc/src/notes.xml +++ b/lib/jinterface/doc/src/notes.xml @@ -31,6 +31,22 @@ </header> <p>This document describes the changes made to the Jinterface application.</p> +<section><title>Jinterface 1.13.2</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Accept connection setup from OTP 23 and 24 nodes that are + not using epmd.</p> + <p> + Own Id: OTP-18404 Aux Id: GH-6595, PR-6625 </p> + </item> + </list> + </section> + +</section> + <section><title>Jinterface 1.13.1</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/jinterface/vsn.mk b/lib/jinterface/vsn.mk index dc71145e36..909370599e 100644 --- a/lib/jinterface/vsn.mk +++ b/lib/jinterface/vsn.mk @@ -1 +1 @@ -JINTERFACE_VSN = 1.13.1 +JINTERFACE_VSN = 1.13.2 diff --git a/lib/kernel/doc/src/notes.xml b/lib/kernel/doc/src/notes.xml index be3cf04dbd..2a2992b720 100644 --- a/lib/kernel/doc/src/notes.xml +++ b/lib/kernel/doc/src/notes.xml @@ -31,6 +31,29 @@ </header> <p>This document describes the changes made to the Kernel application.</p> +<section><title>Kernel 8.5.4</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p>Fixed a bug on Windows where + <c>file:read_file_info/1</c> would fail for files with + corrupt metadata.</p> + <p> + Own Id: OTP-18348 Aux Id: GH-6356 </p> + </item> + <item> + <p> + Accept connection setup from OTP 23 and 24 nodes that are + not using epmd.</p> + <p> + Own Id: OTP-18404 Aux Id: GH-6595, PR-6625 </p> + </item> + </list> + </section> + +</section> + <section><title>Kernel 8.5.3</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/kernel/src/kernel.appup.src b/lib/kernel/src/kernel.appup.src index 3a56077fb5..709a405244 100644 --- a/lib/kernel/src/kernel.appup.src +++ b/lib/kernel/src/kernel.appup.src @@ -60,7 +60,8 @@ {<<"^8\\.5$">>,[restart_new_emulator]}, {<<"^8\\.5\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}, {<<"^8\\.5\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, - {<<"^8\\.5\\.2(?:\\.[0-9]+)*$">>,[restart_new_emulator]}], + {<<"^8\\.5\\.2(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, + {<<"^8\\.5\\.3(?:\\.[0-9]+)*$">>,[restart_new_emulator]}], [{<<"^7\\.0$">>,[restart_new_emulator]}, {<<"^7\\.0\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}, {<<"^7\\.1$">>,[restart_new_emulator]}, @@ -93,4 +94,5 @@ {<<"^8\\.5$">>,[restart_new_emulator]}, {<<"^8\\.5\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}, {<<"^8\\.5\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, - {<<"^8\\.5\\.2(?:\\.[0-9]+)*$">>,[restart_new_emulator]}]}. + {<<"^8\\.5\\.2(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, + {<<"^8\\.5\\.3(?:\\.[0-9]+)*$">>,[restart_new_emulator]}]}. diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index 113e8175e6..7ccab1892c 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2022. All Rights Reserved. +%% Copyright Ericsson AB 1998-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/kernel/test/kernel_test_lib.erl b/lib/kernel/test/kernel_test_lib.erl index 002de22c21..3b00780c49 100644 --- a/lib/kernel/test/kernel_test_lib.erl +++ b/lib/kernel/test/kernel_test_lib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2020-2022. All Rights Reserved. +%% Copyright Ericsson AB 2020-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/kernel/vsn.mk b/lib/kernel/vsn.mk index 62ce99fb1c..12a1996eb5 100644 --- a/lib/kernel/vsn.mk +++ b/lib/kernel/vsn.mk @@ -1 +1 @@ -KERNEL_VSN = 8.5.3 +KERNEL_VSN = 8.5.4 diff --git a/lib/megaco/doc/src/notes.xml b/lib/megaco/doc/src/notes.xml index f2f9bd4a92..9e181c589c 100644 --- a/lib/megaco/doc/src/notes.xml +++ b/lib/megaco/doc/src/notes.xml @@ -37,7 +37,41 @@ section is the version number of Megaco.</p> - <section><title>Megaco 4.4.2</title> + <section><title>Megaco 4.4.3</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + +<section><title>Megaco 4.4.2</title> <section><title>Improvements and New Features</title> <list> diff --git a/lib/megaco/vsn.mk b/lib/megaco/vsn.mk index b6090ebeef..dad5cd8bea 100644 --- a/lib/megaco/vsn.mk +++ b/lib/megaco/vsn.mk @@ -19,6 +19,6 @@ # %CopyrightEnd% APPLICATION = megaco -MEGACO_VSN = 4.4.2 +MEGACO_VSN = 4.4.3 PRE_VSN = APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)" diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml index aa5a04501b..16c844dc4b 100644 --- a/lib/mnesia/doc/src/notes.xml +++ b/lib/mnesia/doc/src/notes.xml @@ -39,7 +39,57 @@ thus constitutes one section in this document. The title of each section is the version number of Mnesia.</p> - <section><title>Mnesia 4.21.3</title> + <section><title>Mnesia 4.21.4</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Improved consistency for dirty writes when a table was + added with <c>add_table_copy/3</c>.</p> + <p> + Fixed a problem with sticky write, which could lead to + inconsistent data.</p> + <p> + Own Id: OTP-18412</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + +<section><title>Mnesia 4.21.3</title> <section><title>Fixed Bugs and Malfunctions</title> <list> diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk index 3d7dc96e54..ca16e64482 100644 --- a/lib/mnesia/vsn.mk +++ b/lib/mnesia/vsn.mk @@ -1 +1 @@ -MNESIA_VSN = 4.21.3 +MNESIA_VSN = 4.21.4 diff --git a/lib/os_mon/c_src/memsup.c b/lib/os_mon/c_src/memsup.c index f4e727c39e..96f662da19 100644 --- a/lib/os_mon/c_src/memsup.c +++ b/lib/os_mon/c_src/memsup.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2021. All Rights Reserved. + * Copyright Ericsson AB 1996-2023. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/os_mon/c_src/memsup.h b/lib/os_mon/c_src/memsup.h index f9d0e225df..ae53ec6101 100644 --- a/lib/os_mon/c_src/memsup.h +++ b/lib/os_mon/c_src/memsup.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2021. All Rights Reserved. + * Copyright Ericsson AB 1998-2023. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/os_mon/doc/src/notes.xml b/lib/os_mon/doc/src/notes.xml index 150dd5cbd7..1fac53d330 100644 --- a/lib/os_mon/doc/src/notes.xml +++ b/lib/os_mon/doc/src/notes.xml @@ -31,6 +31,23 @@ </header> <p>This document describes the changes made to the OS_Mon application.</p> +<section><title>Os_Mon 2.8.1</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + The port programs used by <c>cpu_sup</c> and + <c>memsup</c> are now gracefully shut down when + <c>cpu_sup</c> and <c>memsup</c> are shut down.</p> + <p> + Own Id: OTP-18469 Aux Id: PR-6689 </p> + </item> + </list> + </section> + +</section> + <section><title>Os_Mon 2.8</title> <section><title>Improvements and New Features</title> diff --git a/lib/os_mon/include/memsup.hrl b/lib/os_mon/include/memsup.hrl index 8f93918180..df2278aaf6 100644 --- a/lib/os_mon/include/memsup.hrl +++ b/lib/os_mon/include/memsup.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1998-2021. All Rights Reserved. +%% Copyright Ericsson AB 1998-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/os_mon/src/cpu_sup.erl b/lib/os_mon/src/cpu_sup.erl index f68a59a2a2..be917021e7 100644 --- a/lib/os_mon/src/cpu_sup.erl +++ b/lib/os_mon/src/cpu_sup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2021. All Rights Reserved. +%% Copyright Ericsson AB 1997-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/os_mon/src/memsup.erl b/lib/os_mon/src/memsup.erl index dbf7609433..1c93bfbae4 100644 --- a/lib/os_mon/src/memsup.erl +++ b/lib/os_mon/src/memsup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2021. All Rights Reserved. +%% Copyright Ericsson AB 1996-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/os_mon/vsn.mk b/lib/os_mon/vsn.mk index e5043e204a..9e64a83612 100644 --- a/lib/os_mon/vsn.mk +++ b/lib/os_mon/vsn.mk @@ -1 +1 @@ -OS_MON_VSN = 2.8 +OS_MON_VSN = 2.8.1 diff --git a/lib/public_key/doc/src/notes.xml b/lib/public_key/doc/src/notes.xml index 78bf776419..70e1c819f3 100644 --- a/lib/public_key/doc/src/notes.xml +++ b/lib/public_key/doc/src/notes.xml @@ -35,6 +35,73 @@ <file>notes.xml</file> </header> +<section><title>Public_Key 1.13.3</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + As different solutions of verifying certificate + revocation exists move the decode of + 'CRLDistributionPoints' so that it will only be decode. + When it is actually used in the verification process. + This would enable interoperability with systems that use + certificates with an invalid empty CRLDistributionPoints + extension that they want to ignore and make verification + by other means.</p> + <p> + Own Id: OTP-18316 Aux Id: GH-6402, PR-6883 </p> + </item> + <item> + <p> + public_key:pkix_path_validation validates certificates + expiring after 2050</p> + <p> + Own Id: OTP-18356 Aux Id: GH-6403 </p> + </item> + <item> + <p> + Do not leave exit message in message queue after calling + <c>cacerts_load()</c> on MacOS.</p> + <p> + Own Id: OTP-18392 Aux Id: GH-6656 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + <section><title>Public_Key 1.13.2</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl index b7e0b178de..4d448fd42c 100644 --- a/lib/public_key/src/pubkey_cert.erl +++ b/lib/public_key/src/pubkey_cert.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2022. All Rights Reserved. +%% Copyright Ericsson AB 2008-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/public_key/src/pubkey_cert_records.erl b/lib/public_key/src/pubkey_cert_records.erl index 3207ebb4ae..0bcbe84f87 100644 --- a/lib/public_key/src/pubkey_cert_records.erl +++ b/lib/public_key/src/pubkey_cert_records.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2021. All Rights Reserved. +%% Copyright Ericsson AB 2008-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/public_key/src/pubkey_ocsp.erl b/lib/public_key/src/pubkey_ocsp.erl index 249b430660..41c6c2ebe2 100644 --- a/lib/public_key/src/pubkey_ocsp.erl +++ b/lib/public_key/src/pubkey_ocsp.erl @@ -25,12 +25,60 @@ -export([otp_cert/1, get_ocsp_responder_id/1, get_nonce_extn/1, - decode_ocsp_response/1, verify_ocsp_response/3, get_acceptable_response_types_extn/0, find_single_response/3, ocsp_status/1]). +%% Test related exports +-export([decode_ocsp_response/1]). + +otp_cert(#'OTPCertificate'{} = Cert) -> + Cert; +otp_cert(#'Certificate'{} = Cert) -> + public_key:pkix_decode_cert( + public_key:der_encode('Certificate', Cert), otp); +otp_cert(CertDer) when is_binary(CertDer) -> + public_key:pkix_decode_cert(CertDer, otp). + +-spec get_ocsp_responder_id(#'Certificate'{}) -> binary(). +get_ocsp_responder_id(#'Certificate'{tbsCertificate = TbsCert}) -> + public_key:der_encode( + 'ResponderID', {byName, TbsCert#'TBSCertificate'.subject}). + +-spec get_nonce_extn(undefined | binary()) -> undefined | #'Extension'{}. +get_nonce_extn(undefined) -> + undefined; +get_nonce_extn(Nonce) when is_binary(Nonce) -> + #'Extension'{ + extnID = ?'id-pkix-ocsp-nonce', + extnValue = Nonce + }. + +-spec verify_ocsp_response(binary(), list(), undefined | binary()) -> + {ok, term()} | {error, term()}. +verify_ocsp_response(OCSPResponseDer, ResponderCerts, Nonce) -> + do_verify_ocsp_response( + decode_ocsp_response(OCSPResponseDer), ResponderCerts, Nonce). + +-spec get_acceptable_response_types_extn() -> #'Extension'{}. +get_acceptable_response_types_extn() -> + #'Extension'{ + extnID = ?'id-pkix-ocsp-response', + extnValue = public_key:der_encode( + 'AcceptableResponses', [?'id-pkix-ocsp-basic']) + }. + +-spec find_single_response(#'OTPCertificate'{}, #'OTPCertificate'{}, + [#'SingleResponse'{}]) -> + {ok, #'SingleResponse'{}} | {error, no_matched_response}. +find_single_response(Cert, IssuerCert, SingleResponseList) -> + IssuerName = get_subject_name(IssuerCert), + IssuerKey = get_public_key(IssuerCert), + SerialNum = get_serial_num(Cert), + match_single_response(IssuerName, IssuerKey, SerialNum, SingleResponseList). + +-spec ocsp_status({atom(), term()}) -> atom() | {atom(), {atom(), term()}}. ocsp_status({good, _}) -> valid; ocsp_status({unknown, Reason}) -> @@ -38,41 +86,57 @@ ocsp_status({unknown, Reason}) -> ocsp_status({revoked, Reason}) -> {bad_cert, {revoked, Reason}}. -%%-------------------------------------------------------------------- --spec verify_ocsp_response(binary(), list(), undefined | binary()) -> - {ok, term()} | {error, term()}. -%% -%% Description: Verify the OCSP response to get the certificate status -%%-------------------------------------------------------------------- -verify_ocsp_response(OCSPResponseDer, ResponderCerts, Nonce) -> - do_verify_ocsp_response( - decode_ocsp_response(OCSPResponseDer), ResponderCerts, Nonce - ). +decode_ocsp_response(ResponseDer) -> + Resp = public_key:der_decode('OCSPResponse', ResponseDer), + case Resp#'OCSPResponse'.responseStatus of + successful -> + decode_response_bytes( + Resp#'OCSPResponse'.responseBytes + ); + Error -> + {error, Error} + end. %%-------------------------------------------------------------------- --spec do_verify_ocsp_response({ok, #'BasicOCSPResponse'{}} | {error, term()}, - list(), undefined | binary()) -> - {ok, term()} | {error, term()}. -%% -%% Description: Verify the OCSP response to get the certificate status -%%-------------------------------------------------------------------- -do_verify_ocsp_response( - {ok, #'BasicOCSPResponse'{ - tbsResponseData = ResponseData, - signatureAlgorithm = SignatureAlgo, - signature = Signature, - certs = Certs - }}, ResponderCerts, Nonce) -> +match_single_response(_IssuerName, _IssuerKey, _SerialNum, []) -> + {error, no_matched_response}; +match_single_response(IssuerName, IssuerKey, SerialNum, + [#'SingleResponse'{ + certID = #'CertID'{hashAlgorithm = Algo} = CertID} = + Response | Responses]) -> + HashType = public_key:pkix_hash_type(Algo#'AlgorithmIdentifier'.algorithm), + case (SerialNum == CertID#'CertID'.serialNumber) andalso + (crypto:hash(HashType, IssuerName) == CertID#'CertID'.issuerNameHash) andalso + (crypto:hash(HashType, IssuerKey) == CertID#'CertID'.issuerKeyHash) of + true -> + {ok, Response}; + false -> + match_single_response(IssuerName, IssuerKey, SerialNum, Responses) + end. - #'ResponseData'{ - responderID = ResponderID - } = ResponseData, +get_serial_num(Cert) -> + #'OTPCertificate'{tbsCertificate = TbsCert} = otp_cert(Cert), + TbsCert#'OTPTBSCertificate'.serialNumber. +decode_response_bytes(#'ResponseBytes'{ + responseType = ?'id-pkix-ocsp-basic', + response = Data}) -> + {ok, public_key:der_decode('BasicOCSPResponse', Data)}; +decode_response_bytes(#'ResponseBytes'{responseType = RespType}) -> + {error, {ocsp_response_type_not_supported, RespType}}. + +do_verify_ocsp_response({ok, #'BasicOCSPResponse'{ + tbsResponseData = ResponseData, + signatureAlgorithm = SignatureAlgo, + signature = Signature, + certs = Certs}}, + ResponderCerts, Nonce) -> + #'ResponseData'{responderID = ResponderID} = ResponseData, case verify_ocsp_signature( - public_key:der_encode('ResponseData', ResponseData), - SignatureAlgo#'AlgorithmIdentifier'.algorithm, - Signature, Certs ++ ResponderCerts, - ResponderID) of + public_key:der_encode('ResponseData', ResponseData), + SignatureAlgo#'AlgorithmIdentifier'.algorithm, + Signature, Certs ++ ResponderCerts, + ResponderID) of ok -> verify_ocsp_nonce(ResponseData, Nonce); {error, Reason} -> @@ -81,18 +145,9 @@ do_verify_ocsp_response( do_verify_ocsp_response({error, Reason}, _ResponderCerts, _Nonce) -> {error, Reason}. -%%-------------------------------------------------------------------- --spec verify_ocsp_nonce(#'ResponseData'{}, undefined | binary()) -> - {ok, term()} | {error, nonce_mismatch}. -%% -%% Description: Check if the nonces matches in OCSP response -%%-------------------------------------------------------------------- verify_ocsp_nonce(ResponseData, Nonce) -> - #'ResponseData'{ - responses = Responses, - responseExtensions = ResponseExtns - } = ResponseData, - + #'ResponseData'{responses = Responses, responseExtensions = ResponseExtns} = + ResponseData, case get_nonce_value(ResponseExtns) of Nonce -> {ok, Responses}; @@ -100,12 +155,6 @@ verify_ocsp_nonce(ResponseData, Nonce) -> {error, nonce_mismatch} end. -%%-------------------------------------------------------------------- --spec get_nonce_value(asn1_NOVALUE | list()) -> - undefined | binary(). -%% -%% Description: Get the nonce value from extensions -%%-------------------------------------------------------------------- %% no extensions present in response get_nonce_value(asn1_NOVALUE) -> undefined; @@ -119,44 +168,8 @@ get_nonce_value([#'Extension'{ get_nonce_value([_Extn | Rest]) -> get_nonce_value(Rest). -%%-------------------------------------------------------------------- --spec decode_ocsp_response(binary()) -> - {ok, #'BasicOCSPResponse'{}} | {error, term()}. -%% -%% Description: Decode the OCSP response der -%%-------------------------------------------------------------------- -decode_ocsp_response(Response) -> - Resp = public_key:der_decode('OCSPResponse', Response), - case Resp#'OCSPResponse'.responseStatus of - successful -> - decode_response_bytes( - Resp#'OCSPResponse'.responseBytes - ); - Error -> - {error, Error} - end. - -%%-------------------------------------------------------------------- --spec decode_response_bytes(#'ResponseBytes'{}) -> - {ok, #'BasicOCSPResponse'{}} | {error, term()}. -%% -%% Description: Get basic ocsp response field -%%-------------------------------------------------------------------- -decode_response_bytes(#'ResponseBytes'{ - responseType = ?'id-pkix-ocsp-basic', - response = Data}) -> - {ok, public_key:der_decode('BasicOCSPResponse', Data)}; -decode_response_bytes(#'ResponseBytes'{responseType = RespType}) -> - {error, {ocsp_response_type_not_supported, RespType}}. - -%%-------------------------------------------------------------------- --spec verify_ocsp_signature(binary(), term(), term(), list(), term()) -> - ok | {error, term()}. -%% -%% Description: Verify the signature of OCSP response -%%-------------------------------------------------------------------- -verify_ocsp_signature( - ResponseDataDer, SignatureAlgo, Signature, Certs, ResponderID) -> +verify_ocsp_signature(ResponseDataDer, SignatureAlgo, Signature, + Certs, ResponderID) -> case find_responder_cert(ResponderID, Certs) of {ok, Cert} -> do_verify_ocsp_signature( @@ -165,12 +178,6 @@ verify_ocsp_signature( {error, Reason} end. -%%-------------------------------------------------------------------- --spec find_responder_cert(term(), list()) -> - {ok, #'Certificate'{} | #'OTPCertificate'{}} | {error, term()}. -%% -%% Description: Find the OCSP responder's cert in input list -%%-------------------------------------------------------------------- find_responder_cert(_ResponderID, []) -> {error, ocsp_responder_cert_not_found}; find_responder_cert(ResponderID, [Cert | TCerts]) -> @@ -181,85 +188,16 @@ find_responder_cert(ResponderID, [Cert | TCerts]) -> find_responder_cert(ResponderID, TCerts) end. -%%-------------------------------------------------------------------- --spec do_verify_ocsp_signature( - binary(), term(), term(), #'Certificate'{} | #'OTPCertificate'{}) -> - ok | {error, term()}. -%% -%% Description: Verify the signature of OCSP response -%%-------------------------------------------------------------------- -do_verify_ocsp_signature(ResponseDataDer, Signature, AlgorithmID, Cert) -> - {DigestType, _SignatureType} = public_key:pkix_sign_types(AlgorithmID), - case public_key:verify( - ResponseDataDer, DigestType, Signature, - get_public_key_rec(Cert)) of - true -> - ok; - false -> - {error, ocsp_response_bad_signature} - end. - -%%-------------------------------------------------------------------- --spec get_public_key_rec(#'Certificate'{} | #'OTPCertificate'{}) -> - term(). -%% -%% Description: Get the subject public key field -%%-------------------------------------------------------------------- -get_public_key_rec(#'Certificate'{} = Cert) -> - get_public_key_rec(otp_cert(Cert)); -get_public_key_rec(#'OTPCertificate'{tbsCertificate = TbsCert}) -> - PKInfo = TbsCert#'OTPTBSCertificate'.subjectPublicKeyInfo, - PKInfo#'OTPSubjectPublicKeyInfo'.subjectPublicKey. - -%%-------------------------------------------------------------------- --spec is_responder(tuple(), #'Certificate'{} | #'OTPCertificate'{}) -> - boolean(). -%% -%% Description: Check if is OCSP responder's cert -%%-------------------------------------------------------------------- is_responder({byName, Name}, Cert) -> public_key:der_encode('Name', Name) == get_subject_name(Cert); is_responder({byKey, Key}, Cert) -> Key == crypto:hash(sha, get_public_key(Cert)). -%%-------------------------------------------------------------------- --spec otp_cert(#'Certificate'{} | #'OTPCertificate'{} | binary()) -> - #'OTPCertificate'{}. -%% -%% Description: Convert to #'OTPCertificate'{} -%%-------------------------------------------------------------------- -otp_cert(#'OTPCertificate'{} = Cert) -> - Cert; -otp_cert(#'Certificate'{} = Cert) -> - public_key:pkix_decode_cert( - public_key:der_encode('Certificate', Cert), otp); -otp_cert(CertDer) when is_binary(CertDer) -> - public_key:pkix_decode_cert(CertDer, otp). - -%%-------------------------------------------------------------------- --spec get_ocsp_responder_id(#'Certificate'{}) -> binary(). -%% -%% Description: Get the OCSP responder ID der -%%-------------------------------------------------------------------- -get_ocsp_responder_id(#'Certificate'{tbsCertificate = TbsCert}) -> - public_key:der_encode( - 'ResponderID', {byName, TbsCert#'TBSCertificate'.subject}). - -%%-------------------------------------------------------------------- --spec get_subject_name(#'Certificate'{} | #'OTPCertificate'{}) -> binary(). -%% -%% Description: Get the subject der from cert -%%-------------------------------------------------------------------- get_subject_name(#'Certificate'{} = Cert) -> get_subject_name(otp_cert(Cert)); get_subject_name(#'OTPCertificate'{tbsCertificate = TbsCert}) -> public_key:pkix_encode('Name', TbsCert#'OTPTBSCertificate'.subject, otp). -%%-------------------------------------------------------------------- --spec get_public_key(#'Certificate'{} | #'OTPCertificate'{}) -> binary(). -%% -%% Description: Get the public key from cert -%%-------------------------------------------------------------------- get_public_key(#'Certificate'{} = Cert) -> get_public_key(otp_cert(Cert)); get_public_key(#'OTPCertificate'{tbsCertificate = TbsCert}) -> @@ -273,73 +211,20 @@ enc_pub_key({DsaInt, #'Dss-Parms'{}}) when is_integer(DsaInt) -> enc_pub_key({#'ECPoint'{point = Key}, _ECParam}) -> Key. -%%-------------------------------------------------------------------- --spec get_nonce_extn(undefined | binary()) -> undefined | #'Extension'{}. -%% -%% Description: Get an OCSP nonce der -%%-------------------------------------------------------------------- -get_nonce_extn(undefined) -> - undefined; -get_nonce_extn(Nonce) when is_binary(Nonce) -> - #'Extension'{ - extnID = ?'id-pkix-ocsp-nonce', - extnValue = Nonce - }. - -%%-------------------------------------------------------------------- --spec get_acceptable_response_types_extn() -> #'Extension'{}. -%% -%% Description: Get an acceptable response types der -%%-------------------------------------------------------------------- -get_acceptable_response_types_extn() -> - #'Extension'{ - extnID = ?'id-pkix-ocsp-response', - extnValue = public_key:der_encode( - 'AcceptableResponses', [?'id-pkix-ocsp-basic']) - }. - -%%-------------------------------------------------------------------- --spec get_serial_num(binary | #'Certificate'{} | #'OTPCertificate'{}) -> - term(). -%% -%% Description: Get the serial number of a certificate -%%-------------------------------------------------------------------- -get_serial_num(Cert) -> - #'OTPCertificate'{tbsCertificate = TbsCert} = otp_cert(Cert), - TbsCert#'OTPTBSCertificate'.serialNumber. - - -%%-------------------------------------------------------------------- -%% -spec find_single_response(#'OTPCertificate'{}, #'OTPCertificate'{}, -%% [#'SingleResponse'{}]) -> -%% #'SingleResponse'{} | {error, no_matched_response}. -%% %% -%% Description: Find the matched single response. -%%-------------------------------------------------------------------- -find_single_response(Cert, IssuerCert, SingleResponseList) -> - IssuerName = get_subject_name(IssuerCert), - IssuerKey = get_public_key(IssuerCert), - SerialNum = get_serial_num(Cert), - match_single_response( - IssuerName, IssuerKey, SerialNum, SingleResponseList). - -match_single_response(_IssuerName, _IssuerKey, _SerialNum, []) -> - {error, no_matched_response}; -match_single_response( - IssuerName, IssuerKey, SerialNum, - [#'SingleResponse'{ - certID = #'CertID'{hashAlgorithm = Algo} = CertID - } = Response | Responses]) -> - HashType = public_key:pkix_hash_type( - Algo#'AlgorithmIdentifier'.algorithm), - case (SerialNum == CertID#'CertID'.serialNumber) andalso - (crypto:hash( - HashType, IssuerName) == CertID#'CertID'.issuerNameHash) andalso - (crypto:hash( - HashType, IssuerKey) == CertID#'CertID'.issuerKeyHash) of +do_verify_ocsp_signature(ResponseDataDer, Signature, AlgorithmID, Cert) -> + {DigestType, _SignatureType} = public_key:pkix_sign_types(AlgorithmID), + case public_key:verify( + ResponseDataDer, DigestType, Signature, + get_public_key_rec(Cert)) of true -> - {ok, Response}; + ok; false -> - match_single_response(IssuerName, IssuerKey, SerialNum, Responses) + {error, ocsp_response_bad_signature} end. +get_public_key_rec(#'Certificate'{} = Cert) -> + get_public_key_rec(otp_cert(Cert)); +get_public_key_rec(#'OTPCertificate'{tbsCertificate = TbsCert}) -> + PKInfo = TbsCert#'OTPTBSCertificate'.subjectPublicKeyInfo, + PKInfo#'OTPSubjectPublicKeyInfo'.subjectPublicKey. + diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index 3cb9fea632..77e8b70e96 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -1373,10 +1373,14 @@ pkix_test_root_cert(Name, Opts) -> %% Description: Validate OCSP staple response %%-------------------------------------------------------------------- -pkix_ocsp_validate(DerCert, IssuerCert, OcspRespDer, ResponderCerts, NonceExt) when is_binary(DerCert) -> - pkix_ocsp_validate(pkix_decode_cert(DerCert, otp), IssuerCert, OcspRespDer, ResponderCerts, NonceExt); -pkix_ocsp_validate(Cert, DerIssuerCert, OcspRespDer, ResponderCerts, NonceExt) when is_binary(DerIssuerCert) -> - pkix_ocsp_validate(Cert, pkix_decode_cert(DerIssuerCert, otp), OcspRespDer, ResponderCerts, NonceExt); +pkix_ocsp_validate(DerCert, IssuerCert, OcspRespDer, ResponderCerts, NonceExt) + when is_binary(DerCert) -> + pkix_ocsp_validate(pkix_decode_cert(DerCert, otp), IssuerCert, OcspRespDer, + ResponderCerts, NonceExt); +pkix_ocsp_validate(Cert, DerIssuerCert, OcspRespDer, ResponderCerts, NonceExt) + when is_binary(DerIssuerCert) -> + pkix_ocsp_validate(Cert, pkix_decode_cert(DerIssuerCert, otp), OcspRespDer, + ResponderCerts, NonceExt); pkix_ocsp_validate(Cert, IssuerCert, OcspRespDer, ResponderCerts, NonceExt) -> case ocsp_responses(OcspRespDer, ResponderCerts, NonceExt) of {ok, Responses} -> diff --git a/lib/public_key/vsn.mk b/lib/public_key/vsn.mk index 4a62528f7e..850e86ef69 100644 --- a/lib/public_key/vsn.mk +++ b/lib/public_key/vsn.mk @@ -1 +1 @@ -PUBLIC_KEY_VSN = 1.13.2 +PUBLIC_KEY_VSN = 1.13.3 diff --git a/lib/reltool/doc/src/notes.xml b/lib/reltool/doc/src/notes.xml index 40ea90d83d..346a80ef54 100644 --- a/lib/reltool/doc/src/notes.xml +++ b/lib/reltool/doc/src/notes.xml @@ -38,7 +38,21 @@ thus constitutes one section in this document. The title of each section is the version number of Reltool.</p> - <section><title>Reltool 0.9</title> + <section><title>Reltool 0.9.1</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p>Fixed a bug that would cause analysis to crash.</p> + <p> + Own Id: OTP-18372 Aux Id: GH-6580 </p> + </item> + </list> + </section> + +</section> + +<section><title>Reltool 0.9</title> <section><title>Improvements and New Features</title> <list> diff --git a/lib/reltool/vsn.mk b/lib/reltool/vsn.mk index 1bee6b4581..2fa512829c 100644 --- a/lib/reltool/vsn.mk +++ b/lib/reltool/vsn.mk @@ -1 +1 @@ -RELTOOL_VSN = 0.9 +RELTOOL_VSN = 0.9.1 diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 387348a375..e692ca99bb 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -34,7 +34,41 @@ </header> - <section><title>SNMP 5.13.3</title> + <section><title>SNMP 5.13.4</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + +<section><title>SNMP 5.13.3</title> <section><title>Fixed Bugs and Malfunctions</title> <list> diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml index 0613de3158..1400e7bf32 100644 --- a/lib/snmp/doc/src/snmp_app.xml +++ b/lib/snmp/doc/src/snmp_app.xml @@ -4,7 +4,7 @@ <appref> <header> <copyright> - <year>1997</year><year>2021</year> + <year>1997</year><year>2023</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -295,14 +295,15 @@ in the snmp_config file! <c><![CDATA[agent_net_if_options() = [agent_net_if_option()] <optional>]]></c></tag> <item> <p><c>agent_net_if_option() = - {bind_to, bind_to()} | - {sndbuf, sndbuf()} | - {recbuf, recbuf()} | - {no_reuse, no_reuse()} | - {req_limit, req_limit()} | - {filter, agent_net_if_filter_options()} | - {extra_sock_opts, extra_socket_options()} | - {inet_backend, inet | socket}</c></p> + {bind_to, bind_to()} | + {sndbuf, sndbuf()} | + {recbuf, recbuf()} | + {no_reuse, no_reuse()} | + {req_limit, req_limit()} | + {filter, agent_net_if_filter_options()} | + {open_err_filters, agent_net_if_open_err_filters()} | + {extra_sock_opts, extra_socket_options()} | + {inet_backend, inet | socket}</c></p> <p>These options are actually specific to the used module. The ones shown here are applicable to the default <c>agent_net_if_module()</c>.</p> @@ -343,6 +344,25 @@ in the snmp_config file! <p>Default is <c>snmpa_net_if_filter</c>.</p> </item> + <tag><marker id="agent_ni_open_err_filters"></marker> + <c><![CDATA[agent_net_if_open_err_filters() = [agent_net_if_open_err_filter()] <optional>]]></c></tag> + <item> + <p><c>agent_net_if_open_err_filter() = atom()</c></p> + <p>During agent initiation, the transports UDP sockets are opened. + If this operation fails, the net-if (and the agent) fails to start + (crash). This (filter) list contains error (reasons) that will + make net-if fail "nicely". + This (filter) list, is supposed to contain errors that can be + returned by + <seemfa marker="kernel:gen_udp#open/1">gen_udp:open/1,2</seemfa>. + The effect is that any error returned by + <seemfa marker="kernel:gen_udp#open/1">gen_udp:open</seemfa> + which *are* in this list, will be considered + "non-fatal" and will only result in an info message, rather than + an error message. Net If, and the agent, will still crash, + but will produce a less obnoxious message. </p> + </item> + <tag><marker id="agent_mibs"></marker> <c><![CDATA[agent_mibs() = [string()] <optional>]]></c></tag> <item> diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index 0b8d786a2d..99324ed400 100644 --- a/lib/snmp/doc/src/snmp_config.xml +++ b/lib/snmp/doc/src/snmp_config.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>1997</year><year>2021</year> + <year>1997</year><year>2023</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -281,14 +281,15 @@ <c><![CDATA[agent_net_if_options() = [agent_net_if_option()] <optional>]]></c></tag> <item> <p><c>agent_net_if_option() = - {bind_to, bind_to()} | - {sndbuf, sndbuf()} | - {recbuf, recbuf()} | - {no_reuse, no_reuse()} | - {req_limit, req_limit()} | - {filter, agent_net_if_filter_options()} | - {extra_sock_opts, extra_socket_options()} | - {inet_backend, inet | socket}</c></p> + {bind_to, bind_to()} | + {sndbuf, sndbuf()} | + {recbuf, recbuf()} | + {no_reuse, no_reuse()} | + {req_limit, req_limit()} | + {filter, agent_net_if_filter_options()} | + {extra_sock_opts, extra_socket_options()} | + {open_err_filters, agent_net_if_open_err_filters()} | + {inet_backend, inet | socket}</c></p> <p>These options are actually specific to the used module. The ones shown here are applicable to the default <c>agent_net_if_module()</c>.</p> @@ -329,6 +330,25 @@ <p>Default is <c>snmpa_net_if_filter</c>.</p> </item> + <tag><marker id="agent_ni_open_err_filters"></marker> + <c><![CDATA[agent_net_if_open_err_filters() = [agent_net_if_open_err_filter()] <optional>]]></c></tag> + <item> + <p><c>agent_net_if_open_err_filter() = atom()</c></p> + <p>During agent initiation, the transports UDP sockets are opened. + If this operation fails, the net-if (and the agent) fails to start + (crash). This (filter) list contains error (reasons) that will + make net-if fail "nicely". + This (filter) list, is supposed to contain errors that can be + returned by + <seemfa marker="kernel:gen_udp#open/1">gen_udp:open/1,2</seemfa>. + The effect is that any error returned by + <seemfa marker="kernel:gen_udp#open/1">gen_udp:open</seemfa> + which *are* in this list, will be considered + "non-fatal" and will only result in an info message, rather than + an error message. Net If, and the agent, will still crash, + but will produce a less obnoxious message. </p> + </item> + <tag><marker id="agent_mibs"></marker> <c><![CDATA[agent_mibs() = [string()] <optional>]]></c></tag> <item> diff --git a/lib/snmp/src/agent/snmpa_agent.erl b/lib/snmp/src/agent/snmpa_agent.erl index 736b2907fa..8c24440efc 100644 --- a/lib/snmp/src/agent/snmpa_agent.erl +++ b/lib/snmp/src/agent/snmpa_agent.erl @@ -340,10 +340,16 @@ init([Prio, Parent, Ref, Options]) -> "~n Options: ~p", [Prio, Parent, Ref, Options]), case (catch do_init(Prio, Parent, Ref, Options)) of {ok, State} -> - ?vdebug("started",[]), + ?vdebug("started"), {ok, State}; + {error, {net_if, info, Reason}} -> + info_msg("Failed starting agent: " + "~n Net If error: ~p", [Reason]), + %% {shutdown, Reason}; + exit(Reason); {error, Reason} -> - config_err("failed starting agent: ~n~p", [Reason]), + config_err("Failed starting agent: " + "~n ~p", [Reason]), {stop, Reason} end. @@ -410,15 +416,18 @@ start_note_store(Prio, Ref, Options) -> {ok, Pid} -> ?vdebug("start_note_store -> Pid: ~p", [Pid]), Pid; - {error, Reason} -> - ?vinfo("error starting note store: ~n~p",[Reason]), - throw({error, {note_store_error, Reason}}); - {'EXIT', Reason} -> - ?vinfo("exit starting note store: ~n~p",[Reason]), - throw({error, {note_store_exit, Reason}}); + {error, {Reason, _ChildSpec}} -> + ?vinfo("error starting note store: " + "~n ~p", [Reason]), + throw({error, {note_store, error, Reason}}); + {'EXIT', {Reason, _ChildSpec}} -> + ?vinfo("exit starting note store: " + "~n ~p", [Reason]), + throw({error, {note_store, exit, Reason}}); Error -> - ?vinfo("failed starting note store: ~n~p",[Error]), - throw({error, {note_store_failed, Error}}) + ?vinfo("failed starting note store: " + "~n ~p", [Error]), + throw({error, {note_store, failed, Error}}) end. @@ -437,18 +446,25 @@ start_net_if(none, Prio, Ref, Vsns, NoteStore, Options) -> case (catch snmpa_misc_sup:start_net_if(Prio, NoteStore, Ref, self(), Mod, NiOpts)) of - {ok, Pid} -> + {ok, Pid} -> ?vdebug("start_net_if -> Pid: ~p", [Pid]), {master_agent, Pid, Mod}; - {error, Reason} -> - ?vinfo("error starting net if: ~n~p",[Reason]), - throw({error, {net_if_error, Reason}}); + {error, {{Class, udp_open, PortNo, Reason}, _ChildSpec}} -> + ?vinfo("error starting net if: " + "~n ~p", [Reason]), + throw({error, {net_if, Class, {udp_open, PortNo, Reason}}}); + {error, {Reason, _ChildSpec}} -> + ?vinfo("error starting net if: " + "~n ~p", [Reason]), + throw({error, {net_if, error, Reason}}); {'EXIT', Reason} -> - ?vinfo("exit starting net if: ~n~p",[Reason]), - throw({error, {net_if_exit, Reason}}); + ?vinfo("exit starting net if: " + "~n ~p", [Reason]), + throw({error, {net_if, exit, Reason}}); Error -> - ?vinfo("failed starting net if: ~n~p",[Error]), - throw({error, {net_if_failed, Error}}) + ?vinfo("failed starting net if: " + "~n ~p", [Error]), + throw({error, {net_if, failed, Error}}) end; start_net_if(Parent, _Prio, _Ref, _Vsns, _NoteStore, _Options) when is_pid(Parent) -> @@ -470,15 +486,18 @@ start_mib_server(Prio, Ref, Mibs, Options) -> {ok, Pid} -> ?vdebug("start_mib_server -> Pid: ~p", [Pid]), Pid; - {error, Reason} -> - ?vinfo("error starting mib server: ~n~p",[Reason]), - throw({error, {mib_server_error, Reason}}); + {error, {Reason, _ChildSpec}} -> + ?vinfo("error starting mib server: " + "~n ~p", [Reason]), + throw({error, {mib_server, error, Reason}}); {'EXIT', Reason} -> - ?vinfo("exit starting mib server: ~n~p",[Reason]), - throw({error, {mib_server_exit, Reason}}); + ?vinfo("exit starting mib server: " + "~n ~p", [Reason]), + throw({error, {mib_server, exit, Reason}}); Error -> - ?vinfo("failed starting mib server: ~n~p",[Error]), - throw({error, {mib_server_failed, Error}}) + ?vinfo("failed starting mib server: " + "~n ~p", [Error]), + throw({error, {mib_server, failed, Error}}) end. @@ -3204,8 +3223,8 @@ get_stats_counters([Counter|Counters], Acc) -> %% --------------------------------------------------------------------- -%% info_msg(F, A) -> -%% ?snmpa_info(F, A). +info_msg(F, A) -> + ?snmpa_info(F, A). warning_msg(F, A) -> ?snmpa_warning(F, A). diff --git a/lib/snmp/src/agent/snmpa_agent_sup.erl b/lib/snmp/src/agent/snmpa_agent_sup.erl index 0a5116b2d0..b1eeaba988 100644 --- a/lib/snmp/src/agent/snmpa_agent_sup.erl +++ b/lib/snmp/src/agent/snmpa_agent_sup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2016. All Rights Reserved. +%% Copyright Ericsson AB 1997-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -24,7 +24,9 @@ -behaviour(supervisor). %% External exports --export([start_link/0, start_link/1, start_subagent/3, stop_subagent/1]). +-export([start_link/0, start_link/1, + start_master_agent/1, + start_subagent/3, stop_subagent/1]). %% Internal exports -export([init/1]). @@ -40,8 +42,7 @@ %%%----------------------------------------------------------------- -%%% This is a supervisor for the mib processes. Each agent has one -%%% mib process. +%%% This is a supervisor for the agent processes (master and sub). %%%----------------------------------------------------------------- start_link() -> ?d("start_link -> entry", []), @@ -52,6 +53,9 @@ start_link(AgentSpec) -> "~n AgentSpec: ~p", [AgentSpec]), supervisor:start_link({local, ?SERVER}, ?MODULE, [[AgentSpec]]). +start_master_agent(MasterAgentSpec) -> + supervisor:start_child(snmpa_agent_sup, MasterAgentSpec). + start_subagent(ParentAgent, Subtree, Mibs) -> ?d("start_subagent -> entry with" "~n ParentAgent: ~p" diff --git a/lib/snmp/src/agent/snmpa_net_if.erl b/lib/snmp/src/agent/snmpa_net_if.erl index 406d985a1a..ce8cb8f0ee 100644 --- a/lib/snmp/src/agent/snmpa_net_if.erl +++ b/lib/snmp/src/agent/snmpa_net_if.erl @@ -235,11 +235,21 @@ init(Prio, NoteStore, MasterAgent, Parent, Opts) -> end, erlang:raise(C, E, S) end; + {error, {udp_open, {open, PortNo, Reason}}} -> + OEFilters = get_open_err_filters(Opts), + Class = + case lists:member(Reason, OEFilters) of + false -> + error; + true -> + info + end, + proc_lib:init_ack({error, {Class, udp_open, PortNo, Reason}}); {error, Reason} -> - config_err("failed starting net-if: ~n~p", [Reason]), + %% config_err("failed starting net-if: ~n~p", [Reason]), proc_lib:init_fail({error, Reason}, {exit, normal}); Error -> - config_err("failed starting net-if: ~n~p", [Error]), + %% config_err("failed starting net-if: ~n~p", [Error]), proc_lib:init_fail({error, Error}, {exit, normal}) end. @@ -256,7 +266,7 @@ do_init(Prio, NoteStore, MasterAgent, Parent, Opts) -> Vsns = get_vsns(Opts), ?vdebug("vsns: ~w",[Vsns]), - %% Flow control -- + %% -- Flow control -- Limit = get_req_limit(Opts), ?vdebug("Limit: ~w", [Limit]), FilterOpts = get_filter_opts(Opts), @@ -475,7 +485,7 @@ gen_udp_open(system, Opts) -> throw({udp_open, {port, PReason}}) end; {error, OReason} -> - throw({udp_open, {open, OReason}}) + throw({udp_open, {open, 0, OReason}}) end; %% This is for "future compat" since we cannot actually config '0'... gen_udp_open(IpPort, Opts) when (IpPort =:= 0) -> @@ -533,7 +543,7 @@ gen_udp_range_open(Min, Max, Opts) -> gen_udp_range_open(Min+1, Max, Opts); {error, Reason} -> ?vdebug("gen_udp_range_open(~w,~w) -> ~w", [Reason]), - throw({udp_open, {open, Reason}}) + throw({udp_open, {open, Min, Reason}}) catch C:E:S -> ?vinfo("gen_udp_range_open(~w,~w) -> failed open socket: " @@ -2101,6 +2111,16 @@ get_filter_opts(O) -> get_filter_module(O) -> snmp_misc:get_option(module, O, ?DEFAULT_FILTER_MODULE). +get_open_err_filters(O) -> + case snmp_misc:get_option(open_err_filters, O, []) of + Filters when is_list(Filters) -> + Filters; + Filter when is_atom(Filter) -> + [Filter]; + _ -> + [] + end. + get_recbuf(Opts, DefaultOpts) -> get_socket_opt(recbuf, Opts, DefaultOpts, use_default). @@ -2153,8 +2173,8 @@ info_msg(F,A) -> user_err(F, A) -> snmpa_error:user_err(F, A). -config_err(F, A) -> - snmpa_error:config_err(F, A). +%% config_err(F, A) -> +%% snmpa_error:config_err(F, A). %% ---------------------------------------------------------------- diff --git a/lib/snmp/src/agent/snmpa_supervisor.erl b/lib/snmp/src/agent/snmpa_supervisor.erl index 215851f23c..26c61579d5 100644 --- a/lib/snmp/src/agent/snmpa_supervisor.erl +++ b/lib/snmp/src/agent/snmpa_supervisor.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2022. All Rights Reserved. +%% Copyright Ericsson AB 1996-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ %% Internal exports -export([init/1, config/2]). +-compile({no_auto_import,[erase/1]}). -define(SERVER, ?MODULE). @@ -41,6 +42,10 @@ %% Process structure %% ================= %% +%% "application" +%% | +%% app-sup +%% | %% ___________________ supervisor __________________ %% / | | \ \ %% ___misc_sup___ target_cache symbolic_store local_db agent_sup @@ -176,7 +181,23 @@ start_master_sup(Opts) -> do_start_master_sup(Opts) -> verify_mandatory([db_dir], Opts), - supervisor:start_link({local, ?SERVER}, ?MODULE, [master, Opts]). + case supervisor:start_link({local, ?SERVER}, ?MODULE, [master, Opts]) of + {ok, Pid} = OK -> + %% <HACKETI-HACK-HACK> + Key = master_agent_child_spec, + MasterAgentSpec = lookup(Key), + case snmpa_agent_sup:start_master_agent(MasterAgentSpec) of + {ok, MPid} when is_pid(MPid) -> + erase(Key), + OK; + {error, {Reason, _ChildSpec}} -> + stop(Pid, 0), + {error, Reason} + end; + %% </HACKETI-HACK-HACK> + Else -> + Else + end. verify_mandatory([], _) -> ok; @@ -503,9 +524,18 @@ init([AgentType, Opts]) -> worker_spec(snmpa_agent, [Prio, snmp_master_agent, none, Ref, AgentOpts], Restart, 15000), + %% <HACKETI-HACK-HACK> + %% The point is to make start failure more quiet + %% Often the failure happens in the master agent, + %% so we move the start of that out of this function + %% and into the 'do_start_master_sup' function. + %% At some point we should rewrite this. Maybe start all + %% children the same way (explicitly). + store(master_agent_child_spec, AgentSpec), AgentSupSpec = - sup_spec(snmpa_agent_sup, [AgentSpec], + sup_spec(snmpa_agent_sup, [], Restart, infinity), + %% </HACKETI-HACK-HACK> [ConfigSpec, AgentSupSpec]; _ -> ?vdebug("[sub agent] spec for the agent supervisor",[]), @@ -521,6 +551,13 @@ init([AgentType, Opts]) -> store(Key, Value) -> ets:insert(snmp_agent_table, {Key, Value}). +lookup(Key) -> + [{Key, Value}] = ets:lookup(snmp_agent_table, Key), + Value. + +erase(Key) -> + ets:delete(snmp_agent_table, Key). + get_mibs(Mibs, Vsns) -> MibDir = filename:join(code:priv_dir(snmp), "mibs"), StdMib = diff --git a/lib/snmp/src/app/snmp_app.erl b/lib/snmp/src/app/snmp_app.erl index 486b276383..7ba3c659f0 100644 --- a/lib/snmp/src/app/snmp_app.erl +++ b/lib/snmp/src/app/snmp_app.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2021. All Rights Reserved. +%% Copyright Ericsson AB 2003-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -38,8 +38,13 @@ start(Type, []) -> %% First start the (new) central supervisor, {ok, Pid} = snmp_app_sup:start_link(), Entities = entities(), - ok = start_entities(Type, Entities), - {ok, Pid}. + case start_entities(Type, Entities) of + ok -> + {ok, Pid}; + Error -> + snmp_app_sup:stop(), + Error + end. entities() -> entities([agent, manager], []). diff --git a/lib/snmp/src/app/snmp_app_sup.erl b/lib/snmp/src/app/snmp_app_sup.erl index eb89cc5b6d..bb6faa18cb 100644 --- a/lib/snmp/src/app/snmp_app_sup.erl +++ b/lib/snmp/src/app/snmp_app_sup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2016. All Rights Reserved. +%% Copyright Ericsson AB 2003-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -64,7 +64,12 @@ start_agent(Type, Opts) -> "~n Type: ~p" "~n Opts: ~p", [Type, Opts]), Restart = get_restart(Opts, permanent), - start_sup_child(snmpa_supervisor, Restart, [Type, Opts]). + case start_sup_child(snmpa_supervisor, Restart, [Type, Opts]) of + {ok, Pid} = OK when is_pid(Pid) -> + OK; + {error, {Reason, _ChildSpec}} -> + {error, Reason} + end. start_manager(Type, Opts) -> @@ -72,7 +77,12 @@ start_manager(Type, Opts) -> "~n Type: ~p" "~n Opts: ~p", [Type, Opts]), Restart = get_restart(Opts, transient), - start_sup_child(snmpm_supervisor, Restart, [Type, Opts]). + case start_sup_child(snmpm_supervisor, Restart, [Type, Opts]) of + {ok, Pid} = OK when is_pid(Pid) -> + OK; + {error, {Reason, _ChildSpec}} -> + {error, Reason} + end. %%%------------------------------------------------------------------- diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk index 0c05bc62bd..4c11344234 100644 --- a/lib/snmp/vsn.mk +++ b/lib/snmp/vsn.mk @@ -19,6 +19,6 @@ # %CopyrightEnd% APPLICATION = snmp -SNMP_VSN = 5.13.3 +SNMP_VSN = 5.13.4 PRE_VSN = APP_VSN = "$(APPLICATION)-$(SNMP_VSN)$(PRE_VSN)" diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index efed2888f5..b445e649f8 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2004</year><year>2022</year> + <year>2004</year><year>2023</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -30,6 +30,54 @@ <file>notes.xml</file> </header> +<section><title>Ssh 4.15.3</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + With this change, PKCS8 formatted private key file is + properly decoded and SSH daemon with such key can be + started.</p> + <p> + Own Id: OTP-18446 Aux Id: GH-6475 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + <section><title>Ssh 4.15.2</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/ssh/doc/src/ssh_file.xml b/lib/ssh/doc/src/ssh_file.xml index 2ab7949352..29db36481a 100644 --- a/lib/ssh/doc/src/ssh_file.xml +++ b/lib/ssh/doc/src/ssh_file.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>2018</year><year>2022</year> + <year>2018</year><year>2023</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index 7006614f6e..6fa9e323c5 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,4 +1,4 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 4.15.2 +SSH_VSN = 4.15.3 APP_VSN = "ssh-$(SSH_VSN)" diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml index 18bfe77a96..a36ac8d78d 100644 --- a/lib/ssl/doc/src/notes.xml +++ b/lib/ssl/doc/src/notes.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>1999</year><year>2022</year> + <year>1999</year><year>2023</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -27,6 +27,71 @@ </header> <p>This document describes the changes made to the SSL application.</p> +<section><title>SSL 10.9</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Fixed that new <c>dtls</c> connections from the same + client ip port combination works. If there is a process + waiting for accept the new connection will connect to + that, otherwise it will try to re-connect to the old + server connection.</p> + <p> + Own Id: OTP-18371 Aux Id: GH-6160 </p> + </item> + <item> + <p> + When shutting down a node that uses SSL distribution + (<c>-proto_dist inet_tls</c>), a confusing error message + about an unexpected process exit was printed. This + particular message is no longer generated.</p> + <p> + Own Id: OTP-18443 Aux Id: PR-6810 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + fixes the type spec for ssl:format_error/1</p> + <p> + Own Id: OTP-18366 Aux Id: PR-6565, GH-6506 </p> + </item> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + <section><title>SSL 10.8.7</title> <section><title>Improvements and New Features</title> diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl index eb6d779c7a..e74c38f4e8 100644 --- a/lib/ssl/src/dtls_connection.erl +++ b/lib/ssl/src/dtls_connection.erl @@ -300,7 +300,7 @@ hello(internal, #client_hello{cookie = <<>>, catch throw:#alert{} = Alert -> alert_or_reset_connection(Alert, ?FUNCTION_NAME, State0) end; -hello(internal, #hello_verify_request{cookie = Cookie}, +hello(internal, #hello_verify_request{cookie = Cookie}, #state{static_env = #static_env{role = client, host = Host, port = Port}, @@ -317,17 +317,16 @@ hello(internal, #hello_verify_request{cookie = Cookie}, Hello = dtls_handshake:client_hello(Host, Port, Cookie, ConnectionStates0, SslOpts, Id, Renegotiation, OcspNonce), Version = Hello#client_hello.client_version, - State1 = prepare_flight(State0#state{handshake_env = - HsEnv#handshake_env{tls_handshake_history - = ssl_handshake:init_handshake_history(), - ocsp_stapling_state = - OcspState0#{ocsp_nonce => OcspNonce}}}), - - {State2, Actions} = dtls_gen_connection:send_handshake(Hello, State1), - - State = State2#state{connection_env = CEnv#connection_env{negotiated_version = Version}, % RequestedVersion - protocol_specific = PS#{current_cookie_secret => Cookie} - }, + State1 = + prepare_flight( + State0#state{handshake_env = + HsEnv#handshake_env{ + tls_handshake_history = ssl_handshake:init_handshake_history(), + ocsp_stapling_state = OcspState0#{ocsp_nonce => OcspNonce}}}), + {State2, Actions} = dtls_gen_connection:send_handshake(Hello, State1), + State = State2#state{connection_env = + CEnv#connection_env{negotiated_version = Version}, % RequestedVersion + protocol_specific = PS#{current_cookie_secret => Cookie}}, dtls_gen_connection:next_event(?FUNCTION_NAME, no_record, State, Actions); hello(internal, #client_hello{extensions = Extensions} = Hello, #state{handshake_env = #handshake_env{continue_status = pause}, @@ -375,11 +374,11 @@ hello(internal, #server_hello{} = Hello, try {Version, NewId, ConnectionStates, ProtoExt, Protocol, OcspState} = dtls_handshake:hello(Hello, SslOptions, ConnectionStates0, Renegotiation, OldId), - tls_dtls_connection:handle_session(Hello, - Version, NewId, ConnectionStates, ProtoExt, Protocol, - State#state{handshake_env = - HsEnv#handshake_env{ - ocsp_stapling_state = maps:merge(OcspState0,OcspState)}}) + tls_dtls_connection:handle_session( + Hello, Version, NewId, ConnectionStates, ProtoExt, Protocol, + State#state{handshake_env = + HsEnv#handshake_env{ + ocsp_stapling_state = maps:merge(OcspState0,OcspState)}}) catch throw:#alert{} = Alert -> ssl_gen_statem:handle_own_alert(Alert, ?FUNCTION_NAME, State) end; diff --git a/lib/ssl/src/dtls_handshake.erl b/lib/ssl/src/dtls_handshake.erl index 10258dcc50..1a58a166bd 100644 --- a/lib/ssl/src/dtls_handshake.erl +++ b/lib/ssl/src/dtls_handshake.erl @@ -219,19 +219,21 @@ handle_client_hello_extensions(Version, Type, Random, CipherSuites, HelloExt, SslOpts, Session0, ConnectionStates0, Renegotiation, HashSign) -> {Session, ConnectionStates, Protocol, ServerHelloExt} = ssl_handshake:handle_client_hello_extensions(dtls_record, Random, CipherSuites, - HelloExt, dtls_v1:corresponding_tls_version(Version), - SslOpts, Session0, + HelloExt, + dtls_v1:corresponding_tls_version(Version), + SslOpts, Session0, ConnectionStates0, Renegotiation, Session0#session.is_resumable), {Version, {Type, Session}, ConnectionStates, Protocol, ServerHelloExt, HashSign}. handle_server_hello_extensions(Version, SessionId, Random, CipherSuite, - Compression, HelloExt, SslOpt, ConnectionStates0, Renegotiation, IsNew) -> + Compression, HelloExt, SslOpt, ConnectionStates0, + Renegotiation, IsNew) -> {ConnectionStates, ProtoExt, Protocol, OcspState} = - ssl_handshake:handle_server_hello_extensions(dtls_record, Random, CipherSuite, - Compression, HelloExt, - dtls_v1:corresponding_tls_version(Version), - SslOpt, ConnectionStates0, Renegotiation, IsNew), + ssl_handshake:handle_server_hello_extensions( + dtls_record, Random, CipherSuite, Compression, HelloExt, + dtls_v1:corresponding_tls_version(Version), SslOpt, ConnectionStates0, + Renegotiation, IsNew), {Version, SessionId, ConnectionStates, ProtoExt, Protocol, OcspState}. %%-------------------------------------------------------------------- diff --git a/lib/ssl/src/ssl_certificate.erl b/lib/ssl/src/ssl_certificate.erl index a9470886e4..0ea7a0ac16 100644 --- a/lib/ssl/src/ssl_certificate.erl +++ b/lib/ssl/src/ssl_certificate.erl @@ -581,10 +581,12 @@ verify_cert_extensions(Cert, UserState, [], _) -> {valid, UserState#{issuer => Cert}}; verify_cert_extensions(Cert, #{ocsp_responder_certs := ResponderCerts, ocsp_state := OscpState, - issuer := Issuer} = UserState, - [#certificate_status{response = OcspResponsDer} | Exts], Context) -> + issuer := Issuer} = UserState, + [#certificate_status{response = OcspResponsDer} | Exts], + Context) -> #{ocsp_nonce := Nonce} = OscpState, - case public_key:pkix_ocsp_validate(Cert, Issuer, OcspResponsDer, ResponderCerts, Nonce) of + case public_key:pkix_ocsp_validate(Cert, Issuer, OcspResponsDer, + ResponderCerts, Nonce) of valid -> verify_cert_extensions(Cert, UserState, Exts, Context); {bad_cert, _} = Status -> diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index 6db223035d..152d3f16bd 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -2192,21 +2192,30 @@ bad_key(#{algorithm := rsa}) -> bad_key(#{algorithm := ecdsa}) -> unacceptable_ecdsa_key. -cert_status_check(_, #{ocsp_state := #{ocsp_stapling := true, - ocsp_expect := stapled}}, _VerifyResult, _, _) -> - valid; %% OCSP staple will now be checked by ssl_certifcate:verify_cert_extensions/2 in ssl_certifcate:validate -cert_status_check(OtpCert, #{ocsp_state := #{ocsp_stapling := false}} = SslState, VerifyResult, CertPath, LogLevel) -> +cert_status_check(_, + #{ocsp_state := #{ocsp_stapling := true, + ocsp_expect := stapled}}, + _VerifyResult, _, _) -> + %% OCSP staple will now be checked by + %% ssl_certificate:verify_cert_extensions/2 in ssl_certificate:validate + valid; +cert_status_check(OtpCert, + #{ocsp_state := #{ocsp_stapling := false}} = SslState, + VerifyResult, CertPath, LogLevel) -> maybe_check_crl(OtpCert, SslState, VerifyResult, CertPath, LogLevel); -cert_status_check(_OtpCert, #{ocsp_state := #{ocsp_stapling := true, - ocsp_expect := undetermined}}, +cert_status_check(_OtpCert, + #{ocsp_state := #{ocsp_stapling := true, + ocsp_expect := undetermined}}, _VerifyResult, _CertPath, _LogLevel) -> {bad_cert, {revocation_status_undetermined, not_stapled}}; -cert_status_check(OtpCert, #{ocsp_state := #{ocsp_stapling := best_effort, %% TODO support this ? - ocsp_expect := undetermined}} = SslState, +cert_status_check(OtpCert, + #{ocsp_state := #{ocsp_stapling := best_effort, %% TODO support this ? + ocsp_expect := undetermined}} = SslState, VerifyResult, CertPath, LogLevel) -> maybe_check_crl(OtpCert, SslState, VerifyResult, CertPath, LogLevel); -cert_status_check(_OtpCert, #{ocsp_state := #{ocsp_stapling := true, - ocsp_expect := no_staple}}, +cert_status_check(_OtpCert, + #{ocsp_state := #{ocsp_stapling := true, + ocsp_expect := no_staple}}, _VerifyResult, _CertPath, _LogLevel) -> {bad_cert, {revocation_status_undetermined, not_stapled}}. diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl index 33eb3580e9..86b2554619 100644 --- a/lib/ssl/src/tls_connection.erl +++ b/lib/ssl/src/tls_connection.erl @@ -71,10 +71,10 @@ %% | Send/Recv Flight 2 or Abbrev Flight 1 - Abbrev Flight 2 part 1 %% | %% New session | Resumed session -%% WAIT_OCSP_STAPELING CERTIFY <----------------------------------> ABBRIVIATED +%% WAIT_OCSP_STAPLING CERTIFY <----------------------------------> ABBREVIATED %% WAIT_CERT_VERIFY %% <- Possibly Receive -- | | -%% OCSP Stapel/CertVerify -> | Flight 3 part 1 | +%% OCSP Staple/CertVerify -> | Flight 3 part 1 | %% | | %% V | Abbrev Flight 2 part 2 to Abbrev Flight 3 %% CIPHER | @@ -256,18 +256,23 @@ hello(internal, #server_hello{} = Hello, case tls_handshake:hello(Hello, SslOptions, ConnectionStates0, Renegotiation, OldId) of %% Legacy TLS 1.2 and older {Version, NewId, ConnectionStates, ProtoExt, Protocol, OcspState} -> - tls_dtls_connection:handle_session(Hello, - Version, NewId, ConnectionStates, ProtoExt, Protocol, - State#state{ - handshake_env = HsEnv#handshake_env{ - ocsp_stapling_state = maps:merge(OcspState0,OcspState)}}); + tls_dtls_connection:handle_session( + Hello, Version, NewId, ConnectionStates, ProtoExt, Protocol, + State#state{ + handshake_env = + HsEnv#handshake_env{ + ocsp_stapling_state = maps:merge(OcspState0,OcspState)}}); %% TLS 1.3 {next_state, wait_sh, SelectedVersion, OcspState} -> %% Continue in TLS 1.3 'wait_sh' state {next_state, wait_sh, - State#state{handshake_env = HsEnv#handshake_env{ocsp_stapling_state = maps:merge(OcspState0,OcspState)}, - connection_env = CEnv#connection_env{negotiated_version = SelectedVersion}}, - [{change_callback_module, tls_client_connection_1_3}, {next_event, internal, Hello}]} + State#state{handshake_env = + HsEnv#handshake_env{ocsp_stapling_state = + maps:merge(OcspState0, OcspState)}, + connection_env = + CEnv#connection_env{negotiated_version = SelectedVersion}}, + [{change_callback_module, tls_client_connection_1_3}, + {next_event, internal, Hello}]} end catch throw:#alert{} = Alert -> ssl_gen_statem:handle_own_alert(Alert, hello, State) diff --git a/lib/ssl/src/tls_dtls_connection.erl b/lib/ssl/src/tls_dtls_connection.erl index 19910af353..e1a6962978 100644 --- a/lib/ssl/src/tls_dtls_connection.erl +++ b/lib/ssl/src/tls_dtls_connection.erl @@ -255,9 +255,10 @@ abbreviated(internal, handshake_env = HsEnv} = State) -> ConnectionStates1 = ssl_record:activate_pending_connection_state(ConnectionStates0, read, Connection), - Connection:next_event(?FUNCTION_NAME, no_record, State#state{connection_states = - ConnectionStates1, - handshake_env = HsEnv#handshake_env{expecting_finished = true}}); + Connection:next_event(?FUNCTION_NAME, no_record, + State#state{connection_states = + ConnectionStates1, + handshake_env = HsEnv#handshake_env{expecting_finished = true}}); abbreviated(info, Msg, State) -> handle_info(Msg, ?FUNCTION_NAME, State); abbreviated(internal, #hello_request{}, _) -> @@ -278,24 +279,28 @@ wait_ocsp_stapling(internal, #certificate{}, %% Receive OCSP staple message wait_ocsp_stapling(internal, #certificate_status{} = CertStatus, #state{static_env = #static_env{protocol_cb = _Connection}, - handshake_env = #handshake_env{ - ocsp_stapling_state = OcspState} = HsEnv} = State) -> - {next_state, certify, State#state{handshake_env = HsEnv#handshake_env{ocsp_stapling_state = - OcspState#{ocsp_expect => stapled, - ocsp_response => CertStatus}}}}; + handshake_env = + #handshake_env{ocsp_stapling_state = OcspState} = HsEnv} = State) -> + {next_state, certify, + State#state{handshake_env = + HsEnv#handshake_env{ocsp_stapling_state = + OcspState#{ocsp_expect => stapled, + ocsp_response => CertStatus}}}}; %% Server did not send OCSP staple message -wait_ocsp_stapling(internal, Msg, #state{static_env = #static_env{protocol_cb = _Connection}, - handshake_env = #handshake_env{ - ocsp_stapling_state = OcspState} = HsEnv} = State) +wait_ocsp_stapling(internal, Msg, + #state{static_env = #static_env{protocol_cb = _Connection}, + handshake_env = #handshake_env{ + ocsp_stapling_state = OcspState} = HsEnv} = State) when is_record(Msg, server_key_exchange) orelse is_record(Msg, hello_request) orelse is_record(Msg, certificate_request) orelse is_record(Msg, server_hello_done) orelse is_record(Msg, client_key_exchange) -> - {next_state, certify, State#state{handshake_env = - HsEnv#handshake_env{ocsp_stapling_state = OcspState#{ocsp_expect => undetermined}}}, + {next_state, certify, + State#state{handshake_env = + HsEnv#handshake_env{ocsp_stapling_state = + OcspState#{ocsp_expect => undetermined}}}, [{postpone, true}]}; - wait_ocsp_stapling(internal, #hello_request{}, _) -> keep_state_and_data; wait_ocsp_stapling(Type, Event, State) -> diff --git a/lib/ssl/src/tls_handshake.erl b/lib/ssl/src/tls_handshake.erl index 7704ff7b6b..3026a702e2 100644 --- a/lib/ssl/src/tls_handshake.erl +++ b/lib/ssl/src/tls_handshake.erl @@ -80,9 +80,9 @@ client_hello(_Host, _Port, ConnectionStates, false -> Version end, - #{security_parameters := SecParams} = + #{security_parameters := SecParams} = ssl_record:pending_connection_state(ConnectionStates, read), - AvailableCipherSuites = ssl_handshake:available_suites(UserSuites, Version), + AvailableCipherSuites = ssl_handshake:available_suites(UserSuites, Version), Extensions = ssl_handshake:client_hello_extensions(Version, AvailableCipherSuites, SslOpts, @@ -157,10 +157,11 @@ hello(#server_hello{server_version = LegacyVersion, cipher_suite = CipherSuite, compression_method = Compression, session_id = SessionId, - extensions = #{server_hello_selected_version := - #server_hello_selected_version{selected_version = Version}} = HelloExt}, - #{versions := SupportedVersions, - ocsp_stapling := Stapling} = SslOpt, + extensions = + #{server_hello_selected_version := + #server_hello_selected_version{ + selected_version = Version}} = HelloExt}, + #{versions := SupportedVersions, ocsp_stapling := Stapling} = SslOpt, ConnectionStates0, Renegotiation, OldId) -> %% In TLS 1.3, the TLS server indicates its version using the "supported_versions" extension %% (Section 4.2.1), and the legacy_version field MUST be set to 0x0303, which is the version @@ -182,8 +183,9 @@ hello(#server_hello{server_version = LegacyVersion, ConnectionStates0, Renegotiation, IsNew); SelectedVersion -> %% TLS 1.3 - {next_state, wait_sh, SelectedVersion, #{ocsp_stapling => Stapling, - ocsp_expect => ocsp_expect(Stapling)}} + {next_state, wait_sh, SelectedVersion, + #{ocsp_stapling => Stapling, + ocsp_expect => ocsp_expect(Stapling)}} end; false -> throw(?ALERT_REC(?FATAL, ?ILLEGAL_PARAMETER)) diff --git a/lib/ssl/src/tls_handshake_1_3.erl b/lib/ssl/src/tls_handshake_1_3.erl index 5b3561ff15..313125c43c 100644 --- a/lib/ssl/src/tls_handshake_1_3.erl +++ b/lib/ssl/src/tls_handshake_1_3.erl @@ -442,15 +442,16 @@ process_certificate(#certificate_1_3{ {error, {?ALERT_REC(?FATAL, ?CERTIFICATE_REQUIRED, certificate_required), State}}; process_certificate(#certificate_1_3{certificate_list = CertEntries}, #state{ssl_options = SslOptions, - static_env = - #static_env{ - role = Role, - host = Host, - cert_db = CertDbHandle, - cert_db_ref = CertDbRef, - crl_db = CRLDbHandle}, - handshake_env = #handshake_env{ - ocsp_stapling_state = OcspState}} = State0) -> + static_env = + #static_env{ + role = Role, + host = Host, + cert_db = CertDbHandle, + cert_db_ref = CertDbRef, + crl_db = CRLDbHandle}, + handshake_env = + #handshake_env{ + ocsp_stapling_state = OcspState}} = State0) -> case validate_certificate_chain(CertEntries, CertDbHandle, CertDbRef, SslOptions, CRLDbHandle, Role, Host, OcspState) of #alert{} = Alert -> @@ -828,13 +829,13 @@ store_peer_cert(#state{session = Session, State#state{session = Session#session{peer_certificate = PeerCert}, handshake_env = HsEnv#handshake_env{public_key_info = PublicKeyInfo}}. - split_cert_entries(CertEntries, OcspState) -> split_cert_entries(CertEntries, OcspState, [], #{}). + split_cert_entries([], OcspState, Chain, Ext) -> {lists:reverse(Chain), Ext, OcspState}; -split_cert_entries([#certificate_entry{data = DerCert, - extensions = Extensions0} | CertEntries], OcspState0, Chain, Ext) -> +split_cert_entries([#certificate_entry{data = DerCert, extensions = Extensions0} | CertEntries], + OcspState0, Chain, Ext) -> Id = public_key:pkix_subject_id(DerCert), Extensions = [ExtValue || {_, ExtValue} <- maps:to_list(Extensions0)], OcspState = case maps:get(status_request, Extensions0, undefined) of @@ -845,7 +846,6 @@ split_cert_entries([#certificate_entry{data = DerCert, end, split_cert_entries(CertEntries, OcspState, [DerCert | Chain], Ext#{Id => Extensions}). - %% 4.4.1. The Transcript Hash %% %% As an exception to this general rule, when the server responds to a @@ -1868,23 +1868,24 @@ path_validation(TrustedCert, Path, ServerName, Role, CertDbHandle, CertDbRef, CR ocsp_responder_certs := OcspResponderCerts, ocsp_state := OcspState}) -> ValidationFunAndState = - ssl_handshake:validation_fun_and_state(VerifyFun, #{role => Role, - certdb => CertDbHandle, - certdb_ref => CertDbRef, - server_name => ServerName, - customize_hostname_check => - CustomizeHostnameCheck, - crl_check => CrlCheck, - crl_db => CRLDbHandle, - signature_algs => filter_tls13_algs(SignAlgos), - signature_algs_cert => - filter_tls13_algs(SignAlgosCert), - version => Version, - issuer => TrustedCert, - cert_ext => CertExt, - ocsp_responder_certs => OcspResponderCerts, - ocsp_state => OcspState - }, + ssl_handshake:validation_fun_and_state(VerifyFun, + #{role => Role, + certdb => CertDbHandle, + certdb_ref => CertDbRef, + server_name => ServerName, + customize_hostname_check => + CustomizeHostnameCheck, + crl_check => CrlCheck, + crl_db => CRLDbHandle, + signature_algs => filter_tls13_algs(SignAlgos), + signature_algs_cert => + filter_tls13_algs(SignAlgosCert), + version => Version, + issuer => TrustedCert, + cert_ext => CertExt, + ocsp_responder_certs => OcspResponderCerts, + ocsp_state => OcspState + }, Path, LogLevel), Options = [{max_path_length, maps:get(depth, Opts, ?DEFAULT_DEPTH)}, {verify_fun, ValidationFunAndState}], diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk index 38752aa433..7b821e2bc8 100644 --- a/lib/ssl/vsn.mk +++ b/lib/ssl/vsn.mk @@ -1 +1 @@ -SSL_VSN = 10.8.7 +SSL_VSN = 10.9 diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml index ea0fb6dcf1..2aa05a599a 100644 --- a/lib/stdlib/doc/src/ets.xml +++ b/lib/stdlib/doc/src/ets.xml @@ -1387,7 +1387,7 @@ ets:select(Table, MatchSpec),</code> </note> <marker id="new_2_read_concurrency"></marker> </item> - <tag><c>{read_concurrency,boolean()}</c></tag> + <tag since="OTP R14B"><c>{read_concurrency,boolean()}</c></tag> <item> <p>Performance tuning. Defaults to <c>false</c>. When set to <c>true</c>, the table is optimized for concurrent read @@ -1412,7 +1412,7 @@ ets:select(Table, MatchSpec),</code> read bursts and large concurrent write bursts are common.</p> <marker id="new_2_decentralized_counters"></marker> </item> - <tag><c>{decentralized_counters,boolean()}</c></tag> + <tag since="OTP 23.0"><c>{decentralized_counters,boolean()}</c></tag> <item> <p> Performance tuning. Defaults to <c>true</c> for all @@ -1447,7 +1447,7 @@ ets:select(Table, MatchSpec),</code> </p> <marker id="new_2_compressed"></marker> </item> - <tag><c>compressed</c></tag> + <tag since="OTP R14B01"><c>compressed</c></tag> <item> <p>If this option is present, the table data is stored in a more compact format to consume less memory. However, it will make diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml index e4cc6ee375..403abf2be8 100644 --- a/lib/stdlib/doc/src/notes.xml +++ b/lib/stdlib/doc/src/notes.xml @@ -31,6 +31,49 @@ </header> <p>This document describes the changes made to the STDLIB application.</p> +<section><title>STDLIB 4.3</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p>Fixed a bug that would cause analysis to crash.</p> + <p> + Own Id: OTP-18372 Aux Id: GH-6580 </p> + </item> + <item> + <p>Fixed a crash when formatting stack traces for error + reports.</p> + <p> + Own Id: OTP-18375 Aux Id: GH-6591 </p> + </item> + <item> + <p>Instead of crashing, the <c>list_to_integer/1</c> and + <c>list_to_integer/2</c> BIFs now raise the + <c>system_limit</c> exception for overlong lists that + can't be converted to integers. Similarly, the + <c>string:to_integer/1</c> BIF now returns + <c>{error,system_limit}</c> for overlong lists.</p> + <p> + Own Id: OTP-18475 Aux Id: PR-6897 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Removal of non-necessary <c>undefined</c> types added to + the state's <c>supervisor</c> record.</p> + <p> + Own Id: OTP-18393 Aux Id: PR-6666 </p> + </item> + </list> + </section> + +</section> + <section><title>STDLIB 4.2</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/stdlib/doc/src/rand.xml b/lib/stdlib/doc/src/rand.xml index 2e84fb94ae..fb8075cb32 100644 --- a/lib/stdlib/doc/src/rand.xml +++ b/lib/stdlib/doc/src/rand.xml @@ -78,7 +78,7 @@ </p> <taglist> - <tag><c>exsss</c></tag> + <tag since="OTP 22.0"><c>exsss</c></tag> <item> <p>Xorshift116**, 58 bits precision and period of 2^116-1</p> <p>Jump function: equivalent to 2^64 calls</p> @@ -104,7 +104,7 @@ thanks to its statistical qualities. </p> </item> - <tag><c>exro928ss</c></tag> + <tag since="OTP 22.0"><c>exro928ss</c></tag> <item> <p>Xoroshiro928**, 58 bits precision and a period of 2^928-1</p> <p>Jump function: equivalent to 2^512 calls</p> @@ -127,17 +127,17 @@ the 58 bit adaption. </p> </item> - <tag><c>exrop</c></tag> + <tag since="OTP 20.0"><c>exrop</c></tag> <item> <p>Xoroshiro116+, 58 bits precision and period of 2^116-1</p> <p>Jump function: equivalent to 2^64 calls</p> </item> - <tag><c>exs1024s</c></tag> + <tag since="OTP 20.0"><c>exs1024s</c></tag> <item> <p>Xorshift1024*, 64 bits precision and a period of 2^1024-1</p> <p>Jump function: equivalent to 2^512 calls</p> </item> - <tag><c>exsp</c></tag> + <tag since="OTP 20.0"><c>exsp</c></tag> <item> <p>Xorshift116+, 58 bits precision and period of 2^116-1</p> <p>Jump function: equivalent to 2^64 calls</p> diff --git a/lib/stdlib/src/shell_docs.erl b/lib/stdlib/src/shell_docs.erl index 51e1272eb3..603946ec98 100644 --- a/lib/stdlib/src/shell_docs.erl +++ b/lib/stdlib/src/shell_docs.erl @@ -872,10 +872,16 @@ render_element({li,[],Content},[l | _] = State, Pos, Ind,D) -> render_element({dl,_,Content},State,Pos,Ind,D) -> render_docs(Content, [dl|State], Pos, Ind,D); -render_element({dt,_,Content},[dl | _] = State,Pos,Ind,D) -> +render_element({dt,Attr,Content},[dl | _] = State,Pos,Ind,D) -> + Since = case Attr of + [{since, Vsn}] -> + [" (since ",unicode:characters_to_list(Vsn),$)]; + [] -> + [] + end, Underline = sansi(underline), {Docs, _NewPos} = render_docs(Content, [li | State], Pos, Ind, D), - {[Underline,Docs,ransi(underline),":","\n"], 0}; + {[Underline,Docs,ransi(underline),$:,Since,$\n], 0}; render_element({dd,_,Content},[dl | _] = State,Pos,Ind,D) -> trimnlnl(render_docs(Content, [li | State], Pos, Ind + 2, D)); diff --git a/lib/stdlib/src/stdlib.appup.src b/lib/stdlib/src/stdlib.appup.src index d211e8cad7..0cb84fd3dc 100644 --- a/lib/stdlib/src/stdlib.appup.src +++ b/lib/stdlib/src/stdlib.appup.src @@ -52,7 +52,9 @@ {<<"^4\\.0\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, {<<"^4\\.1$">>,[restart_new_emulator]}, {<<"^4\\.1\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}, - {<<"^4\\.1\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}], + {<<"^4\\.1\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, + {<<"^4\\.2$">>,[restart_new_emulator]}, + {<<"^4\\.2\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}], [{<<"^3\\.13$">>,[restart_new_emulator]}, {<<"^3\\.13\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}, {<<"^3\\.13\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, @@ -77,4 +79,6 @@ {<<"^4\\.0\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, {<<"^4\\.1$">>,[restart_new_emulator]}, {<<"^4\\.1\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}, - {<<"^4\\.1\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}]}. + {<<"^4\\.1\\.1(?:\\.[0-9]+)*$">>,[restart_new_emulator]}, + {<<"^4\\.2$">>,[restart_new_emulator]}, + {<<"^4\\.2\\.0(?:\\.[0-9]+)+$">>,[restart_new_emulator]}]}. diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk index 5793212911..cd81d52182 100644 --- a/lib/stdlib/vsn.mk +++ b/lib/stdlib/vsn.mk @@ -1 +1 @@ -STDLIB_VSN = 4.2 +STDLIB_VSN = 4.3 diff --git a/lib/syntax_tools/doc/src/notes.xml b/lib/syntax_tools/doc/src/notes.xml index 252b9f0f1e..a4633065d0 100644 --- a/lib/syntax_tools/doc/src/notes.xml +++ b/lib/syntax_tools/doc/src/notes.xml @@ -32,6 +32,22 @@ <p>This document describes the changes made to the Syntax_Tools application.</p> +<section><title>Syntax_Tools 3.0.1</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p><c>erl_syntax_lib:annotate_bindings/1,2</c> will now + properly annotate named functions and their + arguments.</p> + <p> + Own Id: OTP-18380 Aux Id: PR-6523, GH-4733 </p> + </item> + </list> + </section> + +</section> + <section><title>Syntax_Tools 3.0</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/syntax_tools/vsn.mk b/lib/syntax_tools/vsn.mk index 1f94985baa..1955fbdbc1 100644 --- a/lib/syntax_tools/vsn.mk +++ b/lib/syntax_tools/vsn.mk @@ -1 +1 @@ -SYNTAX_TOOLS_VSN = 3.0 +SYNTAX_TOOLS_VSN = 3.0.1 diff --git a/lib/tftp/doc/src/notes.xml b/lib/tftp/doc/src/notes.xml index 71d22fbd97..e74800639b 100644 --- a/lib/tftp/doc/src/notes.xml +++ b/lib/tftp/doc/src/notes.xml @@ -33,7 +33,41 @@ <file>notes.xml</file> </header> - <section><title>Tftp 1.0.3</title> + <section><title>Tftp 1.0.4</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + +<section><title>Tftp 1.0.3</title> <section><title>Fixed Bugs and Malfunctions</title> <list> diff --git a/lib/tftp/vsn.mk b/lib/tftp/vsn.mk index d762b85845..d1a14b4255 100644 --- a/lib/tftp/vsn.mk +++ b/lib/tftp/vsn.mk @@ -19,6 +19,6 @@ # %CopyrightEnd% APPLICATION = tftp -TFTP_VSN = 1.0.3 +TFTP_VSN = 1.0.4 PRE_VSN = APP_VSN = "$(APPLICATION)-$(TFTP_VSN)$(PRE_VSN)" diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml index 701c4d372b..6f73749ecc 100644 --- a/lib/xmerl/doc/src/notes.xml +++ b/lib/xmerl/doc/src/notes.xml @@ -32,6 +32,40 @@ <p>This document describes the changes made to the Xmerl application.</p> +<section><title>Xmerl 1.3.31</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Replace size/1 with either tuple_size/1 or byte_size/1</p> + <p> + The <c>size/1</c> BIF is not optimized by the JIT, and + its use can result in worse types for Dialyzer.</p> + <p> + When one knows that the value being tested must be a + tuple, <c>tuple_size/1</c> should always be preferred.</p> + <p> + When one knows that the value being tested must be a + binary, <c>byte_size/1</c> should be preferred. However, + <c>byte_size/1</c> also accepts a bitstring (rounding up + size to a whole number of bytes), so one must make sure + that the call to <c>byte_size/</c> is preceded by a call + to <c>is_binary/1</c> to ensure that bitstrings are + rejected. Note that the compiler removes redundant calls + to <c>is_binary/1</c>, so if one is not sure whether + previous code had made sure that the argument is a + binary, it does not harm to add an <c>is_binary/1</c> + test immediately before the call to <c>byte_size/1</c>.</p> + <p> + Own Id: OTP-18432 Aux Id: + GH-6672,PR-6793,PR-6784,PR-6787,PR-6785,PR-6682,PR-6800,PR-6797,PR-6798,PR-6799,PR-6796,PR-6813,PR-6671,PR-6673,PR-6684,PR-6694,GH-6677,PR-6696,PR-6670,PR-6674 </p> + </item> + </list> + </section> + +</section> + <section><title>Xmerl 1.3.30</title> <section><title>Improvements and New Features</title> diff --git a/lib/xmerl/vsn.mk b/lib/xmerl/vsn.mk index 038f7ba263..e3edce14f5 100644 --- a/lib/xmerl/vsn.mk +++ b/lib/xmerl/vsn.mk @@ -1 +1 @@ -XMERL_VSN = 1.3.30 +XMERL_VSN = 1.3.31 diff --git a/make/otp_version_tickets_in_merge b/make/otp_version_tickets_in_merge index e69de29bb2..23c2246bcb 100644 --- a/make/otp_version_tickets_in_merge +++ b/make/otp_version_tickets_in_merge @@ -0,0 +1,44 @@ +OTP-16607 +OTP-18316 +OTP-18348 +OTP-18356 +OTP-18366 +OTP-18371 +OTP-18372 +OTP-18373 +OTP-18374 +OTP-18375 +OTP-18378 +OTP-18380 +OTP-18381 +OTP-18382 +OTP-18384 +OTP-18387 +OTP-18390 +OTP-18391 +OTP-18392 +OTP-18393 +OTP-18398 +OTP-18404 +OTP-18406 +OTP-18407 +OTP-18408 +OTP-18411 +OTP-18412 +OTP-18418 +OTP-18426 +OTP-18429 +OTP-18432 +OTP-18434 +OTP-18443 +OTP-18446 +OTP-18454 +OTP-18457 +OTP-18458 +OTP-18460 +OTP-18463 +OTP-18469 +OTP-18470 +OTP-18472 +OTP-18475 +OTP-18496 diff --git a/otp_versions.table b/otp_versions.table index 9d4bc4abc1..413efad49c 100644 --- a/otp_versions.table +++ b/otp_versions.table @@ -1,3 +1,4 @@ +OTP-25.3 : common_test-1.24 compiler-8.2.4 crypto-5.1.3 debugger-5.3.1 dialyzer-5.0.5 erl_interface-5.3.1 erts-13.2 eunit-2.8.2 ftp-1.1.4 inets-8.3 jinterface-1.13.2 kernel-8.5.4 megaco-4.4.3 mnesia-4.21.4 os_mon-2.8.1 public_key-1.13.3 reltool-0.9.1 snmp-5.13.4 ssh-4.15.3 ssl-10.9 stdlib-4.3 syntax_tools-3.0.1 tftp-1.0.4 xmerl-1.3.31 # asn1-5.0.21 diameter-2.2.7 edoc-1.2 eldap-1.2.10 erl_docgen-1.4 et-1.6.5 observer-2.14 odbc-2.14 parsetools-2.4.1 runtime_tools-1.19 sasl-4.2 tools-3.5.3 wx-2.2.1 : OTP-25.2.3 : erts-13.1.5 inets-8.2.2 ssh-4.15.2 ssl-10.8.7 # asn1-5.0.21 common_test-1.23.3 compiler-8.2.3 crypto-5.1.2 debugger-5.3 dialyzer-5.0.4 diameter-2.2.7 edoc-1.2 eldap-1.2.10 erl_docgen-1.4 erl_interface-5.3 et-1.6.5 eunit-2.8.1 ftp-1.1.3 jinterface-1.13.1 kernel-8.5.3 megaco-4.4.2 mnesia-4.21.3 observer-2.14 odbc-2.14 os_mon-2.8 parsetools-2.4.1 public_key-1.13.2 reltool-0.9 runtime_tools-1.19 sasl-4.2 snmp-5.13.3 stdlib-4.2 syntax_tools-3.0 tftp-1.0.3 tools-3.5.3 wx-2.2.1 xmerl-1.3.30 : OTP-25.2.2 : ftp-1.1.3 # asn1-5.0.21 common_test-1.23.3 compiler-8.2.3 crypto-5.1.2 debugger-5.3 dialyzer-5.0.4 diameter-2.2.7 edoc-1.2 eldap-1.2.10 erl_docgen-1.4 erl_interface-5.3 erts-13.1.4 et-1.6.5 eunit-2.8.1 inets-8.2.1 jinterface-1.13.1 kernel-8.5.3 megaco-4.4.2 mnesia-4.21.3 observer-2.14 odbc-2.14 os_mon-2.8 parsetools-2.4.1 public_key-1.13.2 reltool-0.9 runtime_tools-1.19 sasl-4.2 snmp-5.13.3 ssh-4.15.1 ssl-10.8.6 stdlib-4.2 syntax_tools-3.0 tftp-1.0.3 tools-3.5.3 wx-2.2.1 xmerl-1.3.30 : OTP-25.2.1 : common_test-1.23.3 compiler-8.2.3 erts-13.1.4 inets-8.2.1 kernel-8.5.3 snmp-5.13.3 # asn1-5.0.21 crypto-5.1.2 debugger-5.3 dialyzer-5.0.4 diameter-2.2.7 edoc-1.2 eldap-1.2.10 erl_docgen-1.4 erl_interface-5.3 et-1.6.5 eunit-2.8.1 ftp-1.1.2 jinterface-1.13.1 megaco-4.4.2 mnesia-4.21.3 observer-2.14 odbc-2.14 os_mon-2.8 parsetools-2.4.1 public_key-1.13.2 reltool-0.9 runtime_tools-1.19 sasl-4.2 ssh-4.15.1 ssl-10.8.6 stdlib-4.2 syntax_tools-3.0 tftp-1.0.3 tools-3.5.3 wx-2.2.1 xmerl-1.3.30 : diff --git a/scripts/valgrind_beamasm_update.escript b/scripts/valgrind_beamasm_update.escript index ae2dd0e170..5fa640426c 100755 --- a/scripts/valgrind_beamasm_update.escript +++ b/scripts/valgrind_beamasm_update.escript @@ -3,79 +3,113 @@ -mode(compile). main([VGFile,PerfFile]) -> + ets:new(perf, [ordered_set, {keypos,1}, named_table]), {ok, Perf} = file:read_file(PerfFile), - {ok, VG} = file:read_file(VGFile), - file:write_file(VGFile,update_vg(VG, parse_perf(Perf))). + {ok, VGIo} = file:open(VGFile, [read,binary]), + parse_perf(Perf), + case update_vg(VGIo) of + {ok, Out} -> + file:write_file(VGFile, Out); + {error, Error} -> + io:format(standard_error, "Error ~p", [Error]), + exit(1) + end. parse_perf(Perf) -> %% Example: 0x409b1c0 84 $global::arith_compare_shared - lists:foldl( - fun(<<>>, Acc) -> - Acc; - (Line, Acc) -> + lists:foreach( + fun(<<>>) -> + ok; + (Line) -> [<<"0x",Base/binary>>, Size, Name] = string:split(Line," ",all), - Acc#{ binary_to_integer(Base, 16) => - {binary_to_integer(Size, 16), Name}} - end,#{},string:split(Perf,"\n",all)). + Start = binary_to_integer(Base, 16), + End = Start + binary_to_integer(Size, 16), + ets:insert(perf, [{Start, End, Name}]) + end,string:split(Perf,"\n",all)). + +update_vg(VGIo) -> + {ok, RegularPattern} = re:compile("(?:by|at) 0x([0-9A-F]+): (\\?\\?\\?)"), + {ok, XmlPattern} = re:compile("(<ip>0x([0-9A-F]+)</ip>)"), + update_vg(VGIo, RegularPattern, XmlPattern, [], #{}). +update_vg(VGIo, RegularPattern, XmlPattern, Acc, AddrCache) -> + case io:get_line(VGIo, "") of + eof -> + {ok, lists:reverse(Acc)}; + {error, _} = Error -> + Error; + Line -> + {Line1, AddrCache1} = update_vg0(Line, RegularPattern, XmlPattern, AddrCache), + update_vg(VGIo, RegularPattern, XmlPattern, [Line1|Acc], AddrCache1) + end. -update_vg(VG, Perf) -> +update_vg0(Line, RegularPattern, XmlPattern, AddrCache) -> %% Check if regular log file - case re:run(VG,"(?:by|at) 0x([0-9A-F]+): (\\?\\?\\?)",[global]) of + case re:run(Line,RegularPattern,[global]) of {match, Matches} -> lists:foldl( - fun(Match, File) -> + fun(Match, {File, Cache}) -> [_,Base, Replace] = Match, - case find_replacement(binary_to_integer(binary:part(VG,Base),16), Perf) of - undefined -> - File; - Replacement -> - replace(File,Replace,Replacement) + case find_replacement_cached(binary_to_integer(binary:part(Line,Base),16), Cache) of + {undefined, Cache1} -> + {File, Cache1}; + {Replacement, Cache1} -> + {replace(File,Replace,Replacement), Cache1} end - end, VG, + end, {Line, AddrCache}, %% Run replacements in reverse in order to not invalidate %% the positions as we update the contents. lists:reverse(Matches)); _ -> %% Check if xml log file - case re:run(VG,"(<ip>0x([0-9A-F]+)</ip>)",[global]) of + case re:run(Line,XmlPattern,[global]) of {match, Matches} -> lists:foldl( - fun(Match, File) -> + fun(Match, {File, Cache}) -> [_,Replace,Base] = Match, - case find_replacement(binary_to_integer(binary:part(VG,Base),16), Perf) of - undefined -> - File; - Replacement -> - Xml = ["<ip>0x",binary:part(VG,Base),"</ip>\n" + case find_replacement_cached(binary_to_integer(binary:part(Line,Base),16), Cache) of + {undefined, Cache1} -> + {File, Cache1}; + {Replacement, Cache1} -> + Xml = ["<ip>0x",binary:part(Line,Base),"</ip>\n" " <obj>JIT code</obj>\n" " <fn>",Replacement,"</fn>\n" " <dir></dir>\n" " <file></file>\n" " <line></line>"], - replace(File,Replace,Xml) + {replace(File,Replace,Xml), Cache1} end - end, VG, + end, {Line, AddrCache}, %% Run replacements in reverse in order to not invalidate %% the positions as we update the contents. lists:reverse(Matches)); _ -> - VG + {Line, AddrCache} end end. -find_replacement(Addr, Perf) when is_map(Perf) -> - find_replacement(Addr, maps:iterator(Perf)); -find_replacement(Addr, Iter) -> - case maps:next(Iter) of - {Base,{Size,Str},Next} -> - if Base =< Addr andalso Addr < Base + Size -> - [Str,"+",integer_to_list(Addr - Base, 16)]; - true -> - find_replacement(Addr,Next) - end; - none -> - undefined +find_replacement_cached(Addr, Cache) -> + case Cache of + #{Addr := Result} -> + {Result, Cache}; + _ -> + Result = find_replacement(Addr), + {Result, Cache#{Addr => Result}} + end. + + +find_replacement(Addr) -> + MatchSpec = [{{'$1','$2','$3'}, + [{'andalso',{'>=', Addr,'$1'}, + {'=<', Addr,'$2'}}], + [{{'$1','$3'}}]}], + case ets:select(perf, MatchSpec, 1) of + [] -> + undefined; + '$end_of_table' -> + undefined; + {[{Start, Name}], _} -> + [Name,"+",integer_to_list(Addr - Start, 16)] end. replace(Bin,{Start,Len},What) -> diff --git a/system/doc/reference_manual/processes.xml b/system/doc/reference_manual/processes.xml index afc1215eaf..54d150bc28 100644 --- a/system/doc/reference_manual/processes.xml +++ b/system/doc/reference_manual/processes.xml @@ -701,7 +701,7 @@ spawn(Module, Name, Args) -> pid() that if you do raise the limit like this, you need to take care of flow control yourself to ensure that you do not get into a situation with excessive memory usage.</p> - <change><p>As of OTP @OTP-18454@ it is + <change><p>As of OTP 25.3 it is also possible to enable <i>fully asynchronous distributed signaling</i> on a per process level using <seeerl marker="erts:erlang#process_flag_async_dist"> |
