aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-09-12 20:08:42 +0200
committerSverker Eriksson <[email protected]>2017-09-12 20:08:42 +0200
commitdcb66b30a2115e2a57436d800ed41880e5be633e (patch)
treef226c53befb29208a055cf02bcd9c8b13e60c9bb
parentc8cf0eb3af418ee505f6726258cb5d34b14f8867 (diff)
parent98bd5f66a03b945916baa2a91c4aba3c837676d1 (diff)
downloadotp-dcb66b30a2115e2a57436d800ed41880e5be633e.tar.gz
otp-dcb66b30a2115e2a57436d800ed41880e5be633e.tar.bz2
otp-dcb66b30a2115e2a57436d800ed41880e5be633e.zip
Merge branch 'sverker/ets-fix-assert-fix' into maint
* sverker/ets-fix-assert-fix: erts: Fix faulty ASSERT of table fixation counter
-rw-r--r--erts/emulator/beam/erl_db.c11
-rw-r--r--erts/emulator/beam/erl_db_util.h3
2 files changed, 4 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c
index b83134c79c..6d4a895ef6 100644
--- a/erts/emulator/beam/erl_db.c
+++ b/erts/emulator/beam/erl_db.c
@@ -3606,14 +3606,8 @@ static SWord proc_cleanup_fixed_table(Process* p, DbFixation* fix)
ASSERT(sizeof(DbFixation) == ERTS_ALC_DBG_BLK_SZ(fix));
ERTS_DB_ALC_MEM_UPDATE_(tb, sizeof(DbFixation), 0);
}
- else {
- ASSERT(fix->counter == 0);
- }
db_unlock(tb, LCK_WRITE_REC);
}
- else {
- ASSERT(fix->counter == 0);
- }
erts_bin_release(fix->tabs.btid);
erts_free(ERTS_ALC_T_DB_FIXATION, fix);
@@ -3855,11 +3849,8 @@ static void free_fixations_op(DbFixation* fix, void* vctx)
{
struct free_fixations_ctx* ctx = (struct free_fixations_ctx*) vctx;
erts_aint_t diff;
-#ifdef DEBUG
- DbTable* dbg_tb = btid2tab(fix->tabs.btid);
-#endif
- ASSERT(!dbg_tb || dbg_tb == ctx->tb);
+ ASSERT(!btid2tab(fix->tabs.btid));
ASSERT(fix->counter > 0);
ASSERT(ctx->tb->common.status & DB_DELETE);
diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h
index 19055c6110..7ce104a84c 100644
--- a/erts/emulator/beam/erl_db_util.h
+++ b/erts/emulator/beam/erl_db_util.h
@@ -220,6 +220,9 @@ typedef struct db_fixation {
Process* p;
} procs;
+ /* Number of fixations on table from procs.p
+ * Protected by table write lock or read lock + fixlock
+ */
Uint counter;
} DbFixation;