apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Ince" <si...@opendemand.com>
Subject memory analysis
Date Thu, 16 Sep 2004 06:26:20 GMT
Hi,
    I am trying to find memory errors in my application and I am having a
hard time. I tried setting APR_POOL_DEBUG=2 but it is catching the errors.

Here are the three types of errors I would like to catch.

/* according the apr docs it should about here, but it doesn't */
/* APR_POOL_DEBUG=2  */
    apr_file_printf(local_stderr, "buffer overflow for apr_pcalloc()\n");
    {
       char *buf = (char *) apr_pcalloc(local_pool, 5);
       memset(buf,0,6);
    }

    apr_file_printf(local_stderr, "buffer overflow for malloc()\n");
    {
       char *buf = (char *) malloc(5);
       memset(buf,0,6);
    }

    apr_file_printf(local_stderr, "stack overflow\n");
    {
       char buf[5];
       memset(buf,0,6);
    }

Steve


Mime
View raw message