expected behavior of --with-debug

Maxim Dounin mdounin at mdounin.ru
Wed Apr 9 15:33:18 UTC 2014


Hello!

On Wed, Apr 09, 2014 at 10:51:24AM -0400, Jeff Kaufman wrote:

> In ngx_pagespeed we interpret --with-debug to mean "include debugging
> symbols and debug-only assertions".  Is this what most people using
> nginx would expect?
> 
> (We distribute two precompiled versions of PSOL, "debug" and
> "release", and we've been using --with-debug to switch between them.
> Now we're wondering if this is an abuse of that flag, and if we should
> instead add our own flag to specify which precompiled version to use.)

The --with-debug in nginx means "enable debug logging", which 
includes logging itself and in some cases some additional 
cleanup/tests to simplify debugging (e.g., ngx_queue_remove() will 
set prev/next pointers to NULL on the element it removes from 
queue).

Debug symbols are included by default for all supported compilers 
regardless of configure options.  If desired, they can be stripped 
later using strip(1).

Assertions as in assert(3) are not used in nginx.  In the 
event-based server it's not a good idea to call abort(), as it 
will affect multiple connections handled in the same process.  If 
needed for debugging, there is ngx_debug_point() which can be 
controlled using the debug_points directive, see 
http://nginx.org/r/debug_points.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list