Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

A possible bug found // RE: svn commit: r783 - /release/httpd/

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


bswen at pku

Aug 21, 2012, 5:00 AM

Post #1 of 5 (260 views)
Permalink
A possible bug found // RE: svn commit: r783 - /release/httpd/

A possible subtle bug with httpd-2.4.3 on Windows (Server 2008 R2) was found

in the following source file, which was compiled using VS2010:

httpd-2.4.3/server/config.c

// line 602:
ap_module_short_names[m->module_index] = strdup(sym_name);

// line 680:
free(ap_module_short_names[m->module_index]);

The bug was associated with the (new) implementation of the strdup()
function:
it calls malloc() when compiled as non-debug version, but calls
_malloc_dbg() when
compiled for debugging. In the later case, the free() at line 680 call would
always fail
and cause the process terminated.

The following was my quick fixing of the problem, which uses _free_dbg() to
free
the strings memory space:

#ifdef WIN32
#ifdef _DEBUG
_free_dbg(ap_module_short_names[m->module_index],
1/*_NORMAL_BLOCK*/);
#else /* _DEBUG */
free(ap_module_short_names[m->module_index]);
#endif /* _DEBUG */
#else
free(ap_module_short_names[m->module_index]);
#endif /* WIN32 */

This solution was not a clean one, though (server/config.c is on an OS
independent level).
So please verify the issue.

Regrards,
Bing



-----Original Message-----
From: Jeff Trawick [mailto:trawick [at] gmail]
Sent: Tuesday, August 21, 2012 7:54 AM
To: dev [at] httpd
Subject: Re: svn commit: r783 - /release/httpd/

On Mon, Aug 20, 2012 at 1:45 PM, <jim [at] apache> wrote:
> Author: jim
> Date: Mon Aug 20 17:45:46 2012
> New Revision: 783
>
> Log:
> Scrap old

Uhh, once the next is on all the mirrors and the page is updated to point to
2.4.3 ;)

>
> Removed:
> release/httpd/CHANGES_2.4.2
> release/httpd/httpd-2.4.2-deps.tar.bz2
> release/httpd/httpd-2.4.2-deps.tar.bz2.asc
> release/httpd/httpd-2.4.2-deps.tar.bz2.md5
> release/httpd/httpd-2.4.2-deps.tar.bz2.sha1
> release/httpd/httpd-2.4.2-deps.tar.gz
> release/httpd/httpd-2.4.2-deps.tar.gz.asc
> release/httpd/httpd-2.4.2-deps.tar.gz.md5
> release/httpd/httpd-2.4.2-deps.tar.gz.sha1
> release/httpd/httpd-2.4.2.tar.bz2
> release/httpd/httpd-2.4.2.tar.bz2.asc
> release/httpd/httpd-2.4.2.tar.bz2.md5
> release/httpd/httpd-2.4.2.tar.bz2.sha1
> release/httpd/httpd-2.4.2.tar.gz
> release/httpd/httpd-2.4.2.tar.gz.asc
> release/httpd/httpd-2.4.2.tar.gz.md5
> release/httpd/httpd-2.4.2.tar.gz.sha1
>


covener at gmail

Aug 21, 2012, 5:22 AM

Post #2 of 5 (254 views)
Permalink
Re: A possible bug found // RE: svn commit: r783 - /release/httpd/ [In reply to]

I don't think a source code change should be required.

http://msdn.microsoft.com/en-US/library/we1whae7(v=vs.80)

"When the application is linked with a debug version of the C run-time
libraries, free resolves to _free_dbg. For more information about how
the heap is managed during the debugging process, see The CRT Debug
Heap."


bswen at pku

Aug 21, 2012, 7:22 AM

Post #3 of 5 (246 views)
Permalink
RE: A possible bug found // RE: svn commit: r783 - /release/httpd/ [In reply to]

The cited documentation seems to apply only to Windows Server 2003?
As I've tested, free() didn't seem to resolve to _free_dbg on Windows Server
2008 + VS2010, or on Windows Server 2012 + VS2012.
The installed httpd-2.4.3 binaries just can not run if the code is not
changed. So please verify why that could happen.

Bing


-----Original Message-----
From: Eric Covener [mailto:covener [at] gmail]
Sent: Tuesday, August 21, 2012 8:22 PM
To: dev [at] httpd
Subject: Re: A possible bug found // RE: svn commit: r783 - /release/httpd/

I don't think a source code change should be required.

http://msdn.microsoft.com/en-US/library/we1whae7(v=vs.80)

"When the application is linked with a debug version of the C run-time
libraries, free resolves to _free_dbg. For more information about how the
heap is managed during the debugging process, see The CRT Debug Heap."


rainer.jung at kippdata

Aug 21, 2012, 7:50 AM

Post #4 of 5 (248 views)
Permalink
Re: A possible bug found // RE: svn commit: r783 - /release/httpd/ [In reply to]

On 21.08.2012 16:22, PKU-bswen wrote:
> The cited documentation seems to apply only to Windows Server 2003?

Unfortunately I can't easily check myself, but the documentation states
the automatic chosing of the debug variants also for VS 2012:

http://msdn.microsoft.com/en-us/library/z8h19c37

> As I've tested, free() didn't seem to resolve to _free_dbg on Windows Server
> 2008 + VS2010, or on Windows Server 2012 + VS2012.
> The installed httpd-2.4.3 binaries just can not run if the code is not
> changed. So please verify why that could happen.

Regards,

Rainer


covener at gmail

Aug 21, 2012, 7:56 AM

Post #5 of 5 (249 views)
Permalink
Re: A possible bug found // RE: svn commit: r783 - /release/httpd/ [In reply to]

On Tue, Aug 21, 2012 at 10:50 AM, Rainer Jung <rainer.jung [at] kippdata> wrote:
> On 21.08.2012 16:22, PKU-bswen wrote:
>>
>> The cited documentation seems to apply only to Windows Server 2003?
>
>
> Unfortunately I can't easily check myself, but the documentation states the
> automatic chosing of the debug variants also for VS 2012:
>
> http://msdn.microsoft.com/en-us/library/z8h19c37
>
>
>> As I've tested, free() didn't seem to resolve to _free_dbg on Windows
>> Server
>> 2008 + VS2010, or on Windows Server 2012 + VS2012.
>> The installed httpd-2.4.3 binaries just can not run if the code is not
>> changed. So please verify why that could happen.

No clue here, I'd naively assume some build or compiler bug. Any help
would be appreciated.

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.