Professional Web Applications Themes

#26494 [Opn->Fbk]: mod_php4 fails Timeout setting while writing to a dead client on Apache 1.3 - PHP Development

ID: 26494 Updated by: net Reported By: hexer at studentcenter dot org -Status: Open +Status: Feedback Bug Type: Apache related Operating System: Linux PHP Version: 4.3.4 New Comment: Can not reproduce. Please provide the process & script to easily reproduce this. Also the configure line used to configure PHP is required. Previous Comments: ------------------------------------------------------------------------ [2003-12-01 17:58:25] hexer at studentcenter dot org Description: ------------ Problem: On Apache 1.3.x, the compiled-in mod_php4 will cause stuck httpd processes while trying to send output from php to a dead client connection. The Cause: mod_php4.c does not set the Apache Timeout timer in the send ...

  1. #1

    Default #26494 [Opn->Fbk]: mod_php4 fails Timeout setting while writing to a dead client on Apache 1.3

    ID: 26494
    Updated by: net
    Reported By: hexer at studentcenter dot org
    -Status: Open
    +Status: Feedback
    Bug Type: Apache related
    Operating System: Linux
    PHP Version: 4.3.4
    New Comment:

    Can not reproduce. Please provide the process & script to easily
    reproduce this. Also the configure line used to configure PHP is
    required.



    Previous Comments:
    ------------------------------------------------------------------------

    [2003-12-01 17:58:25] hexer at studentcenter dot org

    Description:
    ------------
    Problem: On Apache 1.3.x, the compiled-in mod_php4 will cause stuck
    httpd processes while trying to send output from php to a dead client
    connection.

    The Cause: mod_php4.c does not set the Apache Timeout timer in the send
    functions.

    Solution: Apache recommends any modules that write to the client to use
    the timeout functions provided by the Apache API.

    The following modification to mod_php4.c will fix the problem and make
    mod_php4 comply with Apache 1.3.x Timeout setting.


    static int sapi_apache_ub_write(const char *str, uint str_length
    TSRMLS_DC)
    {
    int ret=0;

    if (SG(server_context)) {

    + ap_hard_timeout("php send body", (request_rec *)
    SG(server_context));

    ret = rwrite(str, str_length, (request_rec *)
    SG(server_context));

    + ap_kill_timeout((request_rec *) SG(server_context));

    }
    if (ret != str_length) {
    php_handle_aborted_connection();
    }
    return ret;
    }


    Reproduce code:
    ---------------
    This problem is easilly reproduced by simply breaking the connection
    with the server while trying to load any php-generated page.

    Expected result:
    ----------------
    Apache process must abort processing the request if a single write
    operation exceeds the amount of seconds set in the Timeout setting in
    httpd.conf.

    Actual result:
    --------------
    #0 0x420d368d in writev () from /lib/i686/libc.so.6
    #1 0x0815fb08 in writev_it_all ()
    #2 0x0815fe77 in large_write ()
    #3 0x0815ff3b in ap_bwrite ()
    #4 0x08172c10 in ap_rwrite ()
    #5 0x080884da in sapi_apache_ub_write ()
    #6 0x0809ab6f in php_ub_body_write_no_header (
    str=0x86484ec ""..., str_length=4144) at
    /usr/local/src/php-4.3.4/main/output.c:689
    #7 0x0809a117 in php_end_ob_buffer (send_buffer=1 '\001', just_flush=1
    '\001')
    at /usr/local/src/php-4.3.4/main/output.c:299
    #8 0x0809ab39 in php_b_body_write (
    str=0x8666834 "",
    str_length=51) at /usr/local/src/php-4.3.4/main/output.c:616
    #9 0x08099dd2 in php_body_write (
    str=0x8666834 "",
    str_length=51) at /usr/local/src/php-4.3.4/main/output.c:121
    #10 0x080abe89 in zend_print_zval_ex (
    write_func=0x808ef40 <php_body_write_wrapper>, expr=0x85992ac,
    indent=0)
    at /usr/local/src/php-4.3.4/Zend/zend.c:211
    #11 0x080abe2f in zend_print_zval (expr=0x85992ac, indent=0)
    at /usr/local/src/php-4.3.4/Zend/zend.c:192
    ---Type <return> to continue, or q <return> to quit---
    #12 0x080abb70 in zend_print_variable (var=0x85992ac)
    at /usr/local/src/php-4.3.4/Zend/zend_variables.c:147
    #13 0x080b64b5 in execute (op_array=0x8642fac)
    at /usr/local/src/php-4.3.4/Zend/zend_execute.c:1244
    #14 0x080b8635 in execute (op_array=0x862bf24)
    at /usr/local/src/php-4.3.4/Zend/zend_execute.c:2181
    #15 0x080acc03 in zend_execute_scripts (type=8, retval=0x0,
    file_count=3)
    at /usr/local/src/php-4.3.4/Zend/zend.c:884
    #16 0x0808ffb3 in php_execute_script (primary_file=0xbffff650)
    at /usr/local/src/php-4.3.4/main/main.c:1729
    #17 0x080ba6e2 in apache_php_module_main (r=0x8256564,
    display_source_mode=0)
    at /usr/local/src/php-4.3.4/sapi/apache/sapi_apache.c:54
    #18 0x08089038 in send_php ()
    #19 0x080890a3 in send_pd_php ()
    #20 0x0816109c in ap_invoke_handler ()
    #21 0x08175b1f in process_request_internal ()
    #22 0x08175b7e in ap_process_request ()
    #23 0x0816cd55 in child_main ()
    #24 0x0816cfb6 in make_child ()
    #25 0x0816d2f5 in perform_idle_server_maintenance ()
    #26 0x0816d914 in standalone_main ()
    #27 0x0816df1a in main ()
    #28 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6


    ------------------------------------------------------------------------


    --
    Edit this bug report at http://bugs.php.net/?id=26494&edit=1
    sniper@php.net Guest

  2. Moderated Post

    Default #26494 [Opn->Fbk]: mod_php4 fails Timeout setting while writing to a dead client on Apache 1.3

    Removed by Administrator
    iliaa@php.net Guest
    Moderated Post

  3. Moderated Post

    Default #26494 [Opn->Fbk]: mod_php4 fails Timeout setting while writing to a dead client on Apache 1.3

    Removed by Administrator
    iliaa@php.net Guest
    Moderated Post

Similar Threads

  1. Dead keys in mysql-client.
    By s. keeling in forum MySQL
    Replies: 0
    Last Post: November 13th, 03:08 AM
  2. Timeout setting not working
    By tomp in forum Coldfusion Server Administration
    Replies: 4
    Last Post: August 18th, 03:09 PM
  3. cfquery, timeout attribute and cfserver timeout setting
    By Telix in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: July 1st, 03:42 PM
  4. No Apache TimeOut with mod_php
    By Eran Tromer in forum PHP Development
    Replies: 0
    Last Post: July 17th, 08:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139