<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>[PHP-DEV] Re: [PHP-CVS] com php-src: Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config): NEWS Zend/zend.c</title>
        <description> Hi Laruence,

Thank you for sending this.

I'm not sure if the patch is completely correct.
With the patch all the threads share the single copy of 
script_encoding_list and when one thread terminates it calls 
compiler_globals_dtor() and frees the script_encoding_list. But other 
threads still keep reference to it.

I think we have to duplicate script_encoding_list for each thread in the 
same way as we do for CG(function_table).

Also I noticed a related issue. At zend.c compiler_globals_dtor() 
CG(script_encoding_list) deallocated using free() and in 
zend_multibyte.c zend_multibyte_set_script_encoding() using efree().

I suppose the second place has to be fixed.

I would appreciate if you could look into the problems.

Thanks. Dmitry.


On 05/03/2012 06:51 PM, Laruence wrote:
&amp;gt; Hi, Dmitry:
&amp;gt;
&amp;gt;       you may want to review this,  :)
&amp;gt;
&amp;gt; thanks
&amp;gt; On Thu, May 3, 2012 at 10:39 PM, Xinchen Hui&amp;lt;laruence@php.net&amp;gt;  wrote:
&amp;gt;&amp;gt; Commit:    72f19e9a8bcf5712b24fa333a26616eff19ac1ce
&amp;gt;&amp;gt; Author:    Xinchen Hui&amp;lt;laruence@php.net&amp;gt;           Thu, 3 May 2012 22:39:53 +0800
&amp;gt;&amp;gt; Parents:   d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c
&amp;gt;&amp;gt; Branches:  PHP-5.4
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Log:
&amp;gt;&amp;gt; Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config)
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Bugs:
&amp;gt;&amp;gt; https://bugs.php.net/61922
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Changed paths:
&amp;gt;&amp;gt;   M  NEWS
&amp;gt;&amp;gt;   M  Zend/zend.c
&amp;gt;&amp;gt;
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; Diff:
&amp;gt;&amp;gt; diff --git a/NEWS b/NEWS
&amp;gt;&amp;gt; index 8796cf4..9ef6abf 100644
&amp;gt;&amp;gt; --- a/NEWS
&amp;gt;&amp;gt; +++ b/NEWS
&amp;gt;&amp;gt; @@ -10,6 +10,8 @@ PHP                                                                        NEWS
&amp;gt;&amp;gt;      (Laruence)
&amp;gt;&amp;gt;
&amp;gt;&amp;gt;   - Core:
&amp;gt;&amp;gt; +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
&amp;gt;&amp;gt; +    (Laruence)
&amp;gt;&amp;gt;    . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
&amp;gt;&amp;gt;    . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
&amp;gt;&amp;gt;    . Fixed bug #61761 ('Overriding' a private static method with a different
&amp;gt;&amp;gt; diff --git a/Zend/zend.c b/Zend/zend.c
&amp;gt;&amp;gt; index dd299f1..37a1a27 100644
&amp;gt;&amp;gt; --- a/Zend/zend.c
&amp;gt;&amp;gt; +++ b/Zend/zend.c
&amp;gt;&amp;gt; @@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */
&amp;gt;&amp;gt;   void zend_post_startup(TSRMLS_D) /* {{{ */
&amp;gt;&amp;gt;   {
&amp;gt;&amp;gt;   #ifdef ZTS
&amp;gt;&amp;gt; +       zend_encoding **script_encoding_list;
&amp;gt;&amp;gt; +
&amp;gt;&amp;gt;         zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);
&amp;gt;&amp;gt;         zend_executor_globals *executor_globals = ts_resource(executor_globals_id);
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; @@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */
&amp;gt;&amp;gt;         zend_destroy_rsrc_list(&amp;amp;EG(persistent_list) TSRMLS_CC);
&amp;gt;&amp;gt;         free(compiler_globals-&amp;gt;function_table);
&amp;gt;&amp;gt;         free(compiler_globals-&amp;gt;class_table);
&amp;gt;&amp;gt; -       compiler_globals_ctor(compiler_globals, tsrm_ls);
&amp;gt;&amp;gt; +       if ((script_encoding_list = (zend_encoding **)compiler_globals-&amp;gt;script_encoding_list)) {
&amp;gt;&amp;gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);
&amp;gt;&amp;gt; +               compiler_globals-&amp;gt;script_encoding_list = (const zend_encoding **)script_encoding_list;
&amp;gt;&amp;gt; +       } else {
&amp;gt;&amp;gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);
&amp;gt;&amp;gt; +       }
&amp;gt;&amp;gt;         free(EG(zend_constants));
&amp;gt;&amp;gt;         executor_globals_ctor(executor_globals, tsrm_ls);
&amp;gt;&amp;gt;         global_persistent_list =&amp;amp;EG(persistent_list);
&amp;gt;&amp;gt;
&amp;gt;&amp;gt;
&amp;gt;&amp;gt; --
&amp;gt;&amp;gt; PHP CVS Mailing List (http://www.php.net/)
&amp;gt;&amp;gt; To unsubscribe, visit: http://www.php.net/unsub.php
&amp;gt;&amp;gt;
&amp;gt;
&amp;gt;
&amp;gt;


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php</description>
        <link>http://www.serverphorums.com/read.php?7,490720,490720#msg-490720</link>
        <lastBuildDate>Wed, 22 May 2013 01:53:49 +0200</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,490720,493565#msg-493565</guid>
            <title>[PHP-DEV] Re: [PHP-CVS] com php-src: Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config): NEWS Zend/zend.c</title>
            <link>http://www.serverphorums.com/read.php?7,490720,493565#msg-493565</link>
            <description><![CDATA[ On 05/05/2012 06:57 PM, Laruence wrote:<br />
&gt; Hi Dmitry:<br />
&gt;<br />
&gt; On Sat, May 5, 2012 at 6:38 PM, Laruence&lt;laruence@php.net&gt;  wrote:<br />
&gt;&gt; On Sat, May 5, 2012 at 2:36 PM, Dmitry Stogov&lt;dmitry@zend.com&gt;  wrote:<br />
&gt;&gt;&gt; Hi Laruence,<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Thank you for sending this.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; I'm not sure if the patch is completely correct.<br />
&gt;&gt;&gt; With the patch all the threads share the single copy of script_encoding_list<br />
&gt;&gt;&gt; and when one thread terminates it calls compiler_globals_dtor() and frees<br />
&gt;&gt;&gt; the script_encoding_list. But other threads still keep reference to it.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; I think we have to duplicate script_encoding_list for each thread in the<br />
&gt;&gt;&gt; same way as we do for CG(function_table).<br />
&gt;<br />
&gt;      after a further exam, this is right, there is a mechanism for new<br />
&gt; thread re-configure inis(zend_ini_refresh_caches). then new thread<br />
&gt; will have a copy.<br />
<br />
ok. In case you tested it, then your patch is fine.<br />
<br />
Thanks. Dmitry.<br />
<br />
&gt;&gt; right, thanks<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Also I noticed a related issue. At zend.c compiler_globals_dtor()<br />
&gt;&gt;&gt; CG(script_encoding_list) deallocated using free() and in zend_multibyte.c<br />
&gt;&gt;&gt; zend_multibyte_set_script_encoding() using efree().<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; I suppose the second place has to be fixed.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; I would appreciate if you could look into the problems.<br />
&gt; and this should use free, I will fix it . however for now it's dead<br />
&gt; codes,  so no bug feedback. :)<br />
&gt;<br />
&gt; thanks<br />
&gt;&gt; okey, I will, thanks :)<br />
&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Thanks. Dmitry.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; On 05/03/2012 06:51 PM, Laruence wrote:<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; Hi, Dmitry:<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;       you may want to review this,  :)<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; thanks<br />
&gt;&gt;&gt;&gt; On Thu, May 3, 2012 at 10:39 PM, Xinchen Hui&lt;laruence@php.net&gt;    wrote:<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; Commit:    72f19e9a8bcf5712b24fa333a26616eff19ac1ce<br />
&gt;&gt;&gt;&gt;&gt; Author:    Xinchen Hui&lt;laruence@php.net&gt;             Thu, 3 May 2012<br />
&gt;&gt;&gt;&gt;&gt; 22:39:53 +0800<br />
&gt;&gt;&gt;&gt;&gt; Parents:   d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c<br />
&gt;&gt;&gt;&gt;&gt; Branches:  PHP-5.4<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; Link:<br />
&gt;&gt;&gt;&gt;&gt; <a href="http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce" target="_blank"  rel="nofollow">http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce</a><br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; Log:<br />
&gt;&gt;&gt;&gt;&gt; Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config)<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; Bugs:<br />
&gt;&gt;&gt;&gt;&gt; <a href="https://bugs.php.net/61922" target="_blank"  rel="nofollow">https://bugs.php.net/61922</a><br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; Changed paths:<br />
&gt;&gt;&gt;&gt;&gt;   M  NEWS<br />
&gt;&gt;&gt;&gt;&gt;   M  Zend/zend.c<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; Diff:<br />
&gt;&gt;&gt;&gt;&gt; diff --git a/NEWS b/NEWS<br />
&gt;&gt;&gt;&gt;&gt; index 8796cf4..9ef6abf 100644<br />
&gt;&gt;&gt;&gt;&gt; --- a/NEWS<br />
&gt;&gt;&gt;&gt;&gt; +++ b/NEWS<br />
&gt;&gt;&gt;&gt;&gt; @@ -10,6 +10,8 @@ PHP<br />
&gt;&gt;&gt;&gt;&gt;                     NEWS<br />
&gt;&gt;&gt;&gt;&gt;      (Laruence)<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt;   - Core:<br />
&gt;&gt;&gt;&gt;&gt; +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding<br />
&gt;&gt;&gt;&gt;&gt; config).<br />
&gt;&gt;&gt;&gt;&gt; +    (Laruence)<br />
&gt;&gt;&gt;&gt;&gt;    . Fixed missing bound check in iptcparse(). (chris at chiappa.net)<br />
&gt;&gt;&gt;&gt;&gt;    . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)<br />
&gt;&gt;&gt;&gt;&gt;    . Fixed bug #61761 ('Overriding' a private static method with a<br />
&gt;&gt;&gt;&gt;&gt; different<br />
&gt;&gt;&gt;&gt;&gt; diff --git a/Zend/zend.c b/Zend/zend.c<br />
&gt;&gt;&gt;&gt;&gt; index dd299f1..37a1a27 100644<br />
&gt;&gt;&gt;&gt;&gt; --- a/Zend/zend.c<br />
&gt;&gt;&gt;&gt;&gt; +++ b/Zend/zend.c<br />
&gt;&gt;&gt;&gt;&gt; @@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /*<br />
&gt;&gt;&gt;&gt;&gt; {{{ */<br />
&gt;&gt;&gt;&gt;&gt;   void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;&gt;&gt;&gt;   {<br />
&gt;&gt;&gt;&gt;&gt;   #ifdef ZTS<br />
&gt;&gt;&gt;&gt;&gt; +       zend_encoding **script_encoding_list;<br />
&gt;&gt;&gt;&gt;&gt; +<br />
&gt;&gt;&gt;&gt;&gt;         zend_compiler_globals *compiler_globals =<br />
&gt;&gt;&gt;&gt;&gt; ts_resource(compiler_globals_id);<br />
&gt;&gt;&gt;&gt;&gt;         zend_executor_globals *executor_globals =<br />
&gt;&gt;&gt;&gt;&gt; ts_resource(executor_globals_id);<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; @@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;&gt;&gt;&gt;         zend_destroy_rsrc_list(&amp;EG(persistent_list) TSRMLS_CC);<br />
&gt;&gt;&gt;&gt;&gt;         free(compiler_globals-&gt;function_table);<br />
&gt;&gt;&gt;&gt;&gt;         free(compiler_globals-&gt;class_table);<br />
&gt;&gt;&gt;&gt;&gt; -       compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt;&gt; +       if ((script_encoding_list = (zend_encoding<br />
&gt;&gt;&gt;&gt;&gt; **)compiler_globals-&gt;script_encoding_list)) {<br />
&gt;&gt;&gt;&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt;&gt; +               compiler_globals-&gt;script_encoding_list = (const<br />
&gt;&gt;&gt;&gt;&gt; zend_encoding **)script_encoding_list;<br />
&gt;&gt;&gt;&gt;&gt; +       } else {<br />
&gt;&gt;&gt;&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt;&gt; +       }<br />
&gt;&gt;&gt;&gt;&gt;         free(EG(zend_constants));<br />
&gt;&gt;&gt;&gt;&gt;         executor_globals_ctor(executor_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt;&gt;         global_persistent_list =&amp;EG(persistent_list);<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;&gt; --<br />
&gt;&gt;&gt;&gt;&gt; PHP CVS Mailing List (http://www.php.net/)<br />
&gt;&gt;&gt;&gt;&gt; To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a><br />
&gt;&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt; --<br />
&gt;&gt; Laruence  Xinchen Hui<br />
&gt;&gt; <a href="http://www.laruence.com/" target="_blank"  rel="nofollow">http://www.laruence.com/</a><br />
&gt;<br />
&gt;<br />
&gt;<br />
<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Dmitry Stogov</dc:creator>
            <category>php-internals</category>
            <pubDate>Thu, 10 May 2012 11:30:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,490720,490820#msg-490820</guid>
            <title>[PHP-DEV] Re: [PHP-CVS] com php-src: Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config): NEWS Zend/zend.c</title>
            <link>http://www.serverphorums.com/read.php?7,490720,490820#msg-490820</link>
            <description><![CDATA[ Hi Dmitry:<br />
<br />
On Sat, May 5, 2012 at 6:38 PM, Laruence &lt;laruence@php.net&gt; wrote:<br />
&gt; On Sat, May 5, 2012 at 2:36 PM, Dmitry Stogov &lt;dmitry@zend.com&gt; wrote:<br />
&gt;&gt; Hi Laruence,<br />
&gt;&gt;<br />
&gt;&gt; Thank you for sending this.<br />
&gt;&gt;<br />
&gt;&gt; I'm not sure if the patch is completely correct.<br />
&gt;&gt; With the patch all the threads share the single copy of script_encoding_list<br />
&gt;&gt; and when one thread terminates it calls compiler_globals_dtor() and frees<br />
&gt;&gt; the script_encoding_list. But other threads still keep reference to it.<br />
&gt;&gt;<br />
&gt;&gt; I think we have to duplicate script_encoding_list for each thread in the<br />
&gt;&gt; same way as we do for CG(function_table).<br />
<br />
    after a further exam, this is right, there is a mechanism for new<br />
thread re-configure inis(zend_ini_refresh_caches). then new thread<br />
will have a copy.<br />
<br />
&gt; right, thanks<br />
&gt;&gt;<br />
&gt;&gt; Also I noticed a related issue. At zend.c compiler_globals_dtor()<br />
&gt;&gt; CG(script_encoding_list) deallocated using free() and in zend_multibyte.c<br />
&gt;&gt; zend_multibyte_set_script_encoding() using efree().<br />
&gt;&gt;<br />
&gt;&gt; I suppose the second place has to be fixed.<br />
&gt;&gt;<br />
&gt;&gt; I would appreciate if you could look into the problems.<br />
and this should use free, I will fix it . however for now it's dead<br />
codes,  so no bug feedback. :)<br />
<br />
thanks<br />
&gt; okey, I will, thanks :)<br />
&gt;<br />
&gt;&gt;<br />
&gt;&gt; Thanks. Dmitry.<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt; On 05/03/2012 06:51 PM, Laruence wrote:<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Hi, Dmitry:<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;      you may want to review this,  :)<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; thanks<br />
&gt;&gt;&gt; On Thu, May 3, 2012 at 10:39 PM, Xinchen Hui&lt;laruence@php.net&gt;  wrote:<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; Commit:    72f19e9a8bcf5712b24fa333a26616eff19ac1ce<br />
&gt;&gt;&gt;&gt; Author:    Xinchen Hui&lt;laruence@php.net&gt;           Thu, 3 May 2012<br />
&gt;&gt;&gt;&gt; 22:39:53 +0800<br />
&gt;&gt;&gt;&gt; Parents:   d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c<br />
&gt;&gt;&gt;&gt; Branches:  PHP-5.4<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; Link:<br />
&gt;&gt;&gt;&gt; <a href="http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce" target="_blank"  rel="nofollow">http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce</a><br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; Log:<br />
&gt;&gt;&gt;&gt; Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config)<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; Bugs:<br />
&gt;&gt;&gt;&gt; <a href="https://bugs.php.net/61922" target="_blank"  rel="nofollow">https://bugs.php.net/61922</a><br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; Changed paths:<br />
&gt;&gt;&gt;&gt;  M  NEWS<br />
&gt;&gt;&gt;&gt;  M  Zend/zend.c<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; Diff:<br />
&gt;&gt;&gt;&gt; diff --git a/NEWS b/NEWS<br />
&gt;&gt;&gt;&gt; index 8796cf4..9ef6abf 100644<br />
&gt;&gt;&gt;&gt; --- a/NEWS<br />
&gt;&gt;&gt;&gt; +++ b/NEWS<br />
&gt;&gt;&gt;&gt; @@ -10,6 +10,8 @@ PHP<br />
&gt;&gt;&gt;&gt;                    NEWS<br />
&gt;&gt;&gt;&gt;     (Laruence)<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;  - Core:<br />
&gt;&gt;&gt;&gt; +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding<br />
&gt;&gt;&gt;&gt; config).<br />
&gt;&gt;&gt;&gt; +    (Laruence)<br />
&gt;&gt;&gt;&gt;   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)<br />
&gt;&gt;&gt;&gt;   . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)<br />
&gt;&gt;&gt;&gt;   . Fixed bug #61761 ('Overriding' a private static method with a<br />
&gt;&gt;&gt;&gt; different<br />
&gt;&gt;&gt;&gt; diff --git a/Zend/zend.c b/Zend/zend.c<br />
&gt;&gt;&gt;&gt; index dd299f1..37a1a27 100644<br />
&gt;&gt;&gt;&gt; --- a/Zend/zend.c<br />
&gt;&gt;&gt;&gt; +++ b/Zend/zend.c<br />
&gt;&gt;&gt;&gt; @@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /*<br />
&gt;&gt;&gt;&gt; {{{ */<br />
&gt;&gt;&gt;&gt;  void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;&gt;&gt;  {<br />
&gt;&gt;&gt;&gt;  #ifdef ZTS<br />
&gt;&gt;&gt;&gt; +       zend_encoding **script_encoding_list;<br />
&gt;&gt;&gt;&gt; +<br />
&gt;&gt;&gt;&gt;        zend_compiler_globals *compiler_globals =<br />
&gt;&gt;&gt;&gt; ts_resource(compiler_globals_id);<br />
&gt;&gt;&gt;&gt;        zend_executor_globals *executor_globals =<br />
&gt;&gt;&gt;&gt; ts_resource(executor_globals_id);<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; @@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;&gt;&gt;        zend_destroy_rsrc_list(&amp;EG(persistent_list) TSRMLS_CC);<br />
&gt;&gt;&gt;&gt;        free(compiler_globals-&gt;function_table);<br />
&gt;&gt;&gt;&gt;        free(compiler_globals-&gt;class_table);<br />
&gt;&gt;&gt;&gt; -       compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt; +       if ((script_encoding_list = (zend_encoding<br />
&gt;&gt;&gt;&gt; **)compiler_globals-&gt;script_encoding_list)) {<br />
&gt;&gt;&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt; +               compiler_globals-&gt;script_encoding_list = (const<br />
&gt;&gt;&gt;&gt; zend_encoding **)script_encoding_list;<br />
&gt;&gt;&gt;&gt; +       } else {<br />
&gt;&gt;&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt; +       }<br />
&gt;&gt;&gt;&gt;        free(EG(zend_constants));<br />
&gt;&gt;&gt;&gt;        executor_globals_ctor(executor_globals, tsrm_ls);<br />
&gt;&gt;&gt;&gt;        global_persistent_list =&amp;EG(persistent_list);<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;&gt; --<br />
&gt;&gt;&gt;&gt; PHP CVS Mailing List (http://www.php.net/)<br />
&gt;&gt;&gt;&gt; To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a><br />
&gt;&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;<br />
&gt;<br />
&gt;<br />
&gt;<br />
&gt; --<br />
&gt; Laruence  Xinchen Hui<br />
&gt; <a href="http://www.laruence.com/" target="_blank"  rel="nofollow">http://www.laruence.com/</a><br />
<br />
<br />
<br />
-- <br />
Laruence  Xinchen Hui<br />
<a href="http://www.laruence.com/" target="_blank"  rel="nofollow">http://www.laruence.com/</a><br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Laruence</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 05 May 2012 17:00:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,490720,490763#msg-490763</guid>
            <title>[PHP-DEV] Re: [PHP-CVS] com php-src: Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config): NEWS Zend/zend.c</title>
            <link>http://www.serverphorums.com/read.php?7,490720,490763#msg-490763</link>
            <description><![CDATA[ On Sat, May 5, 2012 at 2:36 PM, Dmitry Stogov &lt;dmitry@zend.com&gt; wrote:<br />
&gt; Hi Laruence,<br />
&gt;<br />
&gt; Thank you for sending this.<br />
&gt;<br />
&gt; I'm not sure if the patch is completely correct.<br />
&gt; With the patch all the threads share the single copy of script_encoding_list<br />
&gt; and when one thread terminates it calls compiler_globals_dtor() and frees<br />
&gt; the script_encoding_list. But other threads still keep reference to it.<br />
&gt;<br />
&gt; I think we have to duplicate script_encoding_list for each thread in the<br />
&gt; same way as we do for CG(function_table).<br />
right, thanks<br />
&gt;<br />
&gt; Also I noticed a related issue. At zend.c compiler_globals_dtor()<br />
&gt; CG(script_encoding_list) deallocated using free() and in zend_multibyte.c<br />
&gt; zend_multibyte_set_script_encoding() using efree().<br />
&gt;<br />
&gt; I suppose the second place has to be fixed.<br />
&gt;<br />
&gt; I would appreciate if you could look into the problems.<br />
okey, I will, thanks :)<br />
<br />
&gt;<br />
&gt; Thanks. Dmitry.<br />
&gt;<br />
&gt;<br />
&gt;<br />
&gt; On 05/03/2012 06:51 PM, Laruence wrote:<br />
&gt;&gt;<br />
&gt;&gt; Hi, Dmitry:<br />
&gt;&gt;<br />
&gt;&gt;      you may want to review this,  :)<br />
&gt;&gt;<br />
&gt;&gt; thanks<br />
&gt;&gt; On Thu, May 3, 2012 at 10:39 PM, Xinchen Hui&lt;laruence@php.net&gt;  wrote:<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Commit:    72f19e9a8bcf5712b24fa333a26616eff19ac1ce<br />
&gt;&gt;&gt; Author:    Xinchen Hui&lt;laruence@php.net&gt;           Thu, 3 May 2012<br />
&gt;&gt;&gt; 22:39:53 +0800<br />
&gt;&gt;&gt; Parents:   d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c<br />
&gt;&gt;&gt; Branches:  PHP-5.4<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Link:<br />
&gt;&gt;&gt; <a href="http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce" target="_blank"  rel="nofollow">http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce</a><br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Log:<br />
&gt;&gt;&gt; Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config)<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Bugs:<br />
&gt;&gt;&gt; <a href="https://bugs.php.net/61922" target="_blank"  rel="nofollow">https://bugs.php.net/61922</a><br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Changed paths:<br />
&gt;&gt;&gt;  M  NEWS<br />
&gt;&gt;&gt;  M  Zend/zend.c<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Diff:<br />
&gt;&gt;&gt; diff --git a/NEWS b/NEWS<br />
&gt;&gt;&gt; index 8796cf4..9ef6abf 100644<br />
&gt;&gt;&gt; --- a/NEWS<br />
&gt;&gt;&gt; +++ b/NEWS<br />
&gt;&gt;&gt; @@ -10,6 +10,8 @@ PHP<br />
&gt;&gt;&gt;                    NEWS<br />
&gt;&gt;&gt;     (Laruence)<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;  - Core:<br />
&gt;&gt;&gt; +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding<br />
&gt;&gt;&gt; config).<br />
&gt;&gt;&gt; +    (Laruence)<br />
&gt;&gt;&gt;   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)<br />
&gt;&gt;&gt;   . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)<br />
&gt;&gt;&gt;   . Fixed bug #61761 ('Overriding' a private static method with a<br />
&gt;&gt;&gt; different<br />
&gt;&gt;&gt; diff --git a/Zend/zend.c b/Zend/zend.c<br />
&gt;&gt;&gt; index dd299f1..37a1a27 100644<br />
&gt;&gt;&gt; --- a/Zend/zend.c<br />
&gt;&gt;&gt; +++ b/Zend/zend.c<br />
&gt;&gt;&gt; @@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /*<br />
&gt;&gt;&gt; {{{ */<br />
&gt;&gt;&gt;  void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;&gt;  {<br />
&gt;&gt;&gt;  #ifdef ZTS<br />
&gt;&gt;&gt; +       zend_encoding **script_encoding_list;<br />
&gt;&gt;&gt; +<br />
&gt;&gt;&gt;        zend_compiler_globals *compiler_globals =<br />
&gt;&gt;&gt; ts_resource(compiler_globals_id);<br />
&gt;&gt;&gt;        zend_executor_globals *executor_globals =<br />
&gt;&gt;&gt; ts_resource(executor_globals_id);<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; @@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;&gt;        zend_destroy_rsrc_list(&amp;EG(persistent_list) TSRMLS_CC);<br />
&gt;&gt;&gt;        free(compiler_globals-&gt;function_table);<br />
&gt;&gt;&gt;        free(compiler_globals-&gt;class_table);<br />
&gt;&gt;&gt; -       compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt; +       if ((script_encoding_list = (zend_encoding<br />
&gt;&gt;&gt; **)compiler_globals-&gt;script_encoding_list)) {<br />
&gt;&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt; +               compiler_globals-&gt;script_encoding_list = (const<br />
&gt;&gt;&gt; zend_encoding **)script_encoding_list;<br />
&gt;&gt;&gt; +       } else {<br />
&gt;&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt;&gt; +       }<br />
&gt;&gt;&gt;        free(EG(zend_constants));<br />
&gt;&gt;&gt;        executor_globals_ctor(executor_globals, tsrm_ls);<br />
&gt;&gt;&gt;        global_persistent_list =&amp;EG(persistent_list);<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; --<br />
&gt;&gt;&gt; PHP CVS Mailing List (http://www.php.net/)<br />
&gt;&gt;&gt; To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a><br />
&gt;&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;<br />
<br />
<br />
<br />
-- <br />
Laruence  Xinchen Hui<br />
<a href="http://www.laruence.com/" target="_blank"  rel="nofollow">http://www.laruence.com/</a><br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Laruence</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 05 May 2012 12:40:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,490720,490720#msg-490720</guid>
            <title>[PHP-DEV] Re: [PHP-CVS] com php-src: Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config): NEWS Zend/zend.c</title>
            <link>http://www.serverphorums.com/read.php?7,490720,490720#msg-490720</link>
            <description><![CDATA[ Hi Laruence,<br />
<br />
Thank you for sending this.<br />
<br />
I'm not sure if the patch is completely correct.<br />
With the patch all the threads share the single copy of <br />
script_encoding_list and when one thread terminates it calls <br />
compiler_globals_dtor() and frees the script_encoding_list. But other <br />
threads still keep reference to it.<br />
<br />
I think we have to duplicate script_encoding_list for each thread in the <br />
same way as we do for CG(function_table).<br />
<br />
Also I noticed a related issue. At zend.c compiler_globals_dtor() <br />
CG(script_encoding_list) deallocated using free() and in <br />
zend_multibyte.c zend_multibyte_set_script_encoding() using efree().<br />
<br />
I suppose the second place has to be fixed.<br />
<br />
I would appreciate if you could look into the problems.<br />
<br />
Thanks. Dmitry.<br />
<br />
<br />
On 05/03/2012 06:51 PM, Laruence wrote:<br />
&gt; Hi, Dmitry:<br />
&gt;<br />
&gt;       you may want to review this,  :)<br />
&gt;<br />
&gt; thanks<br />
&gt; On Thu, May 3, 2012 at 10:39 PM, Xinchen Hui&lt;laruence@php.net&gt;  wrote:<br />
&gt;&gt; Commit:    72f19e9a8bcf5712b24fa333a26616eff19ac1ce<br />
&gt;&gt; Author:    Xinchen Hui&lt;laruence@php.net&gt;           Thu, 3 May 2012 22:39:53 +0800<br />
&gt;&gt; Parents:   d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c<br />
&gt;&gt; Branches:  PHP-5.4<br />
&gt;&gt;<br />
&gt;&gt; Link:       <a href="http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce" target="_blank"  rel="nofollow">http://git.php.net/?p=php-src.git;a=commitdiff;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce</a><br />
&gt;&gt;<br />
&gt;&gt; Log:<br />
&gt;&gt; Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config)<br />
&gt;&gt;<br />
&gt;&gt; Bugs:<br />
&gt;&gt; <a href="https://bugs.php.net/61922" target="_blank"  rel="nofollow">https://bugs.php.net/61922</a><br />
&gt;&gt;<br />
&gt;&gt; Changed paths:<br />
&gt;&gt;   M  NEWS<br />
&gt;&gt;   M  Zend/zend.c<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt; Diff:<br />
&gt;&gt; diff --git a/NEWS b/NEWS<br />
&gt;&gt; index 8796cf4..9ef6abf 100644<br />
&gt;&gt; --- a/NEWS<br />
&gt;&gt; +++ b/NEWS<br />
&gt;&gt; @@ -10,6 +10,8 @@ PHP                                                                        NEWS<br />
&gt;&gt;      (Laruence)<br />
&gt;&gt;<br />
&gt;&gt;   - Core:<br />
&gt;&gt; +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).<br />
&gt;&gt; +    (Laruence)<br />
&gt;&gt;    . Fixed missing bound check in iptcparse(). (chris at chiappa.net)<br />
&gt;&gt;    . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)<br />
&gt;&gt;    . Fixed bug #61761 ('Overriding' a private static method with a different<br />
&gt;&gt; diff --git a/Zend/zend.c b/Zend/zend.c<br />
&gt;&gt; index dd299f1..37a1a27 100644<br />
&gt;&gt; --- a/Zend/zend.c<br />
&gt;&gt; +++ b/Zend/zend.c<br />
&gt;&gt; @@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */<br />
&gt;&gt;   void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;   {<br />
&gt;&gt;   #ifdef ZTS<br />
&gt;&gt; +       zend_encoding **script_encoding_list;<br />
&gt;&gt; +<br />
&gt;&gt;         zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);<br />
&gt;&gt;         zend_executor_globals *executor_globals = ts_resource(executor_globals_id);<br />
&gt;&gt;<br />
&gt;&gt; @@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */<br />
&gt;&gt;         zend_destroy_rsrc_list(&amp;EG(persistent_list) TSRMLS_CC);<br />
&gt;&gt;         free(compiler_globals-&gt;function_table);<br />
&gt;&gt;         free(compiler_globals-&gt;class_table);<br />
&gt;&gt; -       compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt; +       if ((script_encoding_list = (zend_encoding **)compiler_globals-&gt;script_encoding_list)) {<br />
&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt; +               compiler_globals-&gt;script_encoding_list = (const zend_encoding **)script_encoding_list;<br />
&gt;&gt; +       } else {<br />
&gt;&gt; +               compiler_globals_ctor(compiler_globals, tsrm_ls);<br />
&gt;&gt; +       }<br />
&gt;&gt;         free(EG(zend_constants));<br />
&gt;&gt;         executor_globals_ctor(executor_globals, tsrm_ls);<br />
&gt;&gt;         global_persistent_list =&amp;EG(persistent_list);<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt; --<br />
&gt;&gt; PHP CVS Mailing List (http://www.php.net/)<br />
&gt;&gt; To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a><br />
&gt;&gt;<br />
&gt;<br />
&gt;<br />
&gt;<br />
<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Dmitry Stogov</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 05 May 2012 08:40:02 +0200</pubDate>
        </item>
    </channel>
</rss>
