From 45e356fb7b5d381a6e3c9ec83bf20fe9cefe8e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 2 Apr 2013 08:13:32 +0200 Subject: Don't lose the extension mark for object set parameters When an object set is an actual parameter, the extension marker for the object set could get lost. --- lib/asn1/src/asn1ct_check.erl | 4 +-- lib/asn1/test/asn1_SUITE.erl | 5 +-- lib/asn1/test/asn1_SUITE_data/Param2.asn1 | 36 +++++++++++++++++++++ lib/asn1/test/testParameterizedInfObj.erl | 52 +++++++++++++++++++++++++++++-- 4 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 lib/asn1/test/asn1_SUITE_data/Param2.asn1 diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl index 59e82b7a57..2b48c62ac9 100644 --- a/lib/asn1/src/asn1ct_check.erl +++ b/lib/asn1/src/asn1ct_check.erl @@ -4026,8 +4026,8 @@ categorize(S,value,Type,Value) -> [#valuedef{type=Type,value=Value,module=S#state.mname}]. -parse_objectset({valueset,T=#type{}}) -> - [T]; +parse_objectset({valueset,#type{def=#'Externaltypereference'{}=Ref}}) -> + Ref; parse_objectset({valueset,Set}) -> Set; parse_objectset(#type{def=Ref}) when is_record(Ref,'Externaltypereference') -> diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 12569273bd..be3a6c52c2 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -812,8 +812,9 @@ testInfObjectClass(Config, Rule, Opts) -> testParameterizedInfObj(Config) -> test(Config, fun testParameterizedInfObj/3). testParameterizedInfObj(Config, Rule, Opts) -> - asn1_test_lib:compile("Param", Config, [Rule|Opts]), - testParameterizedInfObj:main(Rule). + Files = ["Param","Param2"], + asn1_test_lib:compile_all(Files, Config, [Rule|Opts]), + testParameterizedInfObj:main(Config, Rule). testMergeCompile(Config) -> test(Config, fun testMergeCompile/3). testMergeCompile(Config, Rule, Opts) -> diff --git a/lib/asn1/test/asn1_SUITE_data/Param2.asn1 b/lib/asn1/test/asn1_SUITE_data/Param2.asn1 new file mode 100644 index 0000000000..4393f875b6 --- /dev/null +++ b/lib/asn1/test/asn1_SUITE_data/Param2.asn1 @@ -0,0 +1,36 @@ +Param2 DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + + S1AP-PROTOCOL-IES ::= CLASS { + &id INTEGER UNIQUE, + &Value + } + WITH SYNTAX { + ID &id + TYPE &Value + } + + ProtocolIE-Field {S1AP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE { + id S1AP-PROTOCOL-IES.&id ({IEsSetParam}), + value S1AP-PROTOCOL-IES.&Value ({IEsSetParam}{@id}) + } + + ProtocolIE-Container {S1AP-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (0..10)) OF ProtocolIE-Field {{IEsSetParam}} + + HandoverRequired ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverRequiredIEs } }, + ... + } + + HandoverRequiredIEs S1AP-PROTOCOL-IES ::= { + { ID 1 TYPE OCTET STRING } | + { ID 2 TYPE INTEGER }, +--Delete-start + ..., + { ID 100 TYPE INTEGER (0..1023) } | + { ID 101 TYPE ENUMERATED {true,false} } +--Delete-end + } + +END diff --git a/lib/asn1/test/testParameterizedInfObj.erl b/lib/asn1/test/testParameterizedInfObj.erl index 68faf08a61..2c3bb0d119 100644 --- a/lib/asn1/test/testParameterizedInfObj.erl +++ b/lib/asn1/test/testParameterizedInfObj.erl @@ -20,7 +20,7 @@ -module(testParameterizedInfObj). --export([main/1,ranap/1]). +-export([main/2,ranap/1]). -include_lib("test_server/include/test_server.hrl"). @@ -31,7 +31,11 @@ -record('Iu-ReleaseCommand',{protocolIEs,protocolExtensions}). -main(Erule) -> +main(Config, Erule) -> + param(Erule), + param2(Config, Erule). + +param(Erule) -> PERVal = #'AllocationOrRetentionPriority' {priorityLevel = true, iE_Extensions = @@ -84,7 +88,6 @@ main(Erule) -> ok. - ranap(_Erule) -> ?line PIEVal2 = [{'ProtocolIE-Field',4,ignore,{'Cause',{radioNetwork,'rab-pre-empted'}}}], ?line Val2 = @@ -102,3 +105,46 @@ open_type(uper_bin,Val) when is_list(Val) -> list_to_binary(Val); open_type(_,Val) -> Val. + +param2(Config, Erule) -> + roundtrip2('HandoverRequired', + {'HandoverRequired', + [{'ProtocolIE-Field',1,"ABC"}, + {'ProtocolIE-Field',2,577799}]}), + Enc = roundtrip2('HandoverRequired', + {'HandoverRequired', + [{'ProtocolIE-Field',1,"ABC"}, + {'ProtocolIE-Field',2,-42}, + {'ProtocolIE-Field',100,533}, + {'ProtocolIE-Field',101,true}]}), + + %% Now remove the data after the extension mark in the object set. + DataDir = ?config(data_dir, Config), + CaseDir = ?config(case_dir, Config), + Asn1SrcBase = "Param2.asn1", + Asn1SrcFile0 = filename:join(DataDir, Asn1SrcBase), + {ok,Src0} = file:read_file(Asn1SrcFile0), + Src = re:replace(Src0, "--Delete-start.*?--Delete-end", "...\n", + [dotall,global,{return,binary}]), + io:format("~s\n\n", [Src]), + + Asn1SrcFile = filename:join(CaseDir, Asn1SrcBase), + ok = file:write_file(Asn1SrcFile, Src), + ok = asn1ct:compile(Asn1SrcFile, + [{i,DataDir},{outdir,CaseDir},Erule]), + + %% Decompile extended data. + {ok,{'HandoverRequired',[{'ProtocolIE-Field',1,"ABC"}, + {'ProtocolIE-Field',2,-42}, + {'ProtocolIE-Field',100,Open100}, + {'ProtocolIE-Field',101,Open101}]}} = + asn1_wrapper:decode('Param2', 'HandoverRequired', Enc), + true = is_binary(Open100), + true = is_binary(Open101), + ok. + + +roundtrip2(T, V) -> + {ok,Enc} = asn1_wrapper:encode('Param2', T, V), + {ok,V} = asn1_wrapper:decode('Param2', T, Enc), + Enc. -- cgit v1.2.3 From f7c7510b55efe6a1ab1133f47ec4c3b0371784e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 2 Apr 2013 13:39:50 +0200 Subject: Prevent loss of objects after the extension marker In an object set with a single root object, objects after the extension marker would be lost. --- lib/asn1/src/asn1ct_check.erl | 4 ++-- lib/asn1/test/asn1_SUITE_data/Param2.asn1 | 12 ++++++++++++ lib/asn1/test/testParameterizedInfObj.erl | 5 +++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl index 2b48c62ac9..99b09c4e90 100644 --- a/lib/asn1/src/asn1ct_check.erl +++ b/lib/asn1/src/asn1ct_check.erl @@ -1025,8 +1025,8 @@ prepare_objset({{'SingleValue',Set},Ext}) -> %% {set,lists:append([Set,Ext]),true}; prepare_objset({Set,Ext}) when is_list(Set) -> {set,merge_sets(Set,Ext),true}; -prepare_objset({ObjDef={object,definedsyntax,_ObjFields},_Ext}) -> - {set,[ObjDef],true}; +prepare_objset({{object,definedsyntax,_ObjFields}=Set,Ext}) -> + {set,merge_sets(Set, Ext),true}; prepare_objset(ObjDef={object,definedsyntax,_ObjFields}) -> {set,[ObjDef],false}; prepare_objset({ObjDef=#type{},Ext}) when is_list(Ext) -> diff --git a/lib/asn1/test/asn1_SUITE_data/Param2.asn1 b/lib/asn1/test/asn1_SUITE_data/Param2.asn1 index 4393f875b6..09ccb367d8 100644 --- a/lib/asn1/test/asn1_SUITE_data/Param2.asn1 +++ b/lib/asn1/test/asn1_SUITE_data/Param2.asn1 @@ -33,4 +33,16 @@ BEGIN --Delete-end } + SingleRoot ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { SingleRootIEs } }, + ... + } + + -- The extension was lost when there was a single root item. + SingleRootIEs S1AP-PROTOCOL-IES ::= { + { ID 1 TYPE OCTET STRING }, + ..., + { ID 2 TYPE INTEGER } + } + END diff --git a/lib/asn1/test/testParameterizedInfObj.erl b/lib/asn1/test/testParameterizedInfObj.erl index 2c3bb0d119..940b96a339 100644 --- a/lib/asn1/test/testParameterizedInfObj.erl +++ b/lib/asn1/test/testParameterizedInfObj.erl @@ -141,6 +141,11 @@ param2(Config, Erule) -> asn1_wrapper:decode('Param2', 'HandoverRequired', Enc), true = is_binary(Open100), true = is_binary(Open101), + + %% Test single root. + roundtrip2('SingleRoot', + {'SingleRoot',[{'ProtocolIE-Field',1,"ABC"}, + {'ProtocolIE-Field',2,9999}]}), ok. -- cgit v1.2.3 From 32b32fb6dd9e4c501c434789625e270e437960e3 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 15 Apr 2013 14:06:53 +0200 Subject: Prepare release --- lib/asn1/doc/src/notes.xml | 17 +++++++++++++++++ lib/asn1/vsn.mk | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml index de58aef0e2..7a371ddbf9 100644 --- a/lib/asn1/doc/src/notes.xml +++ b/lib/asn1/doc/src/notes.xml @@ -31,6 +31,23 @@

This document describes the changes made to the asn1 application.

+
Asn1 1.8.1.1 + +
Fixed Bugs and Malfunctions + + +

+ When an object set is an actual parameter, the extension + marker for the object set could get lost (which would + cause the decoding of unknown values to fail).

+

+ Own Id: OTP-10995 Aux Id: seq12290

+
+
+
+ +
+
Asn1 1.8.1
Fixed Bugs and Malfunctions diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk index b4b4e0b431..10ee992732 100644 --- a/lib/asn1/vsn.mk +++ b/lib/asn1/vsn.mk @@ -1,2 +1,2 @@ #next version number to use is 2.0 -ASN1_VSN = 1.8.1 +ASN1_VSN = 1.8.1.1 -- cgit v1.2.3 From 3039afdb65d42ef2b300560cfafaa50ba5d4473f Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 16 Apr 2013 16:59:21 +0200 Subject: Do not count offline run-queues as empty --- erts/emulator/beam/erl_process.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index 7e0884f55f..f9ef4eac65 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -2625,6 +2625,8 @@ set_no_active_runqs(int active) erts_aint32_t exp = erts_smp_atomic32_read_nob(&balance_info.no_runqs); while (1) { erts_aint32_t act, new; + if ((exp & ERTS_NO_RUNQS_MASK) == active) + break; new = exp & (ERTS_NO_RUNQS_MASK << ERTS_NO_USED_RUNQS_SHIFT); new |= active & ERTS_NO_RUNQS_MASK; act = erts_smp_atomic32_cmpxchg_nob(&balance_info.no_runqs, new, exp); @@ -3171,9 +3173,6 @@ evacuate_run_queue(ErtsRunQueue *rq, if (notify) smp_notify_inc_runq(to_rq); } - - if (ERTS_EMPTY_RUNQ(rq)) - empty_runq(rq); } static int @@ -4067,9 +4066,8 @@ static void change_no_used_runqs(int used) { ErtsMigrationPaths *new_mpaths, *old_mpaths; - int active, qix; + int qix; erts_smp_mtx_lock(&balance_info.update_mtx); - get_no_runqs(&active, NULL); set_no_used_runqs(used); old_mpaths = erts_get_migration_paths_managed(); @@ -4697,7 +4695,7 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online) schdlr_sspnd.msb.ongoing = 0; erts_smp_atomic32_init_nob(&schdlr_sspnd.active, no_schedulers); schdlr_sspnd.msb.procs = NULL; - init_no_runqs(no_schedulers, no_schedulers_online); + init_no_runqs(no_schedulers_online, no_schedulers_online); balance_info.last_active_runqs = no_schedulers; erts_smp_mtx_init(&balance_info.update_mtx, "migration_info_update"); balance_info.forced_check_balance = 0; -- cgit v1.2.3 From 0d9d402d50e803f1efdd1a1ce96fdbb78229c4a9 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 16 Apr 2013 20:15:04 +0200 Subject: Prepare release --- lib/asn1/doc/src/notes.xml | 17 +++++++++++++++++ lib/asn1/vsn.mk | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml index e619408591..76d605569d 100644 --- a/lib/asn1/doc/src/notes.xml +++ b/lib/asn1/doc/src/notes.xml @@ -31,6 +31,23 @@

This document describes the changes made to the asn1 application.

+
Asn1 2.0.1.2 + +
Fixed Bugs and Malfunctions + + +

+ When an object set is an actual parameter, the extension + marker for the object set could get lost (which would + cause the decoding of unknown values to fail).

+

+ Own Id: OTP-10995 Aux Id: seq12290

+
+
+
+ +
+
Asn1 2.0.1.1
Fixed Bugs and Malfunctions diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk index 3c4f3ff122..9245f83280 100644 --- a/lib/asn1/vsn.mk +++ b/lib/asn1/vsn.mk @@ -1,2 +1,2 @@ #next version number to use is 2.0 -ASN1_VSN = 2.0.1.1 +ASN1_VSN = 2.0.1.2 -- cgit v1.2.3 From ad7231b1b5227f2ba9baa58c1c436ff9a95d2c67 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 16 Apr 2013 20:15:04 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 23 +++++++++++++++++++++++ erts/vsn.mk | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index c9c46afa4b..3a2c644ff7 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,29 @@

This document describes the changes made to the ERTS application.

+
Erts 5.10.1.2 + +
Fixed Bugs and Malfunctions + + +

+ A bug in the implementation of offline schedulers has + been fixed. The bug was introduced in OTP-R16A/ERTS-5.10, + and caused work-stealing between schedulers to fail. This + in turn, caused work to accumulate in some run-queues. + The bug was only triggered when there were offline + schedulers in the system, i.e., when the amount of online + schedulers was less than the total amount of schedulers. + The effect of the bug got more severe the larger amount + of offline schedulers the system had.

+

+ Own Id: OTP-11022 Aux Id: OTP-9892

+
+
+
+ +
+
Erts 5.10.1.1
Fixed Bugs and Malfunctions diff --git a/erts/vsn.mk b/erts/vsn.mk index 07ca2ec1b3..43ed671cee 100644 --- a/erts/vsn.mk +++ b/erts/vsn.mk @@ -17,7 +17,7 @@ # %CopyrightEnd% # -VSN = 5.10.1.1 +VSN = 5.10.1.2 SYSTEM_VSN = R16B # Port number 4365 in 4.2 -- cgit v1.2.3