Skip to content

Commit

Permalink
erts: Fix no locking in export_table_sz() during crash dump
Browse files Browse the repository at this point in the history
  • Loading branch information
sverker committed May 28, 2024
1 parent 0418c10 commit 5372d0e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions erts/emulator/beam/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,18 @@ int export_list_size(ErtsCodeIndex code_ix)

int export_table_sz(void)
{
const int lock = !ERTS_IS_CRASH_DUMPING;
int i, bytes = 0;

export_staging_lock();
if (lock) {
export_staging_lock();
}
for (i=0; i<ERTS_NUM_CODE_IX; i++) {
bytes += index_table_sz(&export_tables[i]);
}
export_staging_unlock();
if (lock) {
export_staging_unlock();
}
return bytes;
}
int export_entries_sz(void)
Expand Down

0 comments on commit 5372d0e

Please sign in to comment.