Commit c151d0cc authored by Sergei Golubchik's avatar Sergei Golubchik

bug#41024 maria: Server crashes in sysbench OLTP_RW test at lf_hash.c:94

bug#41023 maria: Server asserts in sysbench OLTP_RO test 
bug#40888 maria: Server crashes in sysbench OLTP_RW test at lf_alloc-pin.c:513
bug#40892 maria: Livelock in sysbench OLTP_RW test 
bug#40895 maria: Server crashes in sysbench OLTP_RO test at lf_alloc-pin.c:367
bug#40890 maria: Server crashes in sysbench OLTP_RW test at ctype-bin.c:8

Yet another strict aliasing issue
parent f82866f5
...@@ -261,6 +261,7 @@ TRN *trnman_new_trn(WT_THD *wt) ...@@ -261,6 +261,7 @@ TRN *trnman_new_trn(WT_THD *wt)
{ {
int res; int res;
TRN *trn; TRN *trn;
union { TRN *trn; void *v; } tmp;
DBUG_ENTER("trnman_new_trn"); DBUG_ENTER("trnman_new_trn");
/* /*
...@@ -276,19 +277,19 @@ TRN *trnman_new_trn(WT_THD *wt) ...@@ -276,19 +277,19 @@ TRN *trnman_new_trn(WT_THD *wt)
pthread_mutex_lock(&LOCK_trn_list); pthread_mutex_lock(&LOCK_trn_list);
/* Allocating a new TRN structure */ /* Allocating a new TRN structure */
trn= pool; tmp.trn= pool;
/* /*
Popping an unused TRN from the pool Popping an unused TRN from the pool
(ABA isn't possible, we're behind a mutex (ABA isn't possible, we're behind a mutex
*/ */
my_atomic_rwlock_wrlock(&LOCK_pool); my_atomic_rwlock_wrlock(&LOCK_pool);
while (trn && !my_atomic_casptr((void **)&pool, (void **)&trn, while (tmp.trn && !my_atomic_casptr((void **)&pool, &tmp.v,
(void *)trn->next)) (void *)tmp.trn->next))
/* no-op */; /* no-op */;
my_atomic_rwlock_wrunlock(&LOCK_pool); my_atomic_rwlock_wrunlock(&LOCK_pool);
/* Nothing in the pool ? Allocate a new one */ /* Nothing in the pool ? Allocate a new one */
if (!trn) if (!(trn= tmp.trn))
{ {
/* /*
trn should be completely initalized at create time to allow trn should be completely initalized at create time to allow
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment