Two other things which may help:
First, I've tried applying the following patch to master.c, but it didn't
seem to help (I don't know why, I was certain it's the close which causes
libdispatch to crash):
diff -r a5f13497b392 master.c
--- a/master.c  Wed Apr 06 09:29:46 2011 +0200
+++ b/master.c  Sun Apr 10 22:35:57 2011 +0300
@@ -429,6 +429,18 @@
                                                break;
                                        }
                                }
+#ifdef __APPLE__
+                if (!found) {
+                    struct sockaddr_un address;
+                    socklen_t address_len = sizeof(struct sockaddr_un);
+                    if (!getsockname(i, (struct sockaddr *)(&address),
&address_len)) {
+                        if (address.sun_family == PF_UNIX) {
+                            uwsgi_log("skipping fd %d\n", i);
+                            found = 1;
+                        }
+                    }
+                }
+#endif

                                if (!found) {
                                        if (uwsgi.has_emperor) {

Second, I'm attaching the full contents of the crash report
(uwsgi_2011-04-10-221903_host.crash).
Again, it seems like the close() of file descriptions is the culprit, so why
didn't my patch help?

 - Yaniv


On Sun, Apr 10, 2011 at 9:58 PM, Yaniv Aknin <[email protected]> wrote:

> No, I used either brew (https://github.com/mxcl/homebrew) or download
> latest source and 'python uwsgiconfig.py --build'.
>
>  - Yaniv
>
>
> On Sun, Apr 10, 2011 at 7:25 PM, Roberto De Ioris <[email protected]>wrote:
>
>>
>> > Hi,
>> >
>> > I'm using uWSGI 0.9.7.2 on MacOS 10.6.7. When I try to gracefully reload
>> > the
>> > code of my workers using SIGHUP, I get the following output from uWSGI:
>> >     <some output snipped>
>> >     binary reloading uWSGI...
>> >     closing all non-uwsgi socket fds > 2 (_SC_OPEN_MAX = 2560)...
>> >     found fd 18 mapped to socket 0 (/tmp/audish/uwsgi.sock)
>> >     <no more output beyond this point>
>> >
>> > ...and then the process hangs. In /var/log/system.log, these lines
>> appear:
>> >     Apr 10 18:47:38 host /usr/local/bin/uwsgi[25911]: BUG in
>> libdispatch:
>> > 10J869 - 1986 - 0x4    Apr 10 18:47:40 host ReportCrash[25939]: Saved
>> > crash
>> > report for uwsgi[25911] version ??? (???) to
>> >
>> /Users/user/Library/Logs/DiagnosticReports/uwsgi_2011-04-10-184740_host.crash
>> >
>> > And in
>> >
>> /Users/user/Library/Logs/DiagnosticReports/uwsgi_2011-04-10-184740_host.crash,
>> > the most important line (I believe) is:
>> >     Application Specific Information:
>> >     BUG IN CLIENT OF LIBDISPATCH: Do not close random Unix descriptors
>> > I'm fairly convinced that the socket closing code in master.py should be
>> > modified so as not to upset libdispatch, but I'm still not entirely sure
>> > how
>> > to go about doing it (maybe I'll play with it more and see if I can find
>> a
>> > patch later today).
>> >
>> > Is this a known bug? Is there a known workaround? How can I assist in
>> > producing a fix?
>> >
>> > Cheers,
>> >  - Yaniv
>> >
>>
>> It looks your uWSGI is linked with libdispatch (and this is funny, as
>> uWSGI does not support it [for now]). Have you compiled it directly from
>> XCode ?
>>
>>
>> --
>> Roberto De Ioris
>> http://unbit.it
>> _______________________________________________
>> uWSGI mailing list
>> [email protected]
>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>>
>
>

Attachment: uwsgi_2011-04-10-221903_host.crash.gz
Description: GNU Zip compressed data

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to