diff options
| author | Rickard Green <rickard@erlang.org> | 2020-05-08 11:53:21 +0200 |
|---|---|---|
| committer | Rickard Green <rickard@erlang.org> | 2020-05-08 11:53:21 +0200 |
| commit | ae48e045a87bf0a36fd36641dffdf397d120da4e (patch) | |
| tree | dc796e52dc439aff0e75992d6eed916593998397 | |
| parent | b39c4b2a64649fccb73ef4484a8e9e2d32804354 (diff) | |
| parent | ecbc66470be44964f495fbdb1185cdd056825a9c (diff) | |
| download | erlang-ae48e045a87bf0a36fd36641dffdf397d120da4e.tar.gz | |
Merge branch 'maint'
* maint:
Fix dirty check process code
Fix literal area gc bug
Suppress Dialyzer warnings of type no_match in generated files
Correct printout that shows which encoding rules the tests are done for.
| -rw-r--r-- | erts/emulator/beam/beam_bif_load.c | 6 | ||||
| -rw-r--r-- | erts/emulator/beam/erl_process.c | 20 | ||||
| -rw-r--r-- | lib/asn1/src/asn1ct_gen.erl | 4 | ||||
| -rw-r--r-- | lib/asn1/test/testEnumExt.erl | 2 |
4 files changed, 23 insertions, 9 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c index 6f65734e9c..d551863978 100644 --- a/erts/emulator/beam/beam_bif_load.c +++ b/erts/emulator/beam/beam_bif_load.c @@ -600,7 +600,7 @@ BIF_RETTYPE erts_internal_check_dirty_process_code_2(BIF_ALIST_2) if (BIF_ARG_1 == BIF_P->common.id) BIF_RET(am_normal); - rp = erts_proc_lookup_raw(BIF_ARG_1); + rp = erts_proc_lookup(BIF_ARG_1); if (!rp) BIF_RET(am_false); @@ -619,7 +619,9 @@ BIF_RETTYPE erts_internal_check_dirty_process_code_2(BIF_ALIST_2) if (busy) BIF_RET(am_busy); - res = erts_check_process_code(rp, BIF_ARG_2, &reds, BIF_P->fcalls); + res = (ERTS_PROC_IS_EXITING(rp) + ? am_false + : erts_check_process_code(rp, BIF_ARG_2, &reds, BIF_P->fcalls)); erts_proc_unlock(rp, ERTS_PROC_LOCK_MAIN); diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index a16263cea1..0a1e274396 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -6933,13 +6933,25 @@ schedule_process_sys_task(Process *p, erts_aint32_t prio, ErtsProcSysTask *st, { erts_aint32_t fail_state, state; + fail_state = *fail_state_p; + /* Elevate priority if needed. */ - state = erts_atomic32_read_nob(&p->state); - if (ERTS_PSFLGS_GET_ACT_PRIO(state) > prio) { + state = erts_atomic32_read_acqb(&p->state); + if (ERTS_PSFLGS_GET_ACT_PRIO(state) <= prio) { + if (state & fail_state) { + *fail_state_p = state & fail_state; + return 0; + } + } + else { erts_aint32_t n, a, e; a = state; do { + if (a & fail_state) { + *fail_state_p = a & fail_state; + return 0; + } if (ERTS_PSFLGS_GET_ACT_PRIO(a) <= prio) { n = a; break; @@ -6953,8 +6965,6 @@ schedule_process_sys_task(Process *p, erts_aint32_t prio, ErtsProcSysTask *st, state = n; } - fail_state = *fail_state_p; - return !(active_sys_enqueue(p, st, prio, ERTS_PSFLG_SYS_TASKS, state, fail_state_p) & fail_state); } @@ -10728,7 +10738,7 @@ request_system_task(Process *c_p, Eterm requester, Eterm target, Eterm priority, Eterm operation) { BIF_RETTYPE ret; - Process *rp = erts_proc_lookup(target); + Process *rp = erts_proc_lookup_raw(target); ErtsProcSysTask *st = NULL; erts_aint32_t prio, fail_state = ERTS_PSFLG_EXITING; Eterm noproc_res, req_type; diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl index 4f8b428b54..30396821b7 100644 --- a/lib/asn1/src/asn1ct_gen.erl +++ b/lib/asn1/src/asn1ct_gen.erl @@ -1314,7 +1314,9 @@ gen_head(#gen{options=Options}=Gen, Mod, Hrl) -> Mod,".",nl,nl, "-module('",Mod,"').",nl, "-compile(nowarn_unused_vars).",nl, - "-dialyzer(no_improper_lists).",nl]), + "-dialyzer(no_improper_lists).",nl, + "-dialyzer(no_match).",nl + ]), case Hrl of 0 -> ok; _ -> emit(["-include(\"",Mod,".hrl\").",nl]) diff --git a/lib/asn1/test/testEnumExt.erl b/lib/asn1/test/testEnumExt.erl index b30750f7fc..cb01ad481f 100644 --- a/lib/asn1/test/testEnumExt.erl +++ b/lib/asn1/test/testEnumExt.erl @@ -41,7 +41,7 @@ main(Rule) when Rule =:= per; Rule =:= uper -> B64 = roundtrip('Noext', red), common(Rule); main(Rule) when Rule =:= ber; Rule =:= jer -> - io:format("main(ber)~n",[]), + io:format("main(~p)~n",[Rule]), %% ENUMERATED with extensionmark (value is in root set) roundtrip('Ext', red), |
