apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: svn commit: r677505 - /apr/apr-util/trunk/misc/apr_reslist.c
Date Fri, 18 Jul 2008 04:25:25 GMT
Bojan Smojver wrote:
> 
> static apr_status_t de(void *res,void *parm,apr_pool_t *pool){
>   struct res *r=res;
> 
>   apr_pool_destroy(r->p);
> 

With regular cleanup this should core.
Try to random acquire/release resources and do few loops.

The reason is because you are calling destroy on already
destroyed pool.


> int main(int argc,char **argv){
>   int i,j;
     int k;
>   struct res *r[10];
>   apr_pool_t *pool;
>   apr_reslist_t *list;
> 
>   apr_initialize();
     for (k = 0; k < 10; k++) {
>   apr_pool_create(&pool,NULL);
> 
>   apr_reslist_create(&list,0,0,10,0,con,de,NULL,pool);
> 
>   for(j=0;j<1000;j++){
>     for(i=0;i<10;i++)
>       apr_reslist_acquire(list,(void **)&r[i]);
> 
>     for(i=0;i<10;i++)
>       apr_reslist_release(list,r[i]);
>   }
> 
     apr_pool_destroy(pool);
  }

>   apr_terminate();
>   return 0;
> }


Regards
-- 
^(TM)

Mime
View raw message