Sorry about the last post.  This one is definately
plain text.

The good news is that I've distilled the problem down
to a one line change in my httpd.conf file.  

With the following line, Apache drops a core when
spawn_proc_prog() is called:
   PerlTransHandler  Apache::OK 
The above line causes the testcase in
t/apache/subprocess.t to drop a core.
It looks like *r is considerably less populated with
the added line, which means $r->filename is null when
it gets passed to ap_make_dirstr_parent().

It would be nice to be able to use this as it gets rid
of a _whole bunch_ of calls to stat.  I'm trying to
wring the last ounce of performance out of the sucker.
 :)

I've included a trace of *r from inside of
modperl_spawn_proc_prog() with and without the
PerlTransHandler line.


Stas Bekman wrote:
>
>> Understand re: cleanup_for_exec 
>> 
>> I read the Avoiding Zombies section and $SIG{CHLD}
= 'IGNORE' didn't work 
>> for me. I realize that I didn't try the waitpid()
example after the fork. 
>
> I suppose this varies from OS to OS :( 
>
> Was your suggestion different from the one in the
guide?

Yes - it's the only one I could get to work w/ Solaris
8.  It seems to be the POSIX options that do it. Also,
my version will find any child and reap if ready,
whereas the guide will only collect the specified pid.
 I'm doing a fork and exec, then the exec'd process
hangs around for 1-10 minutes so I have to be able to
reap anything that needs reaping.


Here's a (bad) *r with PerlTransHandler in httpd.conf:

(gdb) p *r
$9 = {pool = 0x30fdc50, connection = 0x30f3d48, server
= 0x115260, next = 0x0, 
  prev = 0x0, main = 0x0, the_request = 0x30fea90 "GET
/test/myfork HTTP/1.1", 
  assbackwards = 0, proxyreq = 0, header_only = 0, 
  protocol = 0x30feb18 "HTTP/1.1", proto_num = 1001, 
  hostname = 0x30ff258 "sfivrapp02.telebank.foo.com", 
  request_time = 1064437591906258, status_line = 0x0,
status = 200, 
  method = 0x30feae0 "GET", method_number = 0, allowed
= 0, 
  allowed_xmethods = 0x0, allowed_methods = 0x30fde10,
sent_bodyct = 0, 
  bytes_sent = 0, mtime = 0, chunked = 0, range = 0x0,
clength = 0, 
  remaining = 0, read_length = 0, read_body = 0,
read_chunked = 0, 
  expecting_100 = 0, headers_in = 0x30fde40,
headers_out = 0x30fe2d0, 
  err_headers_out = 0x30fe478, subprocess_env =
0x30fe088, notes = 0x30fe5d0, 
  content_type = 0x3101dc8 "text/plain", handler =
0x14b5a0 "modperl", 
  content_encoding = 0x0, content_languages = 0x0,
vlist_validator = 0x0, 
  user = 0x0, ap_auth_type = 0x0, no_cache = 0,
no_local_copy = 0, 
  unparsed_uri = 0x30feaf8 "/test/myfork", uri =
0x30feb08 "/test/myfork", 
  filename = 0x0, canonical_filename = 0x0, path_info
= 0x0, args = 0x0, 
  finfo = {pool = 0x0, valid = 0, protection = 0,
filetype = APR_NOFILE, 
    user = 0, group = 0, inode = 0, device = 0, nlink
= 0, size = 0, 
    csize = 0, atime = 0, mtime = 0, ctime = 0, fname
= 0x0, name = 0x0, 
    filehand = 0x0}, parsed_uri = {scheme = 0x0,
hostinfo = 0x0, user = 0x0, 
    password = 0x0, hostname = 0x0, port_str =
0x30ff288 "55555", 
    path = 0x30feb08 "/test/myfork", query = 0x0,
fragment = 0x0, 
    hostent = 0x0, port = 55555, is_initialized = 1,
dns_looked_up = 0, 
    dns_resolved = 0}, used_path_info = 2,
per_dir_config = 0x30ff308, 
  request_config = 0x30fe728, htaccess = 0x0,
output_filters = 0x30fea20, 
  input_filters = 0x30fe888, proto_output_filters =
0x30fea20, 
  proto_input_filters = 0x30fe888, eos_sent = 0}
(gdb) 


Here's a good one without PerlTransHandler:

(gdb) p *r
$1 = {pool = 0x312db38, connection = 0x3123c30, server
= 0x105a88, next = 0x0, 
  prev = 0x0, main = 0x0, the_request = 0x312e9b0 "GET
/test/myfork HTTP/1.1", 
  assbackwards = 0, proxyreq = 0, header_only = 0, 
  protocol = 0x312ea38 "HTTP/1.1", proto_num = 1001, 
  hostname = 0x312f178 "sfivrapp02.telebank.baz.com", 
  request_time = 1064521677613565, status_line = 0x0,
status = 200, 
  method = 0x312ea00 "GET", method_number = 0, allowed
= 0, 
  allowed_xmethods = 0x0, allowed_methods = 0x312dcf8,
sent_bodyct = 0, 
  bytes_sent = 0, mtime = 1061605162000000, chunked =
0, range = 0x0, 
  clength = 0, remaining = 0, read_length = 0,
read_body = 0, 
  read_chunked = 0, expecting_100 = 0, headers_in =
0x312dd28, 
  headers_out = 0x312e1b8, err_headers_out =
0x312e360, 
  subprocess_env = 0x312df70, notes = 0x312e4b8, 
  content_type = 0x3134038 "text/plain", handler =
0x175590 "modperl", 
  content_encoding = 0x0, content_languages = 0x0, 
  vlist_validator = 0x31300a0 "\"36929e80\"", user =
0x0, ap_auth_type = 0x0, 
  no_cache = 0, no_local_copy = 0, unparsed_uri =
0x312ea18 "/test/myfork", 
  uri = 0x312ea28 "/test/myfork", 
  filename = 0x312f920 "/ivruapp/htdocs.app/test", 
  canonical_filename = 0x312f920
"/ivruapp/htdocs.app/test", 
  path_info = 0x312f890 "/myfork", args = 0x0, finfo =
{pool = 0x312db38, 
    valid = 7598448, protection = 1877, filetype =
APR_NOFILE, user = 500, 
    group = 2057, inode = 50688, device = 30932997,
nlink = 2, size = 512, 
    csize = 51567416, atime = 1064521128000000, mtime
= 1061605162000000, 
    ctime = 1061605162000000, fname = 0x312f920
"/ivruapp/htdocs.app/test", 
    name = 0x312df70 "\003\022Ø8", filehand =
0x312f288}, parsed_uri = {
    scheme = 0x0, hostinfo = 0x0, user = 0x0, password
= 0x0, hostname = 0x0, 
    port_str = 0x312f1a8 "55555", path = 0x312ea28
"/test/myfork", 
    query = 0x0, fragment = 0x0, hostent = 0x0, port =
55555, 
    is_initialized = 1, dns_looked_up = 0,
dns_resolved = 0}, 
  used_path_info = 2, per_dir_config = 0x31442c0,
request_config = 0x312e610, 
  htaccess = 0x0, output_filters = 0x312e940,
input_filters = 0x312e7a8, 
  proto_output_filters = 0x312e940,
proto_input_filters = 0x312e7a8, 
  eos_sent = 0}
(gdb) 


Hope this helps.

Thanks,
Scot

Reply via email to