Professional Web Applications Themes

#24557 [Fbk->Opn]: streams SIG_SEGVs - PHP Development

ID: 24557 User updated by: wmeler at wp-sa dot pl Reported By: wmeler at wp-sa dot pl -Status: Feedback +Status: Open Bug Type: Network related Operating System: RH 7.3 PHP Version: 4CVS-2003-07-09 (stable) New Comment: after turning on STREAMS_DEBUG I've got better core: #0 0x08088603 in _php_stream_free (stream=0x45c22290, close_options=11, tsrm_ls=0x8523d68) at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:294 #1 0x0808b12f in stream_resource_regular_dtor (rsrc=0x46c50910, tsrm_ls=0x8523d68) at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:2291 #2 0x080ad2e2 in list_entry_destructor (ptr=0x46c50910) at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:177 #3 0x080ab8e0 in zend_hash_del_key_or_index (ht=0x8862ccc, arKey=0x0, nKeyLength=0, h=5, flag=1) at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_hash.c:514 #4 0x080ad0a4 in _zend_list_delete (id=5, tsrm_ls=0x8523d68) at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:56 #5 0x080a5ac2 in _zval_dtor (zvalue=0x46c502d8, __zend_filename=0x8199080 "/home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute_API.c", __zend_lineno=291) at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_variables.c:69 #6 0x0809e27e in _zval_ptr_dtor ...

  1. #1

    Default #24557 [Fbk->Opn]: streams SIG_SEGVs

    ID: 24557
    User updated by: wmeler at wp-sa dot pl
    Reported By: wmeler at wp-sa dot pl
    -Status: Feedback
    +Status: Open
    Bug Type: Network related
    Operating System: RH 7.3
    PHP Version: 4CVS-2003-07-09 (stable)
    New Comment:

    after turning on STREAMS_DEBUG I've got better core:

    #0 0x08088603 in _php_stream_free (stream=0x45c22290,
    close_options=11, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:294
    #1 0x0808b12f in stream_resource_regular_dtor (rsrc=0x46c50910,
    tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:2291
    #2 0x080ad2e2 in list_entry_destructor (ptr=0x46c50910) at
    /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:177
    #3 0x080ab8e0 in zend_hash_del_key_or_index (ht=0x8862ccc, arKey=0x0,
    nKeyLength=0, h=5, flag=1)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_hash.c:514
    #4 0x080ad0a4 in _zend_list_delete (id=5, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:56
    #5 0x080a5ac2 in _zval_dtor (zvalue=0x46c502d8,
    __zend_filename=0x8199080
    "/home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute_API.c",
    __zend_lineno=291)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_variables.c:69
    #6 0x0809e27e in _zval_ptr_dtor (zval_ptr=0x45c01010,
    __zend_filename=0x8195c60
    "/home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute.h",
    __zend_lineno=96)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute_API.c:291
    #7 0x080bbcbd in execute (op_array=0x429d5ee0, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute.h:96

    The function called from PHP userspace was fclose.
    I also found in log 1069 msg looks like:

    stream_alloc: socket:0x43d64f08 persistent=(null)

    and only 48 msg pairs like:

    stream_free: socket:0x4849caf8[(null)] in_free=0 opts=00000003
    stream_free: socket:0x4849caf8[(null)] preserve_handle=0 release_cast=1
    remove_rsrc=1

    I also got about 40 core dumps.

    If you want more information please describe what kind of information
    you want.


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

    [2003-07-09 03:32:34] [email]wezphp.net[/email]

    Not enough information was provided for us to be able
    to handle this bug. Please re-read the instructions at
    [url]http://bugs.php.net/how-to-report.php[/url]

    If you can provide more information, feel free to add it
    to this bug and change the status back to "Open".

    Thank you for your interest in PHP.


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

    [2003-07-09 03:12:09] wmeler at wp-sa dot pl

    Description:
    ------------
    My application uses fsockopen. Since streams has been introduced I
    notice SIG_SEGVs. As you can see below stack is corrupted and stream
    memory is freed (if it is really it's memory)


    (gdb) bt full
    #0 _php_stream_flush (stream=Error accessing memory address
    0xb71fd09c: No such process.
    ) at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:875
    stream = (php_stream *) 0x4a9ce250
    tsrm_ls = (void ***) 0x8779ef0
    ret = 0
    Error accessing memory address 0xb71fd094: No such process.
    (gdb) print *(php_stream *) 0x4a9ce250
    $1 = {ops = 0x4652c678, abstract = 0x1, filterhead = 0x10003,
    filtertail = 0x2a8fcc84,
    wrapper = 0x5a5a5a5a, wrapperthis = 0x3d, wrapperdata = 0x4e6a3ec0,
    fgetss_state = 135898848, is_persistent = 110,
    mode = "\001", '\000' <repeats 11 times>, ": \a", rsrc_id =
    1251795496, in_free = 1,
    fclose_stdiocast = 2, stdiocast = 0xcc840030, __exposed = 1515858575,

    __orig_path = 0x5a5a5a5a <Error reading address 0x5a5a5a5a: No such
    process>,
    context = 0x31, flags = 1279301096, position = 1185939604,
    readbuf = 0x5a5a5a5a <Error reading address 0x5a5a5a5a: No such
    process>,
    readbuflen = 1515870810, readpos = 1515870810, writepos = 1515870810,

    chunk_size = 1515870810, eof = 1515870810}



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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=24557&edit=1[/url]

    wmeler at wp-sa dot pl Guest

  2. #2

    Default #24557 [Fbk->Opn]: streams SIG_SEGVs

    ID: 24557
    User updated by: wmeler at wp-sa dot pl
    Reported By: wmeler at wp-sa dot pl
    -Status: Feedback
    +Status: Open
    Bug Type: Network related
    Operating System: RH 7.3
    PHP Version: 4CVS-2003-07-09 (stable)
    New Comment:

    PHP is taken from snaps.php.net : php4-STABLE-200307081130

    './configure' \
    '--with-thttpd=../thttpd' \
    '--enable-experimental-zts' \
    '--with-tsrm-pthreads' \
    '--with-regex=system' \
    '--with-mysql=/usr' \
    '--with-oci8=/opt/oracle' \
    '--with-ldap=/opt/iplanet' \
    '--with-mhash' \
    '--enable-ftp' \
    '--with-zlib' \
    '--with-gdbm' \
    '--with-gettext' \
    '--with-xml' \
    '--enable-debug' \
    "$"

    I've patched thttpd and PHP so it worked fine together in ZTS. I
    haven't touched streams. It worked until streams were introduced
    (4.3?).

    BTW are memory and fds freed if there is no msg in log like
    "stream_free ...."

    I think I won't be able to write short script which reproduct this
    error because it isn't on each request :(.


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

    [2003-07-09 04:39:52] [email]wezphp.net[/email]

    Thanks for the detailed trace;
    A short self-contained reproducing script would help a great deal here
    also.
    Also, it seems that you are running a thread-safe build; could you let
    us know the configure line you used, and also the version of PHP (are
    you really using the PHP_4_3 branch of cvs?).

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

    [2003-07-09 04:26:51] wmeler at wp-sa dot pl

    after turning on STREAMS_DEBUG I've got better core:

    #0 0x08088603 in _php_stream_free (stream=0x45c22290,
    close_options=11, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:294
    #1 0x0808b12f in stream_resource_regular_dtor (rsrc=0x46c50910,
    tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:2291
    #2 0x080ad2e2 in list_entry_destructor (ptr=0x46c50910) at
    /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:177
    #3 0x080ab8e0 in zend_hash_del_key_or_index (ht=0x8862ccc, arKey=0x0,
    nKeyLength=0, h=5, flag=1)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_hash.c:514
    #4 0x080ad0a4 in _zend_list_delete (id=5, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:56
    #5 0x080a5ac2 in _zval_dtor (zvalue=0x46c502d8,
    __zend_filename=0x8199080
    "/home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute_API.c",
    __zend_lineno=291)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_variables.c:69
    #6 0x0809e27e in _zval_ptr_dtor (zval_ptr=0x45c01010,
    __zend_filename=0x8195c60
    "/home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute.h",
    __zend_lineno=96)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute_API.c:291
    #7 0x080bbcbd in execute (op_array=0x429d5ee0, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute.h:96

    The function called from PHP userspace was fclose.
    I also found in log 1069 msg looks like:

    stream_alloc: socket:0x43d64f08 persistent=(null)

    and only 48 msg pairs like:

    stream_free: socket:0x4849caf8[(null)] in_free=0 opts=00000003
    stream_free: socket:0x4849caf8[(null)] preserve_handle=0 release_cast=1
    remove_rsrc=1

    I also got about 40 core dumps.

    If you want more information please describe what kind of information
    you want.

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

    [2003-07-09 03:32:34] [email]wezphp.net[/email]

    Not enough information was provided for us to be able
    to handle this bug. Please re-read the instructions at
    [url]http://bugs.php.net/how-to-report.php[/url]

    If you can provide more information, feel free to add it
    to this bug and change the status back to "Open".

    Thank you for your interest in PHP.


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

    [2003-07-09 03:12:09] wmeler at wp-sa dot pl

    Description:
    ------------
    My application uses fsockopen. Since streams has been introduced I
    notice SIG_SEGVs. As you can see below stack is corrupted and stream
    memory is freed (if it is really it's memory)


    (gdb) bt full
    #0 _php_stream_flush (stream=Error accessing memory address
    0xb71fd09c: No such process.
    ) at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:875
    stream = (php_stream *) 0x4a9ce250
    tsrm_ls = (void ***) 0x8779ef0
    ret = 0
    Error accessing memory address 0xb71fd094: No such process.
    (gdb) print *(php_stream *) 0x4a9ce250
    $1 = {ops = 0x4652c678, abstract = 0x1, filterhead = 0x10003,
    filtertail = 0x2a8fcc84,
    wrapper = 0x5a5a5a5a, wrapperthis = 0x3d, wrapperdata = 0x4e6a3ec0,
    fgetss_state = 135898848, is_persistent = 110,
    mode = "\001", '\000' <repeats 11 times>, ": \a", rsrc_id =
    1251795496, in_free = 1,
    fclose_stdiocast = 2, stdiocast = 0xcc840030, __exposed = 1515858575,

    __orig_path = 0x5a5a5a5a <Error reading address 0x5a5a5a5a: No such
    process>,
    context = 0x31, flags = 1279301096, position = 1185939604,
    readbuf = 0x5a5a5a5a <Error reading address 0x5a5a5a5a: No such
    process>,
    readbuflen = 1515870810, readpos = 1515870810, writepos = 1515870810,

    chunk_size = 1515870810, eof = 1515870810}



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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=24557&edit=1[/url]

    wmeler at wp-sa dot pl Guest

  3. #3

    Default #24557 [Fbk->Opn]: streams SIG_SEGVs

    ID: 24557
    User updated by: wmeler at wp-sa dot pl
    Reported By: wmeler at wp-sa dot pl
    -Status: Feedback
    +Status: Open
    Bug Type: Network related
    Operating System: RH 7.3
    PHP Version: 4CVS-2003-07-09 (stable)
    New Comment:

    I enable ZTS, because I use threads. I have one IO thread and more PHP
    threads. As I said, it isn't pure thttpd and PHP. My web server has
    quite nice architecture - I have queues, processors, queue overflow
    control etc.

    About configure parameters - I use the same compilation on another web
    aplications and it is working well. Difference is that they don't use
    socket streams. They use oci8 and ldap without any problems. As far I
    know oracle ldap functions doesn't perform well and we use iplanet
    libraries with success. No problems with that.

    I can reduce config.nice by only few modules (ftp zlib gdbm gettext
    xml). Others are needed by my app.

    Anyway - don't you think that these STREAM_DEBUG messages are strange?


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

    [2003-07-09 18:07:40] [email]sniperphp.net[/email]

    You should reduce the configure options to bare minimum,
    try with this configure line:

    # ./configure --with-thttpd=../thttpd --disable-all --enable-debug

    Why do you enable the ZTS anyway?
    Also, using --with-regex=system is not wise unless you
    REALLY know what you're doing. And Oracle has it's own ldap functions,
    it's known problem that those might conflict with other ldap libraries.
    Just point the --with-ldap to the same as you do with --with-oci8.




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

    [2003-07-09 04:55:39] wmeler at wp-sa dot pl

    PHP is taken from snaps.php.net : php4-STABLE-200307081130

    './configure' \
    '--with-thttpd=../thttpd' \
    '--enable-experimental-zts' \
    '--with-tsrm-pthreads' \
    '--with-regex=system' \
    '--with-mysql=/usr' \
    '--with-oci8=/opt/oracle' \
    '--with-ldap=/opt/iplanet' \
    '--with-mhash' \
    '--enable-ftp' \
    '--with-zlib' \
    '--with-gdbm' \
    '--with-gettext' \
    '--with-xml' \
    '--enable-debug' \
    "$"

    I've patched thttpd and PHP so it worked fine together in ZTS. I
    haven't touched streams. It worked until streams were introduced
    (4.3?).

    BTW are memory and fds freed if there is no msg in log like
    "stream_free ...."

    I think I won't be able to write short script which reproduct this
    error because it isn't on each request :(.

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

    [2003-07-09 04:39:52] [email]wezphp.net[/email]

    Thanks for the detailed trace;
    A short self-contained reproducing script would help a great deal here
    also.
    Also, it seems that you are running a thread-safe build; could you let
    us know the configure line you used, and also the version of PHP (are
    you really using the PHP_4_3 branch of cvs?).

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

    [2003-07-09 04:26:51] wmeler at wp-sa dot pl

    after turning on STREAMS_DEBUG I've got better core:

    #0 0x08088603 in _php_stream_free (stream=0x45c22290,
    close_options=11, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:294
    #1 0x0808b12f in stream_resource_regular_dtor (rsrc=0x46c50910,
    tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/main/streams.c:2291
    #2 0x080ad2e2 in list_entry_destructor (ptr=0x46c50910) at
    /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:177
    #3 0x080ab8e0 in zend_hash_del_key_or_index (ht=0x8862ccc, arKey=0x0,
    nKeyLength=0, h=5, flag=1)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_hash.c:514
    #4 0x080ad0a4 in _zend_list_delete (id=5, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_list.c:56
    #5 0x080a5ac2 in _zval_dtor (zvalue=0x46c502d8,
    __zend_filename=0x8199080
    "/home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute_API.c",
    __zend_lineno=291)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_variables.c:69
    #6 0x0809e27e in _zval_ptr_dtor (zval_ptr=0x45c01010,
    __zend_filename=0x8195c60
    "/home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute.h",
    __zend_lineno=96)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute_API.c:291
    #7 0x080bbcbd in execute (op_array=0x429d5ee0, tsrm_ls=0x8523d68)
    at /home/wmeler/rpm/BUILD/aris-1.6/php/Zend/zend_execute.h:96

    The function called from PHP userspace was fclose.
    I also found in log 1069 msg looks like:

    stream_alloc: socket:0x43d64f08 persistent=(null)

    and only 48 msg pairs like:

    stream_free: socket:0x4849caf8[(null)] in_free=0 opts=00000003
    stream_free: socket:0x4849caf8[(null)] preserve_handle=0 release_cast=1
    remove_rsrc=1

    I also got about 40 core dumps.

    If you want more information please describe what kind of information
    you want.

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

    [2003-07-09 03:32:34] [email]wezphp.net[/email]

    Not enough information was provided for us to be able
    to handle this bug. Please re-read the instructions at
    [url]http://bugs.php.net/how-to-report.php[/url]

    If you can provide more information, feel free to add it
    to this bug and change the status back to "Open".

    Thank you for your interest in PHP.


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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/24557[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=24557&edit=1[/url]

    wmeler at wp-sa dot pl Guest

Similar Threads

  1. #24557 [Opn->Csd]: streams SIG_SEGVs
    By iliaa@php.net in forum PHP Development
    Replies: 0
    Last Post: July 28th, 07:01 PM
  2. #24557 [WFx->Csd]: streams SIG_SEGVs
    By iliaa@php.net in forum PHP Development
    Replies: 0
    Last Post: July 27th, 06:46 PM
  3. #24557 [Opn->Asn]: streams SIG_SEGVs
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: July 10th, 01:48 PM
  4. #24557 [Opn->Fbk]: streams SIG_SEGVs
    By wez@php.net in forum PHP Development
    Replies: 2
    Last Post: July 9th, 11:07 PM
  5. #24557 [NEW]: streams SIG_SEGVs
    By wmeler at wp-sa dot pl in forum PHP Development
    Replies: 0
    Last Post: July 9th, 08:12 AM

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