<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=URI_Template</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/21113" />
      <rdf:li rdf:resource="http://pear.php.net/bug/18916" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/21113">
      <title>URI_Template: Bug 21113 [Open] %Angosso!!!%</title>
      <link>http://pear.php.net/bugs/21113</link>
      <content:encoded><![CDATA[<pre>URI_Template Bug
Reported by mbiama
2016-09-09T12:44:38+00:00
PHP: 5.6.25 OS:  /proc/sys/kernel/core_pattern Package Version: 0.3.3

Description:
------------
make sure the directory is writable by PHP
Set the ulimit (see above how to do it).
Restart/rerun PHP.
After that any process crashing in my system, including PHP, will leave its 
core file in the directory you've specified in core_pattern.


Test script:
---------------
Once you have the core file:

Run gdb with the path to the PHP or PHP-enabled httpd binary, and path to the core file. Some examples:
gdb /var/www/vhosts/angosso.net/apache/sbin/httpd /var/www/vhosts/angosso.net/apache/sbin/core
gdb /home/angosso.net/dev/php-snaps/sapi/cli/php /home/angosso.net/dev/testing/core
At the gdb prompt, run:
(gdb) bt
If you can't get a core file:

Run httpd -X under gdb with something like:
gdb /var/www/vhosts/angosso.net/apache/sbin/httpd
(gdb) run -X
Then use your web browser and access your server to force the crash. You should see a gdb prompt appear and some message indicating that there was a crash. At this gdb prompt, type:
(gdb) bt
or, running from the commandline
gdb /home/angosso.net/dev/php-snaps/sapi/cli/php
(gdb) run /var/www/vhosts/angosso.net/httpdocs/script.php
(gdb) bt
This should generate a backtrace, that you should submit in the bug report, along with any other details you can give us about your setup, and offending script.

Locating which function call caused a segfault:

You can locate the function call that caused a segfault, easily, with gdb. First, you need a core file or to generate a segfault under gdb as described above.

In PHP, each function is executed by an internal function called execute() and has its own stack. Each line generated by the bt command represents a function call stack. Typically, you will see several execute() lines when you issue bt. You are interested in the last execute() stack (i.e. smallest frame number). You can move the current working stack with the up, down or frame commands. Below is an example gdb session that can be used as a guideline on how to handle your segfault.

Sample gdb session

(gdb) bt
#0  0x080ca21b in _efree (ptr=0xbfffdb9b) at zend_alloc.c:240
#1  0x080d691a in _zval_dtor (zvalue=0x8186b94) at zend_variables.c:44
#2  0x080cfab3 in _zval_ptr_dtor (zval_ptr=0xbfffdbfc) at zend_execute_API.c:274
#3  0x080f1cc4 in execute (op_array=0x816c670) at ./zend_execute.c:1605
#4  0x080f1e06 in execute (op_array=0x816c530) at ./zend_execute.c:1638
#5  0x080f1e06 in execute (op_array=0x816c278) at ./zend_execute.c:1638
#6  0x080f1e06 in execute (op_array=0x8166eec) at ./zend_execute.c:1638
#7  0x080d7b93 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810
#8  0x0805ea75 in php_execute_script (primary_file=0xbffff650) at main.c:1310
#9  0x0805cdb3 in main (argc=2, argv=0xbffff6fc) at cgi_main.c:753
#10 0x400c91be in __libc_start_main (main=0x805c580 
, argc=2, ubp_av=0xbffff6fc,
               init=0x805b080 &lt;_init&gt;, fini=0x80f67b4 &lt;_fini&gt;, rtld_fini=0x4000ddd0 &lt;_dl_fini&gt;,
               stack_end=0xbffff6ec) at ../sysdeps/generic/libc-start.c:129
(gdb) frame 3
#3  0x080f1cc4 in execute (op_array=0x816c670) at ./zend_execute.c:1605
(gdb) print (char *)(executor_globals.function_state_ptr-&gt;function)-&gt;common.function_name
$14 = 0x80fa6fa &quot;pg_result_error&quot;
(gdb) print (char *)executor_globals.active_op_array-&gt;function_name
$15 = 0x816cfc4 &quot;result_error&quot;
(gdb) print (char *)executor_globals.active_op_array-&gt;filename
$16 = 0x816afbc &quot;/home/var/www/vhosts/angosso.net/php/DEV/angosso.php&quot;
(gdb)</pre>]]></content:encoded>
      <description><![CDATA[<pre>URI_Template Bug
Reported by mbiama
2016-09-09T12:44:38+00:00
PHP: 5.6.25 OS:  /proc/sys/kernel/core_pattern Package Version: 0.3.3

Description:
------------
make sure the directory is writable by PHP
Set the ulimit (see above how to do it).
Restart/rerun PHP.
After that any process crashing in my system, including PHP, will leave its 
core file in the directory you've specified in core_pattern.


Test script:
---------------
Once you have the core file:

Run gdb with the path to the PHP or PHP-enabled httpd binary, and path to the core file. Some examples:
gdb /var/www/vhosts/angosso.net/apache/sbin/httpd /var/www/vhosts/angosso.net/apache/sbin/core
gdb /home/angosso.net/dev/php-snaps/sapi/cli/php /home/angosso.net/dev/testing/core
At the gdb prompt, run:
(gdb) bt
If you can't get a core file:

Run httpd -X under gdb with something like:
gdb /var/www/vhosts/angosso.net/apache/sbin/httpd
(gdb) run -X
Then use your web browser and access your server to force the crash. You should see a gdb prompt appear and some message indicating that there was a crash. At this gdb prompt, type:
(gdb) bt
or, running from the commandline
gdb /home/angosso.net/dev/php-snaps/sapi/cli/php
(gdb) run /var/www/vhosts/angosso.net/httpdocs/script.php
(gdb) bt
This should generate a backtrace, that you should submit in the bug report, along with any other details you can give us about your setup, and offending script.

Locating which function call caused a segfault:

You can locate the function call that caused a segfault, easily, with gdb. First, you need a core file or to generate a segfault under gdb as described above.

In PHP, each function is executed by an internal function called execute() and has its own stack. Each line generated by the bt command represents a function call stack. Typically, you will see several execute() lines when you issue bt. You are interested in the last execute() stack (i.e. smallest frame number). You can move the current working stack with the up, down or frame commands. Below is an example gdb session that can be used as a guideline on how to handle your segfault.

Sample gdb session

(gdb) bt
#0  0x080ca21b in _efree (ptr=0xbfffdb9b) at zend_alloc.c:240
#1  0x080d691a in _zval_dtor (zvalue=0x8186b94) at zend_variables.c:44
#2  0x080cfab3 in _zval_ptr_dtor (zval_ptr=0xbfffdbfc) at zend_execute_API.c:274
#3  0x080f1cc4 in execute (op_array=0x816c670) at ./zend_execute.c:1605
#4  0x080f1e06 in execute (op_array=0x816c530) at ./zend_execute.c:1638
#5  0x080f1e06 in execute (op_array=0x816c278) at ./zend_execute.c:1638
#6  0x080f1e06 in execute (op_array=0x8166eec) at ./zend_execute.c:1638
#7  0x080d7b93 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810
#8  0x0805ea75 in php_execute_script (primary_file=0xbffff650) at main.c:1310
#9  0x0805cdb3 in main (argc=2, argv=0xbffff6fc) at cgi_main.c:753
#10 0x400c91be in __libc_start_main (main=0x805c580 
, argc=2, ubp_av=0xbffff6fc,
               init=0x805b080 &lt;_init&gt;, fini=0x80f67b4 &lt;_fini&gt;, rtld_fini=0x4000ddd0 &lt;_dl_fini&gt;,
               stack_end=0xbffff6ec) at ../sysdeps/generic/libc-start.c:129
(gdb) frame 3
#3  0x080f1cc4 in execute (op_array=0x816c670) at ./zend_execute.c:1605
(gdb) print (char *)(executor_globals.function_state_ptr-&gt;function)-&gt;common.function_name
$14 = 0x80fa6fa &quot;pg_result_error&quot;
(gdb) print (char *)executor_globals.active_op_array-&gt;function_name
$15 = 0x816cfc4 &quot;result_error&quot;
(gdb) print (char *)executor_globals.active_op_array-&gt;filename
$16 = 0x816afbc &quot;/home/var/www/vhosts/angosso.net/php/DEV/angosso.php&quot;
(gdb)</pre>]]></description>
      <dc:date>2016-09-09T12:44:38+00:00</dc:date>
      <dc:creator>medjomeman &amp;#x61;&amp;#116; hotmail &amp;#x64;&amp;#111;&amp;#x74; fr</dc:creator>
      <dc:subject>URI_Template Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/18916">
      <title>URI_Template: Feature/Change Request 18916 [Open] Provide URI Template Matching</title>
      <link>http://pear.php.net/bugs/18916</link>
      <content:encoded><![CDATA[<pre>URI_Template Feature/Change Request
Reported by bradley
2011-10-20T02:26:29+00:00
PHP: Irrelevant OS: N/A Package Version: 0.3.3

Description:
------------
Please consider implementing URI Template matching. Given a URI-reference and a set of URI Templates, indicate which URI Template(s) matched. I would like to see web frameworks start using URI Templates for both routing and URI expansion, and this component could serve as the base for this functionality.

Test script:
---------------
$templates = array(
    new URI_Template(&quot;http://example.org/{foo=%25}/&quot;),
    new URI_Template(&quot;http://example.org/?{-join|&amp;|a,data}&quot;),
    new URI_Template(&quot;http://example.org/?d={-listjoin|,|points}&amp;{-join|&amp;|a,b}&quot;)
);
$matcher = new URI_Template_Matcher($templates);
$matches = $matcher-&gt;match('http://example.org/?a=foo&amp;data=10%2C20%2C30');
print_r($matches);

Expected result:
----------------
Array
(
    [0] =&gt; URI_Template Object
        (
            [template:protected] =&gt; http://example.org/?{-join|&amp;|a,data}
            [values:protected] =&gt; Array
                (
                )

        )

)

Actual result:
--------------
There is no URI_Template_Matcher class.</pre>]]></content:encoded>
      <description><![CDATA[<pre>URI_Template Feature/Change Request
Reported by bradley
2011-10-20T02:26:29+00:00
PHP: Irrelevant OS: N/A Package Version: 0.3.3

Description:
------------
Please consider implementing URI Template matching. Given a URI-reference and a set of URI Templates, indicate which URI Template(s) matched. I would like to see web frameworks start using URI Templates for both routing and URI expansion, and this component could serve as the base for this functionality.

Test script:
---------------
$templates = array(
    new URI_Template(&quot;http://example.org/{foo=%25}/&quot;),
    new URI_Template(&quot;http://example.org/?{-join|&amp;|a,data}&quot;),
    new URI_Template(&quot;http://example.org/?d={-listjoin|,|points}&amp;{-join|&amp;|a,b}&quot;)
);
$matcher = new URI_Template_Matcher($templates);
$matches = $matcher-&gt;match('http://example.org/?a=foo&amp;data=10%2C20%2C30');
print_r($matches);

Expected result:
----------------
Array
(
    [0] =&gt; URI_Template Object
        (
            [template:protected] =&gt; http://example.org/?{-join|&amp;|a,data}
            [values:protected] =&gt; Array
                (
                )

        )

)

Actual result:
--------------
There is no URI_Template_Matcher class.</pre>]]></description>
      <dc:date>2011-10-20T02:26:29+00:00</dc:date>
      <dc:creator>bradley &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>URI_Template Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
