From: Yves Orton Date: Mon, 12 Jun 2006 19:17:30 +0000 (+0200) Subject: Re: Segv from new regex code when under threads. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=283d8f99b00e13e7093e982ec62814fc64bdc2ff;p=p5sagit%2Fp5-mst-13.2.git Re: Segv from new regex code when under threads. Message-ID: <9b18b3110606121017t3af81484t4fb13015fac74592@mail.gmail.com> p4raw-id: //depot/perl@28388 --- diff --git a/regcomp.c b/regcomp.c index 6165317..a891c48 100644 --- a/regcomp.c +++ b/regcomp.c @@ -1062,7 +1062,8 @@ S_make_trie_failtable(pTHX_ RExC_state_t *pRExC_state, regnode *source, regnode (trie->laststate+1)*sizeof(reg_trie_state)); Newxz( q, numstates, U32); Newxz( aho->fail, numstates, U32 ); - fail= aho->fail; + aho->refcount = 1; + fail = aho->fail; fail[ 0 ] = fail[ 1 ] = 1; for ( charid = 0; charid < ucharcount ; charid++ ) { diff --git a/win32/vmem.h b/win32/vmem.h index 3cb10a3..25f2376 100644 --- a/win32/vmem.h +++ b/win32/vmem.h @@ -207,7 +207,8 @@ void VMem::Free(void* pMem) dTHX; int *nowhere = NULL; Perl_warn(aTHX_ "Free to wrong pool %p not %p",this,ptr->owner); - *nowhere = 0; + *nowhere = 0; /* this segfault is deliberate, + so you can see the stack trace */ #else ptr->owner->Free(pMem); #endif