Professional Web Applications Themes

#27011 [Opn]: Seg Fault During preg_match_all - PHP Development

Removed by Administrator...

  1. Moderated Post

    Default #27011 [Opn]: Seg Fault During preg_match_all

    Removed by Administrator
    ehicks Guest
    Moderated Post

  2. #2

    Default #27011 [Opn]: Seg Fault During preg_match_all

    ID: 27011
    User updated by: ehicks at binarymagi dot com
    Reported By: ehicks at binarymagi dot com
    Status: Open
    Bug Type: PCRE related
    Operating System: Solaris 9
    PHP Version: 4CVS-2004-01-23
    New Comment:

    Adding -DNO_RECURSE to PHP's compile didn't help either.


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

    [2004-01-26 22:23:20] ehicks at binarymagi dot com

    Actually, it is. That configure line has been updated since I posted
    it. ldd shows that the new module is indeed using the libpcre from
    /usr/local/lib.

    I added the no_recurse to the PCRE build, though, not PHP. That's why
    I asked. I will try it in PHP and see what happens.

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

    [2004-01-26 21:38:41] net

    You're missing the point: PHP is NOT using your external build PCRE
    lib! (given your configure line you added in your report)

    Try this for PHP:

    # rm config.cache ; CFLAGS=-DNO_RECURSE ./configure --disable-all
    --disable-cgi --with-pcre-regex && make

    Then try your script with the sapi/cli/php


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

    [2004-01-26 20:44:27] ehicks at binarymagi dot com

    Added -DNO_RECURSE to PCRE's CFLAGS and it's still no-go. Same
    segfault, same gdb backtrace. You did mean to put no_recurse into the
    PCRE compile and not the PHP compile, right? Very frusterated, I
    managed to bypass the feature of IMP that was causing the problem so
    it's no longer inhibiting my progress. (It'd still be nice to get it
    working, though.)

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

    [2004-01-26 19:52:21] net

    Regarding the LD_LIBRARY_PATH thing..PHP's configure does add the L/R
    switches. You don't need to do that. :)

    And about the PCRE prob..try adding -DNO_RECURSE into CFLAGS. (there is
    no configure option for this..special thingie. :)

    grep for NO_RECURSE in the pcre sources to see what it does..


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

    [2004-01-26 18:33:17] ehicks at binarymagi dot com

    Just in case it helps, here's my uname as well.

    [rootlurch root]# uname -a
    SunOS lurch 5.9 Generic_112233-11 sun4u sparc SUNW,Ultra-250

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

    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
    http://bugs.php.net/27011

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

  3. #3

    Default #27011 [Opn]: Seg Fault During preg_match_all

    ID: 27011
    User updated by: ehicks at binarymagi dot com
    Reported By: ehicks at binarymagi dot com
    Status: Open
    Bug Type: PCRE related
    Operating System: Solaris 9
    PHP Version: 4CVS-2004-01-23
    New Comment:

    No, but that's probably because that configure line doesn't have the
    --enable-debug in it. Let me recompile and see.


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

    [2004-01-27 16:51:23] ehicks at binarymagi dot com

    No, but that's probably because that configure line does have the
    --enable-debug in it. Let me recompile and see.

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

    [2004-01-27 04:11:02] net

    Is the gdb backtrace same (the first lines..) to the one you already
    have included here?


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

    [2004-01-26 23:30:13] ehicks at binarymagi dot com

    Yeah.

    [rootlurch cli]# ./php < crashphp.php
    Bus Error (core dumped)

    That's using:

    CFLAGS=-DNO_RECURSE ./configure --disable-all --disable-cgi
    --with-pcre-regex

    No idea what it's problem is. I can run more gdb tests on the core
    dump if you want.

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

    [2004-01-26 23:13:21] net

    Did you try with the configure line I gave?
    (don't forget also doing 'make clean' before 'make', I forgot that from
    it :)



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

    [2004-01-26 23:10:52] ehicks at binarymagi dot com

    Adding -DNO_RECURSE to PHP's compile didn't help either.

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

    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
    http://bugs.php.net/27011

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

  4. #4

    Default #27011 [Opn]: Seg Fault During preg_match_all

    ID: 27011
    User updated by: ehicks at binarymagi dot com
    Reported By: ehicks at binarymagi dot com
    Status: Open
    Bug Type: PCRE related
    Operating System: Solaris 9
    PHP Version: 4CVS-2004-01-23
    New Comment:

    Yeah, same thing as far as I can tell. I'll paste it again since it's
    a different configure and version from the original paste just in case
    it helps.

    [rootlurch cli]# gdb ./php
    GNU gdb 5.3
    Copyright 2002 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and
    you are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for
    details.
    This GDB was configured as "sparcv9-sun-solaris2"...
    (gdb) run < crashphp.php
    Starting program: /root/build/php4-STABLE-200401230430/sapi/cli/php <
    crashphp.php

    Program received signal SIGSEGV, Segmentation fault.
    0x000000010016e6cc in zend_p_arg_impl (arg=0x10031aa58,
    va=0xffffffff7fffead8, spec=0xffffffff7fffeaa8)
    at /root/build/php4-STABLE-200401230430/Zend/zend_API.c:259
    259 *p =
    Z_LVAL_PP(arg);
    (gdb) bt
    #0 0x000000010016e6cc in zend_p_arg_impl (arg=0x10031aa58,
    va=0xffffffff7fffead8, spec=0xffffffff7fffeaa8)
    at /root/build/php4-STABLE-200401230430/Zend/zend_API.c:259
    #1 0x000000010016f4f0 in zend_p_arg (arg_num=4, arg=0x10031aa58,
    va=0xffffffff7fffead8,
    spec=0xffffffff7fffeaa8, quiet=0) at
    /root/build/php4-STABLE-200401230430/Zend/zend_API.c:439
    #2 0x000000010016fad8 in zend_p_va_args (num_args=0,
    type_spec=0x10019875c "ll", va=0xffffffff7fffead8,
    flags=0) at
    /root/build/php4-STABLE-200401230430/Zend/zend_API.c:524
    #3 0x000000010016fec4 in zend_p_parameters (num_args=4,
    type_spec=0x100198758 "ssz|ll")
    at /root/build/php4-STABLE-200401230430/Zend/zend_API.c:551
    #4 0x0000000100038168 in php_pcre_match (ht=4,
    return_value=0x100326fe0, this_ptr=0x0, return_value_used=0,
    global=1) at
    /root/build/php4-STABLE-200401230430/ext/pcre/php_pcre.c:374
    #5 0x00000001000392b0 in zif_preg_match_all (ht=4,
    return_value=0x100326fe0, this_ptr=0x0, return_value_used=0)
    at /root/build/php4-STABLE-200401230430/ext/pcre/php_pcre.c:607
    #6 0x000000010018bdd8 in execute (op_array=0x100322570)
    at /root/build/php4-STABLE-200401230430/Zend/zend_execute.c:1616
    #7 0x000000010016d518 in zend_execute_scripts (type=8, retval=0x0,
    file_count=3)
    at /root/build/php4-STABLE-200401230430/Zend/zend.c:884
    #8 0x00000001001038d4 in php_execute_script
    (primary_file=0xffffffff7ffffa40)
    at /root/build/php4-STABLE-200401230430/main/main.c:1727
    #9 0x000000010019688c in main (argc=1, argv=0xffffffff7ffffb48)
    at /root/build/php4-STABLE-200401230430/sapi/cli/php_cli.c:820
    (gdb) print (char
    *)(executor_globals.function_state_ptr->function)->common.function_name
    $1 = 0x100198940 "preg_match_all"
    (gdb) frame 6
    #6 0x000000010018bdd8 in execute (op_array=0x100322570)
    at /root/build/php4-STABLE-200401230430/Zend/zend_execute.c:1616
    1616
    ((zend_internal_function *)
    EX(function_state).function)->handler(EX(opline)->extended_value,
    EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr,
    return_value_used TSRMLS_CC);
    (gdb)


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

    [2004-01-27 16:51:59] ehicks at binarymagi dot com

    No, but that's probably because that configure line doesn't have the
    --enable-debug in it. Let me recompile and see.

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

    [2004-01-27 16:51:23] ehicks at binarymagi dot com

    No, but that's probably because that configure line does have the
    --enable-debug in it. Let me recompile and see.

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

    [2004-01-27 04:11:02] net

    Is the gdb backtrace same (the first lines..) to the one you already
    have included here?


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

    [2004-01-26 23:30:13] ehicks at binarymagi dot com

    Yeah.

    [rootlurch cli]# ./php < crashphp.php
    Bus Error (core dumped)

    That's using:

    CFLAGS=-DNO_RECURSE ./configure --disable-all --disable-cgi
    --with-pcre-regex

    No idea what it's problem is. I can run more gdb tests on the core
    dump if you want.

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

    [2004-01-26 23:13:21] net

    Did you try with the configure line I gave?
    (don't forget also doing 'make clean' before 'make', I forgot that from
    it :)



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

    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
    http://bugs.php.net/27011

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

Similar Threads

  1. #27011 [Fbk->Opn]: Seg Fault During preg_match_all
    By ehicks in forum PHP Development
    Replies: 5
    Last Post: January 27th, 09:57 PM
  2. #27011 [Opn->Fbk]: Seg Fault During preg_match_all
    By sniper@php.net in forum PHP Development
    Replies: 4
    Last Post: January 27th, 09:17 AM
  3. #27011 [Opn->Fbk]: Seg Fault While View A Message In IMP
    By sniper@php.net in forum PHP Development
    Replies: 2
    Last Post: January 25th, 05:04 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