httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <>
Subject Re: VS2010 release builds of Apache/mod_perl crash on Vista/2008/Win7
Date Fri, 04 Feb 2011 21:53:45 GMT
On 2/4/2011 3:49 PM, Steve Hay wrote:
> Yes, Apache, Perl and mod_perl were all brand-new builds done one immediately after another
on the same machine, using the same VS2010 installation for them all.

I presume by Apache you mean httpd as well as apr and apr-util, etc.

> Also, note that the test.cpp program that I attached in my original post (which you've
quoted the stack trace from above) is a self-contained standalone program, not linked to anything
other than standard MS libraries. The functions in it are copied directly from the APR code
with just minor renaming, macro expansion and comment removal.


> Actually, there is one comment in httpd-2.2.17\srclib\apr\misc\win32\apr_app.c that sounds
very pertinent:
>  *   _dbg_malloc/realloc is used in place of the usual API, in order
>  *   to convince the MSVCRT that it created these entities.  If we
>  *   do not create them as _CRT_BLOCK entities, the crt will fault
>  *   on an assert.  We are not worrying about the crt's locks here,
>  *   since we are single threaded [so far].
> It looks like the original environ[] was allocated by msvcr100.dll using something other
than a function matching the HeapFree() function where the crash finally happens. The CRT
code is trying to free the existing PATH in its environment before setting the new value coming
from _putenv(), and it is that free that crashes, presumably because the APR re-processing
of the environ entities didn't fool MSVCRT well enough?

That makes sense, and it should be easy to make that conditional on the vc version.
Now the question is where were these allocated from in MSVCR100?  Only a trip through
the crt sources will help out, there.

View raw message