0.8.35 compile error

Igor Sysoev igor at sysoev.ru
Tue Apr 6 16:39:07 MSD 2010


On Tue, Apr 06, 2010 at 04:17:01PM +0400, Maxim Dounin wrote:

> Hello!
> 
> On Tue, Apr 06, 2010 at 03:46:33PM +0400, Igor Sysoev wrote:
> 
> > On Tue, Apr 06, 2010 at 02:06:39PM +0300, Reinis Rozitis wrote:
> > 
> > > > Looks like you are compiling nginx without http cache.
> > > > Try to apply the attached patch.
> > > 
> > > Correct and the patch fixed this issue ( as it looked some unrelated module didnt provide the full configure line 
> > > '--prefix=/data/nginx --with-http_image_filter_module --with-http_stub_status_module --with-http_secure_link_module --without-http-cache' 
> > >  )
> > > 
> > > But got another now at linking stage (appears in 0.8.35 as 0.8.34 with the patch is fine):
> > > 
> > > objs/src/os/unix/ngx_process.o: In function `ngx_process_get_status':
> > > /data/install/nginx-0.8.35/src/os/unix/ngx_process.c:490: warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' 
> > > instead
> > > /data/install/nginx-0.8.35/src/os/unix/ngx_process.c:490: warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
> > > make[1]: Leaving directory `/data/install/nginx-0.8.35'
> > 
> > Now this warning will always be issued on Linux: nginx has to use
> > sys_errlist[]/sys_nerr because both strerror() and strerror_r() are not
> > signal safe.
> 
> Have you considered handling signals in event loop instead (with 
> additional notification pipe if it's not supported by event 
> method)?

It complicates things: master process currently does not use event loop
at all, it waits in sigsuspend(). Besides, you have to use localtime_r()
and strerror_r() in signal handler anyway, becuse write() to pipe may fail.

> Alternatively it's probably good idea to just avoid logging error 
> strings from signal handlers instead of using sys_errlist.

Currently nginx does this on Solaris.
I do not see using sys_errlist[] as a big issue: if you look, for example,
FreeBSD's strerror() you will see that it uses sys_errlist[] too.


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list