You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1996/06/18 18:50:59 UTC

New bug?

I'm stumped and am hoping that someone else may have some feedback here.

I have a module that is setting r->handler to another module and then
calling run_sub_req(r). I am then getting a SEGV in the SET_BYTES_SENT
macro being called from finalize_sub_req_protocol(). The backtrace
below shows that sub->main->bytes_sent cannot be accessed. I can't
quite figure out if something hasn't been initialized properly or what.
This is being called from mod_include where several sub_requests have
already been run.

#define SET_BYTES_SENT(r) \
  do { if (r->sent_bodyct) \
	  bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \
  } while (0)

void finalize_sub_req_protocol (request_rec *sub)
{
    SET_BYTES_SENT (sub->main);
} 


Breakpoint 2, finalize_sub_req_protocol (sub=0x176518) at http_protocol.c:526
526         SET_BYTES_SENT (sub->main);
(gdb) bt
#0  finalize_sub_req_protocol (sub=0x176518) at http_protocol.c:526
#1  0x33050 in run_sub_req (r=0x176518) at http_request.c:571
#2  0x47ff0 in handle_module ()
#3  0x49908 in send_parsed_content ()
#4  0x49b68 in send_parsed_file ()
#5  0x49bd4 in xbithack_handler ()
#6  0x30500 in invoke_handler (r=0x176518) at http_config.c:282
#7  0x336e4 in process_request_internal (r=0x176518) at http_request.c:765
#8  0x33ac4 in internal_redirect (new_uri=0x1764f0 "/index.html", r=0x1494f8)
    at http_request.c:853
#9  0x4c934 in handle_dir (r=0x1494f8) at mod_dir.c:807
#10 0x30500 in invoke_handler (r=0x1494f8) at http_config.c:282
#11 0x336e4 in process_request_internal (r=0x1494f8) at http_request.c:765
#12 0x33724 in process_request (r=0x1494f8) at http_request.c:774
#13 0x2c904 in child_main (child_num_arg=0) at http_main.c:1246
#14 0x2ca90 in make_child (server_conf=0x125440, child_num=0)
    at http_main.c:1281
#15 0x2d194 in standalone_main (argc=6, argv=0xeffffce4) at http_main.c:1444
#16 0x2d4b4 in main (argc=6, argv=0xeffffce4) at http_main.c:1533
(gdb) 
(gdb) p *sub
$34 = {pool = 0x175c18, connection = 0x149490, server = 0x137d28, next = 0x0, 
  prev = 0x1494f8, main = 0x0, the_request = 0x0, assbackwards = 0, 
  proxyreq = 0, header_only = 0, protocol = 0x1760e0 "HTTP/1.0", 
  proto_num = 0, hostname = 0x0, hostlen = 0, status_line = 0xe4180 "200 OK", 
  status = 200, method = 0x1760c8 "GET", method_number = 0, sent_bodyct = 1, 
  bytes_sent = 3489, headers_in = 0x175c40, headers_out = 0x1766b0, 
  err_headers_out = 0x175fd0, subprocess_env = 0x1766f0, notes = 0x176810, 
  content_type = 0x14dcd0 "text/html", handler = 0xefff74e8 "mod_counter", 
  content_encoding = 0x0, content_language = 0x0, no_cache = 0, 
  uri = 0x176638 "/index.html", 
  filename = 0x1768b0 "/www/docroot/global/fctinc.com/index.html", 
  path_info = 0x176948 "", args = 0x0, finfo = {st_dev = 8388608, st_pad1 = {
      0, 0, 0}, st_ino = 959789, st_mode = 33252, st_nlink = 1, st_uid = 1681, 
    st_gid = 1024, st_rdev = 0, st_pad2 = {0, 0}, st_size = 3489, st_pad3 = 0, 
    st_atim = {tv_sec = 835114526, tv_nsec = 470012000}, st_mtim = {
      tv_sec = 835072101, tv_nsec = 900009000}, st_ctim = {tv_sec = 835072101, 
      tv_nsec = 900009000}, st_blksize = 8192, st_blocks = 8, 
    st_fstype = "ufs", '\000' <repeats 12 times>, st_pad4 = {0, 0, 0, 0, 0, 0, 
      0, 0}}, per_dir_config = 0x1383b0, request_config = 0x176648, 
  htaccess = 0x176398}
(gdb) p *sub->main->sent_bodyct
Cannot access memory at address 0x48.
(gdb)