Nginx 1.0.5 in windows heap corruption

hydra nginx-forum at nginx.us
Mon Aug 22 01:58:19 UTC 2011


Igor Sysoev Wrote:
-------------------------------------------------------
> On Sun, Aug 21, 2011 at 12:07:06PM -0400, hydra
> wrote:
> > Hi,
> >    When I use Nginx 1.0.5 in WINDOWS, It message
> a box with information
> > that is heap corruption.
> >    I use Visual Studio to debug it and find that
> in
> > src/os/win32/ngx_file.c line 224
> ngx_win32_rename_file() . 
> >    When I do like this:
> >   
> >   ngx_err_t
> > ngx_win32_rename_file(ngx_str_t *from, ngx_str_t
> *to, ngx_log_t *log)
> > {
> >     u_char             *name;
> >     ngx_err_t           err;
> >     ngx_uint_t          collision;
> >     ngx_atomic_uint_t   num;
> >     size_t              size;
> > 
> >     size = to->len + 1 + 10 + 1 +
> sizeof("DELETE") + 1;
> > 
> >     name = ngx_alloc(size, log);
> >     if (name == NULL) {
> >         return NGX_ENOMEM;
> >     }
> > 
> >     ngx_memzero(name,size);
> > 
> >     ngx_memcpy(name, to->data, to->len);
> > 
> >     ...
> >    ....
> >   }
> > 
> >  It run OK..
> 
> ngx_memzero() is useless here.
> Have you built in 64-bit mode ?
> 
> 
> -- 
> Igor Sysoev
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

Yes, I built in 64-bit mode.But I use Visual Studio 2008 32-bit.So...

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214106,214121#msg-214121



More information about the nginx mailing list