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
This commit is contained in:
Sergei Golubchik 2008-12-05 11:51:51 +01:00
parent f82866f588
commit c151d0cc05

View File

@ -261,6 +261,7 @@ TRN *trnman_new_trn(WT_THD *wt)
{
int res;
TRN *trn;
union { TRN *trn; void *v; } tmp;
DBUG_ENTER("trnman_new_trn");
/*
@ -276,19 +277,19 @@ TRN *trnman_new_trn(WT_THD *wt)
pthread_mutex_lock(&LOCK_trn_list);
/* Allocating a new TRN structure */
trn= pool;
tmp.trn= pool;
/*
Popping an unused TRN from the pool
(ABA isn't possible, we're behind a mutex
*/
my_atomic_rwlock_wrlock(&LOCK_pool);
while (trn && !my_atomic_casptr((void **)&pool, (void **)&trn,
(void *)trn->next))
while (tmp.trn && !my_atomic_casptr((void **)&pool, &tmp.v,
(void *)tmp.trn->next))
/* no-op */;
my_atomic_rwlock_wrunlock(&LOCK_pool);
/* Nothing in the pool ? Allocate a new one */
if (!trn)
if (!(trn= tmp.trn))
{
/*
trn should be completely initalized at create time to allow