[PHP-CVS] Re: [PHP-DEV] Re: this causes a segfault cvs: php-src(PHP_4_3) /ext/pcre config.m4 php_pcre.c
On Thu, 10 Jul 2003, Jani Taskinen wrote: Fixed in CVS now. :) What did you fix exactly and where? I don't see it. -Andrei -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: [PHP-DEV] Re: this causes a segfault cvs: php-src(PHP_4_3) /ext/pcreconfig.m4 php_pcre.c
He added a decleration for pcre_* in the wrappers eg. #define pcre_x php_pcre_ as apache2 uses pcre internally As far as I could tell though it still segfauts after that change... - although not had a chance to test it recently.. Regards Alan Andrei Zmievski wrote: On Thu, 10 Jul 2003, Jani Taskinen wrote: Fixed in CVS now. :) What did you fix exactly and where? I don't see it. -Andrei -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: [PHP-DEV] Re: this causes a segfault cvs: php-src(PHP_4_3)
Jani Taskinen wrote: Fixed in CVS now. :) nice try:) - something as simple as this still kills it.. ? echo preg_match('/abc/','fredabc',$matches); ? Regards Alan --Jani On Thu, 10 Jul 2003, Alan Knowles wrote: @@ -420,7 +421,32 @@ size_offsets = num_subpats * 3; offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - /* Allocate match sets array and initialize the values */ + /* +* Build a mapping from subpattern numbers to their names. We will always +* allocate the table, even though they may be no named subpatterns. This +* avoids somewhat more complicated logic in the inner loops. +*/ + subpat_names = (char **)safe_emalloc(num_subpats, sizeof(char *), 0); + memset(subpat_names, 0, sizeof(char *) * num_subpats); + { + int name_cnt, name_size, ni = 0; + char *name_table; + unsigned short name_idx; + + pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, name_cnt); + if (name_cnt 0) { + pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, name_table); + pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, name_size); + + while (ni++ name_cnt) { + name_idx = 0xff * name_table[0] + name_table[1]; + subpat_names[name_idx] = name_table + 2; I'm getting name_idx = 23078, sizeof(subpat_names) = 4 here. backing out the patch solves the problem (sorry I've no idea what the code causing the problem is - it's part of a huge app...) Regards Alan + name_table += name_size; + } + } + } + + /* Allocate match sets array and initialize the values. */ if (global subpats_order == PREG_PATTERN_ORDER) { match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); for (i=0; inum_subpats; i++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: [PHP-DEV] Re: this causes a segfault cvs: php-src(PHP_4_3)
5.0.0b2-dev int(1) int(1) array(1) { [0]= string(3) abc } pre ?php echo phpversion(), br\n; var_dump(preg_match('/php/i','PHP is the web scripting language of choice.')); var_dump(preg_match('/abc/','fredabc',$matches)); var_dump($matches); show_source('pcre.php'); ? pre Aka. BULLSHIT. --Jani p.s. Fix your build. On Sat, 12 Jul 2003, Alan Knowles wrote: Jani Taskinen wrote: Fixed in CVS now. :) nice try:) - something as simple as this still kills it.. ? echo preg_match('/abc/','fredabc',$matches); ? Regards Alan --Jani On Thu, 10 Jul 2003, Alan Knowles wrote: @@ -420,7 +421,32 @@ size_offsets = num_subpats * 3; offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - /* Allocate match sets array and initialize the values */ + /* +* Build a mapping from subpattern numbers to their names. We will always +* allocate the table, even though they may be no named subpatterns. This +* avoids somewhat more complicated logic in the inner loops. +*/ + subpat_names = (char **)safe_emalloc(num_subpats, sizeof(char *), 0); + memset(subpat_names, 0, sizeof(char *) * num_subpats); + { + int name_cnt, name_size, ni = 0; + char *name_table; + unsigned short name_idx; + + pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, name_cnt); + if (name_cnt 0) { + pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, name_table); + pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, name_size); + + while (ni++ name_cnt) { + name_idx = 0xff * name_table[0] + name_table[1]; + subpat_names[name_idx] = name_table + 2; I'm getting name_idx = 23078, sizeof(subpat_names) = 4 here. backing out the patch solves the problem (sorry I've no idea what the code causing the problem is - it's part of a huge app...) Regards Alan + name_table += name_size; + } + } + } + + /* Allocate match sets array and initialize the values. */ if (global subpats_order == PREG_PATTERN_ORDER) { match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); for (i=0; inum_subpats; i++) { -- https://www.paypal.com/xclick/[EMAIL PROTECTED]no_note=1tax=0currency_code=EUR -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: [PHP-DEV] Re: this causes a segfault cvs: php-src(PHP_4_3)
it's a PHP_4_3 with apache2filter - clean checkout. eg. rm php-src;cvs co Regards Alan Jani Taskinen wrote: 5.0.0b2-dev int(1) int(1) array(1) { [0]= string(3) abc } pre ?php echo phpversion(), br\n; var_dump(preg_match('/php/i','PHP is the web scripting language of choice.')); var_dump(preg_match('/abc/','fredabc',$matches)); var_dump($matches); show_source('pcre.php'); ? pre Aka. BULLSHIT. --Jani p.s. Fix your build. On Sat, 12 Jul 2003, Alan Knowles wrote: Jani Taskinen wrote: Fixed in CVS now. :) nice try:) - something as simple as this still kills it.. ? echo preg_match('/abc/','fredabc',$matches); ? Regards Alan --Jani On Thu, 10 Jul 2003, Alan Knowles wrote: @@ -420,7 +421,32 @@ size_offsets = num_subpats * 3; offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); - /* Allocate match sets array and initialize the values */ + /* + * Build a mapping from subpattern numbers to their names. We will always + * allocate the table, even though they may be no named subpatterns. This + * avoids somewhat more complicated logic in the inner loops. + */ + subpat_names = (char **)safe_emalloc(num_subpats, sizeof(char *), 0); + memset(subpat_names, 0, sizeof(char *) * num_subpats); + { + int name_cnt, name_size, ni = 0; + char *name_table; + unsigned short name_idx; + + pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, name_cnt); + if (name_cnt 0) { + pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, name_table); + pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, name_size); + + while (ni++ name_cnt) { +name_idx = 0xff * name_table[0] + name_table[1]; +subpat_names[name_idx] = name_table + 2; I'm getting name_idx = 23078, sizeof(subpat_names) = 4 here. backing out the patch solves the problem (sorry I've no idea what the code causing the problem is - it's part of a huge app...) Regards Alan +name_table += name_size; + } + } + } + + /* Allocate match sets array and initialize the values. */ if (global subpats_order == PREG_PATTERN_ORDER) { match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); for (i=0; inum_subpats; i++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: [PHP-DEV] Re: this causes a segfault cvs: php-src(PHP_4_3)/ext/pcre config.m4 php_pcre.c
Fixed in CVS now. :) --Jani On Thu, 10 Jul 2003, Alan Knowles wrote: @@ -420,7 +421,32 @@ size_offsets = num_subpats * 3; offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0); -/* Allocate match sets array and initialize the values */ +/* + * Build a mapping from subpattern numbers to their names. We will always + * allocate the table, even though they may be no named subpatterns. This + * avoids somewhat more complicated logic in the inner loops. + */ +subpat_names = (char **)safe_emalloc(num_subpats, sizeof(char *), 0); +memset(subpat_names, 0, sizeof(char *) * num_subpats); +{ +int name_cnt, name_size, ni = 0; +char *name_table; +unsigned short name_idx; + +pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, name_cnt); +if (name_cnt 0) { +pcre_fullinfo(re, extra, PCRE_INFO_NAMETABLE, name_table); +pcre_fullinfo(re, extra, PCRE_INFO_NAMEENTRYSIZE, name_size); + +while (ni++ name_cnt) { +name_idx = 0xff * name_table[0] + name_table[1]; +subpat_names[name_idx] = name_table + 2; I'm getting name_idx = 23078, sizeof(subpat_names) = 4 here. backing out the patch solves the problem (sorry I've no idea what the code causing the problem is - it's part of a huge app...) Regards Alan +name_table += name_size; +} +} +} + +/* Allocate match sets array and initialize the values. */ if (global subpats_order == PREG_PATTERN_ORDER) { match_sets = (zval **)safe_emalloc(num_subpats, sizeof(zval *), 0); for (i=0; inum_subpats; i++) { -- https://www.paypal.com/xclick/[EMAIL PROTECTED]no_note=1tax=0currency_code=EUR -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php