Skip to content

Commit 29640ec

Browse files
committed
fixup! erts: Fix lock order violation during crash dump
1 parent 70126c8 commit 29640ec

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

erts/emulator/beam/erl_process_dump.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,9 @@ init_literal_areas(void)
806806
ErtsCodeIndex code_ix;
807807
ErtsLiteralArea** area_p;
808808

809+
ERTS_LC_ASSERT(ERTS_IS_CRASH_DUMPING);
810+
809811
code_ix = erts_active_code_ix();
810-
erts_rlock_old_code(code_ix);
811812

812813
lit_areas = area_p = erts_dump_lit_areas;
813814
num_lit_areas = 0;
@@ -836,8 +837,6 @@ init_literal_areas(void)
836837

837838
qsort(erts_persistent_areas, erts_num_persistent_areas,
838839
sizeof(ErtsLiteralArea *), compare_areas);
839-
840-
erts_runlock_old_code(code_ix);
841840
}
842841

843842
static int search_areas(const void * a, const void * b) {
@@ -879,12 +878,10 @@ static void mark_literal(Eterm* ptr)
879878
static void
880879
dump_literals(fmtfn_t to, void *to_arg)
881880
{
882-
ErtsCodeIndex code_ix;
883881
int i;
884882
Uint idx;
885883

886-
code_ix = erts_active_code_ix();
887-
erts_rlock_old_code(code_ix);
884+
ERTS_LC_ASSERT(ERTS_IS_CRASH_DUMPING);
888885

889886
erts_print(to, to_arg, "=literals\n");
890887

@@ -899,8 +896,6 @@ dump_literals(fmtfn_t to, void *to_arg)
899896
}
900897
}
901898

902-
erts_runlock_old_code(code_ix);
903-
904899
for (idx = 0; idx < erts_num_persistent_areas; idx++) {
905900
dump_module_literals(to, to_arg, erts_persistent_areas[idx]);
906901
}

0 commit comments

Comments
 (0)