It seems work fine, no segfault at strncpy so far, but still, a segfault
occurred in some where of pthread_cancel, and  i have not figure out how
does this happens yet , here is traceback may be help:

#0  0x0000003549c0b9dd in pthread_cancel () from /lib64/libpthread.so.0
#1  0x0000000000441ace in wait_for_threads ()
#2  0x0000000000441c97 in simple_goodbye_cruel_world ()
#3  0x000000000041f198 in uwsgi_close_request ()
#4  0x000000000043c96a in simple_loop_run ()
#5  0x0000003549c064a7 in start_thread () from /lib64/libpthread.so.0
#6  0x00000035490d3c2d in clone () from /lib64/libc.so.6


thanks for your work

2013/1/24 <[email protected]>

> Send uWSGI mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of uWSGI digest..."
>
>
> Today's Topics:
>
>    1. Re: is this a critical bug or what? (Roberto De Ioris)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 23 Jan 2013 20:34:35 +0100
> From: "Roberto De Ioris" <[email protected]>
> To: "uWSGI developers and users list" <[email protected]>
> Subject: Re: [uWSGI] is this a critical bug or what?
> Message-ID:
>         <[email protected]>
> Content-Type: text/plain;charset=utf-8
>
>
> > OK, after several days of investigation, it seems this problem probably
> > occurred because race condition between threads of the same workers, here
> > is my conclusion:
> >
> > "wsgi_req" which is a shared struct between threads of all the workers is
> > reset to zero in "uwsgi_destroy_request" or "uwsgi_close_request".
> > Unfortunately , in     "uwsgi_destroy_request" & "uwsgi_close_request" ,
> > pthread_setcancelstate is called before memset of wsgi_req, does this
> > implies that if an other thread calls pthread_cancel while reaching max
> > requests meanwhile, "wsgi_req" is vulnerable remains last value in the
> new
> > forked worker, since the new worker reusing shared memory of workers[i]
> > struct without zero-filled.
> >
> > Is there any chance to do with that?
> >
> > thanks~
> >
> > code:
> > ...
> > #ifdef UWSGI_THREADING
> > int foo;
> >  if (uwsgi.threads > 1) {
> > // now the thread can die...
> > pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &foo);
> >  }
> > #endif
> > memset(wsgi_req, 0, sizeof(struct wsgi_request));
> > ...
> >
> >
> > 2013/1/20 <[email protected]>
> >
> >> Re: is this a critical bug or what?
> > _______________________________________________
> > uWSGI mailing list
> > [email protected]
> > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
> >
>
>
> Can you confirm the bug is solved in latest 1.4 tree ?
>
> Thanks
>
> --
> Roberto De Ioris
> http://unbit.it
>
>
> ------------------------------
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
>
> End of uWSGI Digest, Vol 40, Issue 29
> *************************************
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to