Hi,
Il 12/12/2010 15:56, Łukasz Wróblewski ha scritto:
/usr/sbin/uwsgi -s /tmp/uwsgi.sock -M -p-1 ....
throws: "Segmentation fault"
What is the sum makes sense because you can not have processes -1.
But perhaps a message.
I am writing this because I met on a case "-M -p0".
uWSGI started, have PID, but all request return 504.
When you can come in handy this configuration (ie without the workers)?
It may be better to limit the minimum value of the parameter -p to 1 and
give some message if it's wrong value.
Attached a band-aid patch that would refuse any worker value less than 1
that is the default value. BTW a lot more places require input validation.
Then what about switching from atoi to strtol? see
http://blog.mozilla.com/nnethercote/2009/03/13/atol-considered-harmful/
thanks,
riccardo
diff -r 2efa54d31e48 uwsgi.c
--- a/uwsgi.c Sun Dec 12 11:26:14 2010 +0100
+++ b/uwsgi.c Sun Dec 12 16:50:20 2010 +0100
@@ -1871,7 +1871,7 @@
uwsgi.vec_size = 4 + 1 + (4 * uwsgi.max_vars);
return 1;
case 'p':
- uwsgi.numproc = atoi(optarg);
+ uwsgi.numproc = atoi(optarg) > 0 ? atoi(optarg) : uwsgi.numproc;
return 1;
case 'r':
uwsgi.shared->options[UWSGI_OPTION_REAPER] = 1;
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi