> 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 >
In utils.c there is the sanitize_args function that "should" a place for this kind of checks. Feel free to extend it. By the way a prefer something like: if (uwsgi.numproc <= 0) uwsgi.numproc = 1; Regarding strtol i will for sure add a macro to translate atoi to it or i will introduce a uwsgi_strtoi to the uwsgi c api -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
