You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2002/04/07 03:04:31 UTC
DO NOT REPLY [Bug 7804] New: -
MPM perchild fail on start (Unable to find process with matching uid/gid)
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7804>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7804
MPM perchild fail on start (Unable to find process with matching uid/gid)
Summary: MPM perchild fail on start (Unable to find process with
matching uid/gid)
Product: Apache httpd-2.0
Version: 2.0.35
Platform: PC
OS/Version: FreeBSD
Status: NEW
Severity: Critical
Priority: Other
Component: Modules
AssignedTo: bugs@httpd.apache.org
ReportedBy: maxes2@chat.ru
In httdp.conf :
...
ChildperUserID test1 test1 1
ChildperUserID test2 test2 2
ChildperUserID test3 test3 3
<VirtualHost 10.0.1.1>
ServerAdmin x@y.z
DocumentRoot /usr/local/apache2/htdocs/test
ServerName h11.test
ErrorLog /dev/null
CustomLog /dev/null common
AssignUserID test1 test1
</VirtualHost>
...
other virtual host sections
On start apache say:
Syntax error on line 1064 of /usr/local/apache2/conf/httpd.conf:
Unable to find process with matching uid/gid.
/usr/local/apache2/bin/apachectl start: httpd could not be started
line 1064 in my case is "AssignUserID test1 test1"
Under gdb :
structure child_info_table fill not correct, imho.
(gdb) p child_info_table[0]
$23 = {uid = 1002, gid = 1002, sd = -1}
(gdb) p child_info_table[1]
$24 = {uid = 1002, gid = 1002, sd = -1}
(gdb) p child_info_table[2]
$25 = {uid = 1003, gid = 1003, sd = -1}
(gdb) p child_info_table[3]
$26 = {uid = 1003, gid = 1003, sd = -1}
(gdb) p child_info_table[4]
$27 = {uid = 1003, gid = 1003, sd = -1}
(gdb) p child_info_table[5]
$28 = {uid = 4294967295, gid = 4294967295, sd = -1}
(gdb) p child_info_table[6]
$29 = {uid = 4294967295, gid = 4294967295, sd = -1}
uid test1 is 1001, test2 = 1002, test3 = 1003
As You see, first element absent, but we have 2 1002 and 3 1003 member.
If don't use FIRST assignet uid/gid (1001/1001), then server start and some
child fork under SECOND uid/gid test2/test2 (1002/1002):
ps axuww| grep http | grep test2
test2 1127 0.0 1.2 14196 3100 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1128 0.0 1.2 16316 3164 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1132 0.0 1.2 16316 3164 ?? S 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1135 0.0 1.2 14196 3100 ?? S 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1136 0.0 1.2 16316 3164 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1140 0.0 1.2 14196 3100 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1141 0.0 1.2 16316 3164 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1145 0.0 1.2 14196 3100 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1146 0.0 1.2 16316 3164 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1150 0.0 1.2 14196 3100 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1151 0.0 1.2 16316 3164 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1155 0.0 1.2 14196 3100 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1156 0.0 1.2 16316 3164 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1160 0.0 1.2 14196 3100 ?? I 4:08 0:00.00
/usr/local/apache2/bin/httpd
test2 1174 0.0 1.2 16316 3164 ?? I 4:10 0:00.00
/usr/local/apache2/bin/httpd
But other child work from user test3, who present in "ChildperUserID", but
not assigned for any virtualhost.
I belive, that function set_child_per_uid() work incorrect.
See patch below (in first test all work):
--- server/mpm/perchild/perchild.c.orig Sun Apr 7 04:28:15 2002
+++ server/mpm/perchild/perchild.c Sun Apr 7 04:50:37 2002
@@ -1823,22 +1823,19 @@
const char *g, const char *num)
{
- int i;
- int max_this_time = atoi(num) + curr_child_num;
+ int curr_num = atoi(num);
- for (i = curr_child_num; i < max_this_time; i++, curr_child_num++) {
- child_info_t *ug = &child_info_table[i - 1];
-
- if (i > num_daemons) {
+ if (curr_num > num_daemons) {
return "Trying to use more child ID's than NumServers. Increase "
"NumServers in your config file.";
- }
-
- ug->uid = ap_uname2id(u);
- ug->gid = ap_uname2id(g);
+ }
+ {
+ child_info_t *ug = &child_info_table[curr_num-1];
+ ug->uid = ap_uname2id(u);
+ ug->gid = ap_uname2id(g);
#ifndef BIG_SECURITY_HOLE
- if (ug->uid == 0 || ug->gid == 0) {
+ if (ug->uid == 0 || ug->gid == 0) {
return "Assigning root user/group to a child.";
- }
+ }
#endif
}