Bug #52038 [Opn]: zend_mm_heap corrupted at end of program

2010-06-10 Thread kalle
Edit report at http://bugs.php.net/bug.php?id=52038&edit=1

 ID:   52038
 Updated by:   ka...@php.net
 Reported by:  gar37bic at gmail dot com
 Summary:  zend_mm_heap corrupted at end of program
 Status:   Open
 Type: Bug
 Package:  Reproducible crash
 Operating System: Linux Ubuntu 10.0.0.4
 PHP Version:  5.3.2

 New Comment:

Any chance you can compile apache with debugging symbols so we can see
if it segfaults in any of the apache shutdown functions, or the sapi you
use as i dont except it to be CLI looking at the bt?


Previous Comments:

[2010-06-09 21:39:30] gar37bic at gmail dot com

Description:

I'm posting as a crash, even though the program completes its work
before segfaulting.



I have a large, complex PHP command-line program that uses PHPExcel to
read spreadsheet files, builds large data arrays, then uses
XML_Serializer to generate XML, and writes the XML to a file.  The main
program is primarily a sequential class loader, that reads in about 40
class files.  It also uses getopt() to parse command line options. 
Maximum memory use is around 300-400 megabytes.



This program works fine.  However, under certain circumstances
(including my 'verbose' logging output option, which generates 60,000
lines of log data), the program completes its work but after the final
line of output, it says 'zend_mm_heap corrupted'.



Whether this occurs depends on the input spreadsheet, and is not
directly related to the size of the sheet or the size of the output XML,
or the maximum memory used. 



I have found that, for the spreadsheet that generates the error, by
changing one array element in the default command line option
definitions, I can turn the error on and off.



If I run the program as 'php my_program.php -blah', it acts the same as
if I run it directly as 'my_program.php -blah'.  However, if I run the
program as 'php -e my_program.php -blah' I never get the zend message.



I have run this under gdb using php -e to get a stack.  Under gdb it
segfaults for both versions of the program.  The stack is identical for
both versions of the program and the zend_mm_heap message does not
appear.



Here the is the gdb stack.  (The first line is the ending line of my
program.)



Program ending with status 0x0, 0 warnings and 0 errors



Program received signal SIGSEGV, Segmentation fault.

0x006b549f in ?? ()

(gdb) bt

#0  0x006b549f in ?? ()

#1  0x006b59fb in ?? ()

#2  0x006a1e4e in zend_hash_destroy ()

#3  0x00694e2f in _zval_dtor_func ()

#4  0x00688e5d in _zval_ptr_dtor ()

#5  0x006a1e28 in zend_hash_destroy ()

#6  0x006b6d69 in zend_object_std_dtor ()

#7  0x006b6d89 in zend_objects_free_object_storage ()

#8  0x006ba27c in zend_objects_store_free_object_storage ()

#9  0x00689255 in ?? ()

#10 0x00695b72 in ?? ()

#11 0x00641825 in php_request_shutdown ()

#12 0x00725314 in ?? ()

#13 0x752a7c4d in __libc_start_main (main=,


argc=, ubp_av=, 

init=, fini=, 

rtld_fini=, stack_end=0x7fffe218)

at libc-start.c:226

#14 0x0042c639 in _start ()





Unfortunately, I can not post the code or the data.  It's large, and
it's confidential, and the problem has appeared and disappeared with
minor code changes over the last week so I don't think I can reduce it. 
However if anyone has any ideas, I'd be willing to help as much as I
can.



Loaded modules: core mod_log_config mod_logio prefork http_core mod_so
mod_alias mod_auth_basic mod_authn_file mod_authz_default
mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi
mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_python
mod_reqtimeout mod_setenvif mod_ssl mod_status mod_userdir 

Expected result:

I don't expect to see 'zend_mm_heap corrupted'







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


Bug #52038 [Opn->Fbk]: zend_mm_heap corrupted at end of program

2010-06-10 Thread kalle
Edit report at http://bugs.php.net/bug.php?id=52038&edit=1

 ID:   52038
 Updated by:   ka...@php.net
 Reported by:  gar37bic at gmail dot com
 Summary:  zend_mm_heap corrupted at end of program
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Reproducible crash
 Operating System: Linux Ubuntu 10.0.0.4
 PHP Version:  5.3.2



Previous Comments:

[2010-06-10 11:13:09] ka...@php.net

Any chance you can compile apache with debugging symbols so we can see
if it segfaults in any of the apache shutdown functions, or the sapi you
use as i dont except it to be CLI looking at the bt?


[2010-06-09 21:39:30] gar37bic at gmail dot com

Description:

I'm posting as a crash, even though the program completes its work
before segfaulting.



I have a large, complex PHP command-line program that uses PHPExcel to
read spreadsheet files, builds large data arrays, then uses
XML_Serializer to generate XML, and writes the XML to a file.  The main
program is primarily a sequential class loader, that reads in about 40
class files.  It also uses getopt() to parse command line options. 
Maximum memory use is around 300-400 megabytes.



This program works fine.  However, under certain circumstances
(including my 'verbose' logging output option, which generates 60,000
lines of log data), the program completes its work but after the final
line of output, it says 'zend_mm_heap corrupted'.



Whether this occurs depends on the input spreadsheet, and is not
directly related to the size of the sheet or the size of the output XML,
or the maximum memory used. 



I have found that, for the spreadsheet that generates the error, by
changing one array element in the default command line option
definitions, I can turn the error on and off.



If I run the program as 'php my_program.php -blah', it acts the same as
if I run it directly as 'my_program.php -blah'.  However, if I run the
program as 'php -e my_program.php -blah' I never get the zend message.



I have run this under gdb using php -e to get a stack.  Under gdb it
segfaults for both versions of the program.  The stack is identical for
both versions of the program and the zend_mm_heap message does not
appear.



Here the is the gdb stack.  (The first line is the ending line of my
program.)



Program ending with status 0x0, 0 warnings and 0 errors



Program received signal SIGSEGV, Segmentation fault.

0x006b549f in ?? ()

(gdb) bt

#0  0x006b549f in ?? ()

#1  0x006b59fb in ?? ()

#2  0x006a1e4e in zend_hash_destroy ()

#3  0x00694e2f in _zval_dtor_func ()

#4  0x00688e5d in _zval_ptr_dtor ()

#5  0x006a1e28 in zend_hash_destroy ()

#6  0x006b6d69 in zend_object_std_dtor ()

#7  0x006b6d89 in zend_objects_free_object_storage ()

#8  0x006ba27c in zend_objects_store_free_object_storage ()

#9  0x00689255 in ?? ()

#10 0x00695b72 in ?? ()

#11 0x00641825 in php_request_shutdown ()

#12 0x00725314 in ?? ()

#13 0x752a7c4d in __libc_start_main (main=,


argc=, ubp_av=, 

init=, fini=, 

rtld_fini=, stack_end=0x7fffe218)

at libc-start.c:226

#14 0x0042c639 in _start ()





Unfortunately, I can not post the code or the data.  It's large, and
it's confidential, and the problem has appeared and disappeared with
minor code changes over the last week so I don't think I can reduce it. 
However if anyone has any ideas, I'd be willing to help as much as I
can.



Loaded modules: core mod_log_config mod_logio prefork http_core mod_so
mod_alias mod_auth_basic mod_authn_file mod_authz_default
mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi
mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_python
mod_reqtimeout mod_setenvif mod_ssl mod_status mod_userdir 

Expected result:

I don't expect to see 'zend_mm_heap corrupted'







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


Bug #52034 [Opn->Fbk]: PHP programmer

2010-06-10 Thread kalle
Edit report at http://bugs.php.net/bug.php?id=52034&edit=1

 ID:   52034
 Updated by:   ka...@php.net
 Reported by:  hettbox at gmail dot com
 Summary:  PHP programmer
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Unknown/Other Function
 Operating System: Windows 2008 x86
 PHP Version:  5.3.2

 New Comment:

Have you tried to increase the max_input_time php.ini setting?


Previous Comments:

[2010-06-09 19:22:07] hettbox at gmail dot com

On the PHP 5.3.1 its work!


[2010-06-09 19:17:27] hettbox at gmail dot com

Description:

If time for uploading file more than 30 seconds, then PHP reports an
error: "Fatal error: Maximum execution time of 30 seconds exceeded"



If configure server on max_execution_time more 30 seconds (for example
3600), then after 30 secons server generated error "Fatal error: Maximum
execution time of 3600 seconds exceeded"



Sorry, im russian...

Test script:
---
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>



http://www.w3.org/1999/xhtml";>





  Uploading



















 File name: ' . $path['basename'];

}

  }

}

?>











Expected result:

File must be loaded on the server. (Im russian, sorry =))

Actual result:
--
File not loaded on the server.






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


Bug #52001 [Asn->Csd]: Memory allocation problems after using variable variables

2010-06-10 Thread dmitry
Edit report at http://bugs.php.net/bug.php?id=52001&edit=1

 ID:   52001
 Updated by:   dmi...@php.net
 Reported by:  lisio at bk dot ru
 Summary:  Memory allocation problems after using variable
   variables
-Status:   Assigned
+Status:   Closed
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Linux
 PHP Version:  5.3.2
 Assigned To:  dmitry

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2010-06-10 11:13:24] dmi...@php.net

Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=300345
Log: Fixed bug #52001 (Memory allocation problems after using variable
variables)


[2010-06-08 11:22:57] boldin dot pavel at gmail dot com

old patch brokes tests (Zend/tests/objects_020.phpt), new one don't.
Still don't sure if it is absolutely correct.


[2010-06-06 19:15:45] boldin dot pavel at gmail dot com

Zend/zend_compile.c 1066:

if (opline && type == BP_VAR_W && arg_offset) {

opline->extended_value = ZEND_FETCH_MAKE_REF;

}



Is not this bug too? ZEND_FETCH_MAKE_REF is not set for first
(arg_offset == 0) arg?


[2010-06-06 19:06:29] boldin dot pavel at gmail dot com

I have attached patch. It must be reviewed by professional PHP
developer.



For me it is clearly that call of SEPARATE_ZVAL_TO_MAKE_IS_REF must be
predicated with such a check (and it is done in all other cases).


[2010-06-06 18:38:05] boldin dot pavel at gmail dot com

Finally: bug is at 

if (opline->extended_value & ZEND_FETCH_MAKE_REF) {

SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);

}



SEPARATE_ZVAL_TO_MAKE_IS_REF seems to ruine *retval (which is
executor_globals.uninitialized_ptr). Then this leads to incorrectly
working zend_send_by_var_helper and incorrect referencing count in
zend_assign_to_variable.



Trying to patch now.




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/bug.php?id=52001


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


Bug #52034 [Com]: PHP programmer

2010-06-10 Thread hettbox at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52034&edit=1

 ID:   52034
 Comment by:   hettbox at gmail dot com
 Reported by:  hettbox at gmail dot com
 Summary:  PHP programmer
 Status:   Feedback
 Type: Bug
 Package:  Unknown/Other Function
 Operating System: Windows 2008 x86
 PHP Version:  5.3.2

 New Comment:

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


Previous Comments:

[2010-06-10 11:15:54] ka...@php.net

Have you tried to increase the max_input_time php.ini setting?


[2010-06-09 19:22:07] hettbox at gmail dot com

On the PHP 5.3.1 its work!


[2010-06-09 19:17:27] hettbox at gmail dot com

Description:

If time for uploading file more than 30 seconds, then PHP reports an
error: "Fatal error: Maximum execution time of 30 seconds exceeded"



If configure server on max_execution_time more 30 seconds (for example
3600), then after 30 secons server generated error "Fatal error: Maximum
execution time of 3600 seconds exceeded"



Sorry, im russian...

Test script:
---
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>



http://www.w3.org/1999/xhtml";>





  Uploading



















 File name: ' . $path['basename'];

}

  }

}

?>











Expected result:

File must be loaded on the server. (Im russian, sorry =))

Actual result:
--
File not loaded on the server.






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


Bug #52034 [Com]: PHP programmer

2010-06-10 Thread hettbox at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52034&edit=1

 ID:   52034
 Comment by:   hettbox at gmail dot com
 Reported by:  hettbox at gmail dot com
 Summary:  PHP programmer
 Status:   Feedback
 Type: Bug
 Package:  Unknown/Other Function
 Operating System: Windows 2008 x86
 PHP Version:  5.3.2

 New Comment:

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


Previous Comments:

[2010-06-10 11:41:36] hettbox at gmail dot com

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


[2010-06-10 11:15:54] ka...@php.net

Have you tried to increase the max_input_time php.ini setting?


[2010-06-09 19:22:07] hettbox at gmail dot com

On the PHP 5.3.1 its work!


[2010-06-09 19:17:27] hettbox at gmail dot com

Description:

If time for uploading file more than 30 seconds, then PHP reports an
error: "Fatal error: Maximum execution time of 30 seconds exceeded"



If configure server on max_execution_time more 30 seconds (for example
3600), then after 30 secons server generated error "Fatal error: Maximum
execution time of 3600 seconds exceeded"



Sorry, im russian...

Test script:
---
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>



http://www.w3.org/1999/xhtml";>





  Uploading



















 File name: ' . $path['basename'];

}

  }

}

?>











Expected result:

File must be loaded on the server. (Im russian, sorry =))

Actual result:
--
File not loaded on the server.






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


Bug #51969 [Opn->Fbk]: fwrite returns 1 when trying to write to a locked file

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51969&edit=1

 ID:   51969
 Updated by:   f...@php.net
 Reported by:  scarduzio at gmail dot com
 Summary:  fwrite returns 1 when trying to write to a locked file
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Filesystem function related
 Operating System: Windows 7 x86
 PHP Version:  5.3.2

 New Comment:

>From the manual:

"It is also possible to add LOCK_NB as a bitmask to one of the above
operations if you don't want flock() to block while locking. (not
supported on Windows)"



Then again path "/cache/lockable.txt" doesn't look like windows - so
what OS are you using?



And while I know that's possibly not directly related to your problem -
please clarify.


Previous Comments:

[2010-06-01 23:45:32] scarduzio at gmail dot com

Description:

When I try to write any length string with fwrite using a file handle I
previously 

locked with flock, fwrite is of course unable to write, but will return


unexplicable value 1 instead of false.

Test script:
---
/*

   Run two instances of this script in a rapid sequence

*/



$fp1 = fopen("/cache/lockable.txt","w");

if(flock($fp1, LOCK_EX | LOCK_NB)){

echo "locked fp1\n";

sleep(20);

}else{

$res = fwrite($fp1, "ABCDE");

if(false === $res){

   echo "failed the write\n";   

}

echo "I managed! fwrite returned: "; print_r($res);

}

Expected result:

I expect to read "failed to write" when a second instance of the script
is run, 

since fwrite should return false as documentation says when fwrite is
not able to 

write.

Actual result:
--
fwrite returns integer 1.






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


Bug #52034 [Com]: PHP programmer

2010-06-10 Thread hettbox at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52034&edit=1

 ID:   52034
 Comment by:   hettbox at gmail dot com
 Reported by:  hettbox at gmail dot com
 Summary:  PHP programmer
 Status:   Feedback
 Type: Bug
 Package:  Unknown/Other Function
 Operating System: Windows 2008 x86
 PHP Version:  5.3.2

 New Comment:

Try!







Result: Fatal error: Maximum execution time of 30 seconds exceeded in
D:\wwwroot\host\tmp\check.php on line 4


Previous Comments:

[2010-06-10 11:41:46] hettbox at gmail dot com

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


[2010-06-10 11:41:36] hettbox at gmail dot com

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


[2010-06-10 11:15:54] ka...@php.net

Have you tried to increase the max_input_time php.ini setting?


[2010-06-09 19:22:07] hettbox at gmail dot com

On the PHP 5.3.1 its work!


[2010-06-09 19:17:27] hettbox at gmail dot com

Description:

If time for uploading file more than 30 seconds, then PHP reports an
error: "Fatal error: Maximum execution time of 30 seconds exceeded"



If configure server on max_execution_time more 30 seconds (for example
3600), then after 30 secons server generated error "Fatal error: Maximum
execution time of 3600 seconds exceeded"



Sorry, im russian...

Test script:
---
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>



http://www.w3.org/1999/xhtml";>





  Uploading



















 File name: ' . $path['basename'];

}

  }

}

?>











Expected result:

File must be loaded on the server. (Im russian, sorry =))

Actual result:
--
File not loaded on the server.






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


Bug #52034 [Com]: PHP programmer

2010-06-10 Thread hettbox at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52034&edit=1

 ID:   52034
 Comment by:   hettbox at gmail dot com
 Reported by:  hettbox at gmail dot com
 Summary:  PHP programmer
 Status:   Feedback
 Type: Bug
 Package:  Unknown/Other Function
 Operating System: Windows 2008 x86
 PHP Version:  5.3.2

 New Comment:




Previous Comments:

[2010-06-10 12:14:42] hettbox at gmail dot com

Try!







Result: Fatal error: Maximum execution time of 30 seconds exceeded in
D:\wwwroot\host\tmp\check.php on line 4


[2010-06-10 11:41:46] hettbox at gmail dot com

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


[2010-06-10 11:41:36] hettbox at gmail dot com

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


[2010-06-10 11:15:54] ka...@php.net

Have you tried to increase the max_input_time php.ini setting?


[2010-06-09 19:22:07] hettbox at gmail dot com

On the PHP 5.3.1 its work!




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/bug.php?id=52034


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


Bug #51969 [Fbk->Opn]: fwrite returns 1 when trying to write to a locked file

2010-06-10 Thread scarduzio at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=51969&edit=1

 ID:   51969
 User updated by:  scarduzio at gmail dot com
 Reported by:  scarduzio at gmail dot com
 Summary:  fwrite returns 1 when trying to write to a locked file
-Status:   Feedback
+Status:   Open
 Type: Bug
 Package:  Filesystem function related
 Operating System: Windows 7 x86
 PHP Version:  5.3.2

 New Comment:

Hi, thanks for replying.



The OS in use is Windows 7 x86 genuine with all windows updates. 

The path with forward slash that I use in my code is unix style because
I 

noticed 

PHP always translates it correctly into "C:\cache\lockable.txt", and
it's always 

been fine. Also this time, the file is always found.



About the manual line stating LOCK_NB bitmask is not supported: as
evinced from 

my tests, including this one, the use of LOCK_NB is behaving perfectly
since it 

detects file is locked, and executes my "else".



I also do not think LOCK_NB is the core of this problem since I could
split this 

script in two (one with the flock+sleep and the other with the "else"
content) 

and reproduce the same bug.



I later tested this in linux environment, fwrite will return 5 (not 1).
Which is 

still funny, since writing in a locked file should in my opinion return
false.



I look forward for your further analysis.

BR,



Simone


Previous Comments:

[2010-06-10 12:04:33] f...@php.net

>From the manual:

"It is also possible to add LOCK_NB as a bitmask to one of the above
operations if you don't want flock() to block while locking. (not
supported on Windows)"



Then again path "/cache/lockable.txt" doesn't look like windows - so
what OS are you using?



And while I know that's possibly not directly related to your problem -
please clarify.


[2010-06-01 23:45:32] scarduzio at gmail dot com

Description:

When I try to write any length string with fwrite using a file handle I
previously 

locked with flock, fwrite is of course unable to write, but will return


unexplicable value 1 instead of false.

Test script:
---
/*

   Run two instances of this script in a rapid sequence

*/



$fp1 = fopen("/cache/lockable.txt","w");

if(flock($fp1, LOCK_EX | LOCK_NB)){

echo "locked fp1\n";

sleep(20);

}else{

$res = fwrite($fp1, "ABCDE");

if(false === $res){

   echo "failed the write\n";   

}

echo "I managed! fwrite returned: "; print_r($res);

}

Expected result:

I expect to read "failed to write" when a second instance of the script
is run, 

since fwrite should return false as documentation says when fwrite is
not able to 

write.

Actual result:
--
fwrite returns integer 1.






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


Bug #51912 [Opn->Bgs]: system(): Unable to fork

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51912&edit=1

 ID:   51912
 Updated by:   f...@php.net
 Reported by:  z0ned at hotmail dot com
 Summary:  system(): Unable to fork
-Status:   Open
+Status:   Bogus
 Type: Bug
 Package:  Program Execution
 Operating System: Ubuntu Linux 10.04LTS Lucid
 PHP Version:  5.3.2

 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

PHP 5.3.2-1ubuntu4.2 is the Ubuntu version of PHP.

Please try the release from php.net, the current svn snapshot or report
bugs to Ubuntu.


Previous Comments:

[2010-05-26 01:47:59] z0ned at hotmail dot com

/etc/php5/cli/php.ini has:

safe_mode = Off

disable_functions =


[2010-05-26 01:19:52] z0ned at hotmail dot com

Description:

On an Ubuntu 10.04LTS Lucid system with PHP 5.3.2-1ubuntu4.2



Running from the command line: php some_script.php



Calling within: system('/usr/bin/php a_script.php');



Getting:



PHP Warning:  system(): Unable to fork [/usr/bin/php a_script.php] in
/path/to/some_script.php on line 258



I've seen plenty of bug reports for Windows users but this is under
Linux and I don't see any open reports for Linux.



Expected result:

On a different Ubuntu 9.10 Karmic system with PHP 5.2.10-2ubuntu6.4, the
same code works fine, e.g. a_script.php is executed and the output is
displayed.



Actual result:
--
The script specified in the system() call is not executed and no output
is displayed, just the "Unable to fork" warning.








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


Req #43822 [Com]: Allow ini_set('include_path', ??) even when php_admin_value include_path is set

2010-06-10 Thread jo at feuersee dot de
Edit report at http://bugs.php.net/bug.php?id=43822&edit=1

 ID:   43822
 Comment by:   jo at feuersee dot de
 Reported by:  birne at 007mail dot de
 Summary:  Allow ini_set('include_path', ??) even when
   php_admin_value include_path is set
 Status:   Open
 Type: Feature/Change Request
 Package:  Feature/Change Request
 Operating System: Ubuntu Linux 7.10
 PHP Version:  5.2.5

 New Comment:

PHP 5.3.2

As derernst corretly stated, using set_include_path() instead of
ini_set() 

does not make any difference.

This behavior doesn't add any security (as you can still include files 

anywhere as long as open_basedir allows it), but limits convenience (eg.


adding a framework, writing custom autoloader functions, ...)


Previous Comments:

[2009-03-20 13:13:10] derernst at gmx dot ch

Using set_include_path() instead of ini_set('include_path') does not
seem to make a difference.



I consider this change, that disables setting the include_path at
runtime, a severe backwards compatibility break. For example it can make
an application that relies on a manual PEAR installation unuseable. This
is a problem specially in shared hosting environments, where you usually
can't control the server configuration.


[2008-01-11 21:59:31] der...@php.net

I think you can use set_include_path() for this:
http://no.php.net/manual/en/function.set-include-path.php


[2008-01-11 20:55:42] birne at 007mail dot de

Description:

After the patch for #41561 was applied, ini_set() could no longer
overwrite any configuration value that was previously defined using
php_admin_*. 



In #43598 sniper wrote: php_admin_* is supposed to make any such option
unusable by anybody in any script. And it's meant for hosting
companies.



I agree, that in a hosting environment no customer should be able to
overwrite configuration like open_basedir. But there is no harm in
allowing the customer to change include_path; on the contrary is it of
great use for the customer to add his own libraries.



Before the #41561 patch was applied, this was already possible for years
and that was no bug, because overwriting open_basedir was not possible
at all.



I suggest to define another "Changeable" scope (see
http://php.net/manual/en/ini.php) for configuration values like
"PHP_INI_OVERWRITEABLE" wich behaves like "PHP_INI_ALL" but in addition
to that can be overwritten using ini_set() even when previously defined
using php_admin_*. The inlude_path would be one of the new
PHP_INI_OVERWRITEABLE directives, additional harmless ones must be
defined.



Please make sure to properly document that change - the new behavior of
the patch for #41561 is still not documented anywhere (or I did not find
it..)







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


Bug #51822 [Asn->Csd]: Segfault with strange __destruct() for static class variables

2010-06-10 Thread dmitry
Edit report at http://bugs.php.net/bug.php?id=51822&edit=1

 ID:   51822
 Updated by:   dmi...@php.net
 Reported by:  daan at react dot com
 Summary:  Segfault with strange __destruct() for static class
   variables
-Status:   Assigned
+Status:   Closed
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Debian Etch
 PHP Version:  5.2.13
 Assigned To:  dmitry

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2010-06-10 13:45:53] dmi...@php.net

Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=300350
Log: Fixed bug #51822i (Segfault with strange __destruct() for static
class variables)


[2010-05-14 15:20:44] daan at react dot com

Reference to bugreport at xdebug:

http://bugs.xdebug.org/view.php?id=580


[2010-05-14 15:14:51] daan at react dot com

Hmm looks like it might be xdebug related.. 

"#1  0xb739e2f2 in xdebug_execute (op_array=0x9ce5214) at
/tmp/pear/temp/xdebug/xdebug.c:1392"



I tried it on a non-xdebug php 5.2.10, and that had no problems - the
5.3.1 I tested with did not have xdebug installed either.



Will throw the bug that way then.. apologies for the misdirected bug
report!


[2010-05-14 15:04:40] daan at react dot com

JIC you still need it - a trace:



#0  0x0837f473 in zend_hash_find (ht=0x9ce0398, arKey=0xb73babed "",
nKeyLength=5, pData=0xbfc0ea7c)

at /usr/src/php-5.2.13/Zend/zend_hash.c:880

#1  0xb739e2f2 in xdebug_execute (op_array=0x9ce5214) at
/tmp/pear/temp/xdebug/xdebug.c:1392

#2  0x08368c20 in zend_call_function (fci=0xbfc0ebec,
fci_cache=0xbfc0ec10)

at /usr/src/php-5.2.13/Zend/zend_execute_API.c:1039

#3  0x08387b2c in zend_call_method (object_pp=0xbfc0ec94,
obj_ce=0x9ce3c0c, fn_proxy=0xbfc0ec98, 

function_name=0x8638cb8 "__destruct", function_name_len=10,
retval_ptr_ptr=0x0, param_count=0, arg1=0x0, 

arg2=0x0) at /usr/src/php-5.2.13/Zend/zend_interfaces.c:88

#4  0x0838da67 in zend_objects_destroy_object (object=0x9ce4898,
handle=1)

at /usr/src/php-5.2.13/Zend/zend_objects.c:101

#5  0x08390d30 in zend_objects_store_del_ref_by_handle (handle=1)

at /usr/src/php-5.2.13/Zend/zend_objects_API.c:198

#6  0x08390d75 in zend_objects_store_del_ref (zobject=0x9ce22c4)

at /usr/src/php-5.2.13/Zend/zend_objects_API.c:169

#7  0x08367ee9 in _zval_ptr_dtor (zval_ptr=0x9ce4928) at
/usr/src/php-5.2.13/Zend/zend_variables.h:35

#8  0x0837e245 in zend_hash_destroy (ht=0x9ce48ec) at
/usr/src/php-5.2.13/Zend/zend_hash.c:526

#9  0x0838dc07 in zend_object_std_dtor (object=0x9ce3284) at
/usr/src/php-5.2.13/Zend/zend_objects.c:45

#10 0x0838dc40 in zend_objects_free_object_storage (object=0x9ce3284)

at /usr/src/php-5.2.13/Zend/zend_objects.c:122

#11 0x08390d52 in zend_objects_store_del_ref_by_handle (handle=2)

at /usr/src/php-5.2.13/Zend/zend_objects_API.c:211

#12 0x08390d75 in zend_objects_store_del_ref (zobject=0x9ce48d4)

at /usr/src/php-5.2.13/Zend/zend_objects_API.c:169

#13 0x08367ee9 in _zval_ptr_dtor (zval_ptr=0x9ce46f8) at
/usr/src/php-5.2.13/Zend/zend_variables.h:35

#14 0x0837e245 in zend_hash_destroy (ht=0x9ce4548) at
/usr/src/php-5.2.13/Zend/zend_hash.c:526

#15 0x0836c123 in destroy_zend_class (pce=0x9d1a78c) at
/usr/src/php-5.2.13/Zend/zend_opcode.c:184

#16 0x0837de9c in zend_hash_apply_deleter (ht=0x9b136a0, p=0x9d1a780)

at /usr/src/php-5.2.13/Zend/zend_hash.c:611

#17 0x0837dfcb in zend_hash_reverse_apply (ht=0x9b136a0,
apply_func=0x83675b0 )

at /usr/src/php-5.2.13/Zend/zend_hash.c:760

#18 0x0836a8b6 in shutdown_executor () at
/usr/src/php-5.2.13/Zend/zend_execute_API.c:291

#19 0x083752e4 in zend_deactivate () at
/usr/src/php-5.2.13/Zend/zend.c:860

#20 0x083356eb in php_request_shutdown (dummy=0x0) at
/usr/src/php-5.2.13/main/main.c:1504

#21 0x083e0872 in main (argc=2, argv=0xbfc0f4f4) at
/usr/src/php-5.2.13/sapi/cli/php_cli.c:1346


[2010-05-14 15:00:16] fel...@php.net

In fact I got something on Valgring log:



Invalid write & read and:

==5285==  Address 0x65f0ba4 is 4 bytes inside a block of size 256
free'd

==5285==at 0x4024866: free (vg_replace_malloc.c:325)

==5285==by 0x83ACBD6: _efree (zend_alloc.c:2308)

==5285==by 0x83CD787: zend_ptr_stack_destroy (zend_ptr_stack.c:74)

==5285==by 0x83BE48B: shutdown_executor (zend_execute_API.c:283)

==5

[PHP-BUG] Bug #52039 [NEW]: Closure problem with 5.3.2

2010-06-10 Thread neto dot joaobatista at gmail dot com
From: 
Operating system: Linux, Fedora 13 64 bits
PHP version:  5.3.2
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:Closure problem with 5.3.2

Description:

NULL when using Closures with "use" keyword in PHP 5.3.2

Test script:
---


  array(1) {

["test"]=>

string(12) "Closure test"

  }

}

Actual result:
--
PHP 5.3.2 output:



string(5) "5.3.2"

NULL

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52039&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52039&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52039&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52039&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52039&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52039&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52039&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52039&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52039&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52039&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52039&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52039&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52039&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52039&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52039&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52039&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52039&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52039&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52039&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52039&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52039&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52039&r=mysqlcfg



Bug #52039 [Opn->Fbk]: Closure problem with 5.3.2

2010-06-10 Thread degeberg
Edit report at http://bugs.php.net/bug.php?id=52039&edit=1

 ID:   52039
 Updated by:   degeb...@php.net
 Reported by:  neto dot joaobatista at gmail dot com
 Summary:  Closure problem with 5.3.2
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Linux, Fedora 13 64 bits
 PHP Version:  5.3.2

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I get the following output:



string(9) "5.3.3-dev"

object(Closure)#1 (1) {

  ["static"]=>

  array(1) {

["test"]=>

string(12) "Closure test"

  }

}


Previous Comments:

[2010-06-10 13:53:26] neto dot joaobatista at gmail dot com

Description:

NULL when using Closures with "use" keyword in PHP 5.3.2

Test script:
---


  array(1) {

["test"]=>

string(12) "Closure test"

  }

}

Actual result:
--
PHP 5.3.2 output:



string(5) "5.3.2"

NULL






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


Bug #52034 [Com]: PHP programmer

2010-06-10 Thread hettbox at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52034&edit=1

 ID:   52034
 Comment by:   hettbox at gmail dot com
 Reported by:  hettbox at gmail dot com
 Summary:  PHP programmer
 Status:   Feedback
 Type: Bug
 Package:  Unknown/Other Function
 Operating System: Windows 2008 x86
 PHP Version:  5.3.2

 New Comment:

This problem detected on WINDOWS only.


Previous Comments:

[2010-06-10 12:19:37] hettbox at gmail dot com




[2010-06-10 12:14:42] hettbox at gmail dot com

Try!







Result: Fatal error: Maximum execution time of 30 seconds exceeded in
D:\wwwroot\host\tmp\check.php on line 4


[2010-06-10 11:41:46] hettbox at gmail dot com

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


[2010-06-10 11:41:36] hettbox at gmail dot com

If configure server on max_execution_time more 30 seconds 

(for example 3600), then !!!after 30 secons!!! 

server generated error "Fatal error: Maximum 

execution time of !!!3600 seconds!!! exceeded"



Server generating error on max_execution_time!



Плохо с английским. Попробую по русски.


Во время выполнения скрипта не должно
входить время на загрузку файла, на
сколько мне известно. В предыдущих
версиях PHP так и было, но в версии PHP 5.3.2
по каким-то непонятным причинам это
стало учитываться.


[2010-06-10 11:15:54] ka...@php.net

Have you tried to increase the max_input_time php.ini setting?




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/bug.php?id=52034


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


Bug #51969 [Opn]: fwrite returns 1 when trying to write to a locked file

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=51969&edit=1

 ID:   51969
 Updated by:   f...@php.net
 Reported by:  scarduzio at gmail dot com
 Summary:  fwrite returns 1 when trying to write to a locked file
 Status:   Open
 Type: Bug
 Package:  Filesystem function related
 Operating System: Windows 7 x86
 PHP Version:  5.3.2

 New Comment:

Ah, ok, thank you for the clarification.



Tried to reproduce now, indeed fwrite in the else clause ignores the
flock() - but then again you already checked if there is a lock, that is
exactly why you are in the else code path, so I'm not exactly sure how
flock *should* behave ...



Trying to open the locked file gives a windows warning that the file is
indeed locked, though.



Same result with PHP 5.3.2 (cli) on Debian lenny, btw - minus the
warning on accessing the file directly.


Previous Comments:

[2010-06-10 12:26:50] scarduzio at gmail dot com

Hi, thanks for replying.



The OS in use is Windows 7 x86 genuine with all windows updates. 

The path with forward slash that I use in my code is unix style because
I 

noticed 

PHP always translates it correctly into "C:\cache\lockable.txt", and
it's always 

been fine. Also this time, the file is always found.



About the manual line stating LOCK_NB bitmask is not supported: as
evinced from 

my tests, including this one, the use of LOCK_NB is behaving perfectly
since it 

detects file is locked, and executes my "else".



I also do not think LOCK_NB is the core of this problem since I could
split this 

script in two (one with the flock+sleep and the other with the "else"
content) 

and reproduce the same bug.



I later tested this in linux environment, fwrite will return 5 (not 1).
Which is 

still funny, since writing in a locked file should in my opinion return
false.



I look forward for your further analysis.

BR,



Simone


[2010-06-10 12:04:33] f...@php.net

>From the manual:

"It is also possible to add LOCK_NB as a bitmask to one of the above
operations if you don't want flock() to block while locking. (not
supported on Windows)"



Then again path "/cache/lockable.txt" doesn't look like windows - so
what OS are you using?



And while I know that's possibly not directly related to your problem -
please clarify.


[2010-06-01 23:45:32] scarduzio at gmail dot com

Description:

When I try to write any length string with fwrite using a file handle I
previously 

locked with flock, fwrite is of course unable to write, but will return


unexplicable value 1 instead of false.

Test script:
---
/*

   Run two instances of this script in a rapid sequence

*/



$fp1 = fopen("/cache/lockable.txt","w");

if(flock($fp1, LOCK_EX | LOCK_NB)){

echo "locked fp1\n";

sleep(20);

}else{

$res = fwrite($fp1, "ABCDE");

if(false === $res){

   echo "failed the write\n";   

}

echo "I managed! fwrite returned: "; print_r($res);

}

Expected result:

I expect to read "failed to write" when a second instance of the script
is run, 

since fwrite should return false as documentation says when fwrite is
not able to 

write.

Actual result:
--
fwrite returns integer 1.






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


[PHP-BUG] Bug #52040 [NEW]: Fatal error (undefined function) not reported when php within html tag's attr

2010-06-10 Thread michal_musial at o2 dot pl
From: 
Operating system: Windows 7 Ultimate (any?)
PHP version:  5.3.2
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:Fatal error (undefined function) not reported when php within 
html tag's attr

Description:

PHP does not print Fatal error when an undefined function is called from
within a 

html tag's attribute.

Error is saved to php error log if one is specified in php.ini, but there's


nothing being printed. Execution ends at the line preceding the line
containing 

the undefined function.

Test script:
---
p1

p2

p3

Expected result:

p1 

http://bugs.php.net/bug.php?id=52040&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52040&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52040&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52040&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52040&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52040&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52040&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52040&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52040&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52040&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52040&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52040&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52040&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52040&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52040&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52040&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52040&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52040&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52040&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52040&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52040&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52040&r=mysqlcfg



Bug #52038 [Com]: zend_mm_heap corrupted at end of program

2010-06-10 Thread gar37bic at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52038&edit=1

 ID:   52038
 Comment by:   gar37bic at gmail dot com
 Reported by:  gar37bic at gmail dot com
 Summary:  zend_mm_heap corrupted at end of program
 Status:   Feedback
 Type: Bug
 Package:  Reproducible crash
 Operating System: Linux Ubuntu 10.0.0.4
 PHP Version:  5.3.2

 New Comment:

I can work on building and running under Apache next week but not before
then.  This program was built as a CLI program but I can hack in the
necessaries to run it from Apache, once I get Apache built that way.



One additional bit of info, but it is probably not relevant - During
development I normally have set error_reporting(-1).  I have to turn
'STRICT' error reporting off (E_ALL & ~E_STRICT) while I'm running the
XML_Serializer module, because of a large number of complaints about
deprecated static function assignments (I forget the details).  As soon
as the serialization is complete I restore the original setting.


Previous Comments:

[2010-06-10 11:13:09] ka...@php.net

Any chance you can compile apache with debugging symbols so we can see
if it segfaults in any of the apache shutdown functions, or the sapi you
use as i dont except it to be CLI looking at the bt?


[2010-06-09 21:39:30] gar37bic at gmail dot com

Description:

I'm posting as a crash, even though the program completes its work
before segfaulting.



I have a large, complex PHP command-line program that uses PHPExcel to
read spreadsheet files, builds large data arrays, then uses
XML_Serializer to generate XML, and writes the XML to a file.  The main
program is primarily a sequential class loader, that reads in about 40
class files.  It also uses getopt() to parse command line options. 
Maximum memory use is around 300-400 megabytes.



This program works fine.  However, under certain circumstances
(including my 'verbose' logging output option, which generates 60,000
lines of log data), the program completes its work but after the final
line of output, it says 'zend_mm_heap corrupted'.



Whether this occurs depends on the input spreadsheet, and is not
directly related to the size of the sheet or the size of the output XML,
or the maximum memory used. 



I have found that, for the spreadsheet that generates the error, by
changing one array element in the default command line option
definitions, I can turn the error on and off.



If I run the program as 'php my_program.php -blah', it acts the same as
if I run it directly as 'my_program.php -blah'.  However, if I run the
program as 'php -e my_program.php -blah' I never get the zend message.



I have run this under gdb using php -e to get a stack.  Under gdb it
segfaults for both versions of the program.  The stack is identical for
both versions of the program and the zend_mm_heap message does not
appear.



Here the is the gdb stack.  (The first line is the ending line of my
program.)



Program ending with status 0x0, 0 warnings and 0 errors



Program received signal SIGSEGV, Segmentation fault.

0x006b549f in ?? ()

(gdb) bt

#0  0x006b549f in ?? ()

#1  0x006b59fb in ?? ()

#2  0x006a1e4e in zend_hash_destroy ()

#3  0x00694e2f in _zval_dtor_func ()

#4  0x00688e5d in _zval_ptr_dtor ()

#5  0x006a1e28 in zend_hash_destroy ()

#6  0x006b6d69 in zend_object_std_dtor ()

#7  0x006b6d89 in zend_objects_free_object_storage ()

#8  0x006ba27c in zend_objects_store_free_object_storage ()

#9  0x00689255 in ?? ()

#10 0x00695b72 in ?? ()

#11 0x00641825 in php_request_shutdown ()

#12 0x00725314 in ?? ()

#13 0x752a7c4d in __libc_start_main (main=,


argc=, ubp_av=, 

init=, fini=, 

rtld_fini=, stack_end=0x7fffe218)

at libc-start.c:226

#14 0x0042c639 in _start ()





Unfortunately, I can not post the code or the data.  It's large, and
it's confidential, and the problem has appeared and disappeared with
minor code changes over the last week so I don't think I can reduce it. 
However if anyone has any ideas, I'd be willing to help as much as I
can.



Loaded modules: core mod_log_config mod_logio prefork http_core mod_so
mod_alias mod_auth_basic mod_authn_file mod_authz_default
mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi
mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_python
mod_reqtimeout mod_setenvif mod_ssl mod_status mod_userdir 

Expected result:

I don't expect to see 'zend_mm_heap corrupted'







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


Bug #52040 [Opn]: Fatal error (undefined function) not reported when php within html tag's attr

2010-06-10 Thread michal_musial at o2 dot pl
Edit report at http://bugs.php.net/bug.php?id=52040&edit=1

 ID:   52040
 User updated by:  michal_musial at o2 dot pl
 Reported by:  michal_musial at o2 dot pl
 Summary:  Fatal error (undefined function) not reported when php
   within html tag's attr
 Status:   Open
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Windows 7 Ultimate (any?)
 PHP Version:  5.3.2

 New Comment:

Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache
2.2.13.

Same problem.


Previous Comments:

[2010-06-10 16:41:49] michal_musial at o2 dot pl

Description:

PHP does not print Fatal error when an undefined function is called from
within a 

html tag's attribute.

Error is saved to php error log if one is specified in php.ini, but
there's 

nothing being printed. Execution ends at the line preceding the line
containing 

the undefined function.

Test script:
---
p1

p2

p3

Expected result:

p1 

http://bugs.php.net/bug.php?id=52040&edit=1


Bug #52040 [Opn->Fbk]: Fatal error (undefined function) not reported when php within html tag's attr

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=52040&edit=1

 ID:   52040
 Updated by:   f...@php.net
 Reported by:  michal_musial at o2 dot pl
 Summary:  Fatal error (undefined function) not reported when php
   within html tag's attr
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Windows 7 Ultimate (any?)
 PHP Version:  5.3.2

 New Comment:

Can't reproduce with the VC9 build of 5.3.2 from windows.php.net in CLI
mode.

Are you sure you have no special php.ini settings (like auto_prepend) or
anything related to output buffering?



This really looks like a configuration issue at first glance.


Previous Comments:

[2010-06-10 16:48:23] michal_musial at o2 dot pl

Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache
2.2.13.

Same problem.


[2010-06-10 16:41:49] michal_musial at o2 dot pl

Description:

PHP does not print Fatal error when an undefined function is called from
within a 

html tag's attribute.

Error is saved to php error log if one is specified in php.ini, but
there's 

nothing being printed. Execution ends at the line preceding the line
containing 

the undefined function.

Test script:
---
p1

p2

p3

Expected result:

p1 

http://bugs.php.net/bug.php?id=52040&edit=1


Bug #52040 [Fbk->Opn]: Fatal error (undefined function) not reported when php within html tag's attr

2010-06-10 Thread michal_musial at o2 dot pl
Edit report at http://bugs.php.net/bug.php?id=52040&edit=1

 ID:   52040
 User updated by:  michal_musial at o2 dot pl
 Reported by:  michal_musial at o2 dot pl
 Summary:  Fatal error (undefined function) not reported when php
   within html tag's attr
-Status:   Feedback
+Status:   Open
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Windows 7 Ultimate (any?)
 PHP Version:  5.3.2

 New Comment:

I'm no expert in php config, so it's entirely possible.

Have a look at my config:

http://mmusial.nazwa.pl/php.ini


Previous Comments:

[2010-06-10 17:07:10] f...@php.net

Can't reproduce with the VC9 build of 5.3.2 from windows.php.net in CLI
mode.

Are you sure you have no special php.ini settings (like auto_prepend) or
anything related to output buffering?



This really looks like a configuration issue at first glance.


[2010-06-10 16:48:23] michal_musial at o2 dot pl

Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache
2.2.13.

Same problem.


[2010-06-10 16:41:49] michal_musial at o2 dot pl

Description:

PHP does not print Fatal error when an undefined function is called from
within a 

html tag's attribute.

Error is saved to php error log if one is specified in php.ini, but
there's 

nothing being printed. Execution ends at the line preceding the line
containing 

the undefined function.

Test script:
---
p1

p2

p3

Expected result:

p1 

http://bugs.php.net/bug.php?id=52040&edit=1


Bug #52039 [Com]: Closure problem with 5.3.2

2010-06-10 Thread neto dot joaobatista at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=52039&edit=1

 ID:   52039
 Comment by:   neto dot joaobatista at gmail dot com
 Reported by:  neto dot joaobatista at gmail dot com
 Summary:  Closure problem with 5.3.2
 Status:   Feedback
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Linux, Fedora 13 64 bits
 PHP Version:  5.3.2

 New Comment:

New information,



PHP: 5.3.0, 5.3.2 and 5.3.3 works fine as CLI



Output from 5.3.3



string(9) "5.3.3-dev"

object(Closure)#1 (1) {

  ["static"]=>

  array(1) {

["test"]=>

string(12) "Closure test"

  }

}



Using PHP 5.3.3-dev as CGI works too:



string(9) "5.3.3-dev"

object(Closure)#1 (1) {

  ["static"]=>

  array(1) {

["test"]=>

string(12) "Closure test"

  }

}



I just couldn't test 5.3.3-dev as Apache module yet, but 5.3.2 doesn't
work as module, giving me:



string(5) "5.3.2"

NULL



Server Version: Apache/2.2.15 (Unix) DAV/2 PHP/5.3.2 mod_python/3.3.1
Python/2.6.4 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_perl/2.0.4
Perl/v5.10.1


Previous Comments:

[2010-06-10 14:09:48] degeb...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I get the following output:



string(9) "5.3.3-dev"

object(Closure)#1 (1) {

  ["static"]=>

  array(1) {

["test"]=>

string(12) "Closure test"

  }

}


[2010-06-10 13:53:26] neto dot joaobatista at gmail dot com

Description:

NULL when using Closures with "use" keyword in PHP 5.3.2

Test script:
---


  array(1) {

["test"]=>

string(12) "Closure test"

  }

}

Actual result:
--
PHP 5.3.2 output:



string(5) "5.3.2"

NULL






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


Bug #52040 [Opn->Fbk]: Fatal error (undefined function) not reported when php within html tag's attr

2010-06-10 Thread fa
Edit report at http://bugs.php.net/bug.php?id=52040&edit=1

 ID:   52040
 Updated by:   f...@php.net
 Reported by:  michal_musial at o2 dot pl
 Summary:  Fatal error (undefined function) not reported when php
   within html tag's attr
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Windows 7 Ultimate (any?)
 PHP Version:  5.3.2

 New Comment:

Please try
http://windows.php.net/downloads/releases/php-5.3.2-nts-Win32-VC9-x86.zip
with the php.ini-production and try to reproduce


Previous Comments:

[2010-06-10 17:13:33] michal_musial at o2 dot pl

I'm no expert in php config, so it's entirely possible.

Have a look at my config:

http://mmusial.nazwa.pl/php.ini


[2010-06-10 17:07:10] f...@php.net

Can't reproduce with the VC9 build of 5.3.2 from windows.php.net in CLI
mode.

Are you sure you have no special php.ini settings (like auto_prepend) or
anything related to output buffering?



This really looks like a configuration issue at first glance.


[2010-06-10 16:48:23] michal_musial at o2 dot pl

Also tested it on FreeBSD 7.2-RELEASE with PHP 5.2.11 and Apache
2.2.13.

Same problem.


[2010-06-10 16:41:49] michal_musial at o2 dot pl

Description:

PHP does not print Fatal error when an undefined function is called from
within a 

html tag's attribute.

Error is saved to php error log if one is specified in php.ini, but
there's 

nothing being printed. Execution ends at the line preceding the line
containing 

the undefined function.

Test script:
---
p1

p2

p3

Expected result:

p1 

http://bugs.php.net/bug.php?id=52040&edit=1


[PHP-BUG] Bug #52041 [NEW]: Memory leak when writing on uninitialized variable returned from function

2010-06-10 Thread fel...@php.net
From: felipe
Operating system: Linux
PHP version:  Irrelevant
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:Memory leak when writing on uninitialized variable returned 
from function

Description:

See below.

Test script:
---
a = 1;

Expected result:

No memory leak.

Actual result:
--
Zend/zend_execute.c(723) :  Freeing 0x0A395E1C (20 bytes),
script=../bug.php

=== Total 1 memory leaks detected ===

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52041&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52041&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52041&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52041&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52041&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52041&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52041&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52041&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52041&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52041&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52041&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52041&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52041&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52041&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52041&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52041&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52041&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52041&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52041&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52041&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52041&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52041&r=mysqlcfg



Bug #52041 [Opn->Asn]: Memory leak when writing on uninitialized variable returned from function

2010-06-10 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52041&edit=1

 ID:   52041
 Updated by:   fel...@php.net
 Reported by:  fel...@php.net
 Summary:  Memory leak when writing on uninitialized variable
   returned from function
-Status:   Open
+Status:   Assigned
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Linux
-PHP Version:  Irrelevant
+PHP Version:  5.2, 5.3, Trunk
-Assigned To:  
+Assigned To:  dmitry



Previous Comments:

[2010-06-10 19:18:05] fel...@php.net

Description:

See below.

Test script:
---
a = 1;

Expected result:

No memory leak.

Actual result:
--
Zend/zend_execute.c(723) :  Freeing 0x0A395E1C (20 bytes),
script=../bug.php

=== Total 1 memory leaks detected ===






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


Bug #52041 [Asn]: Memory leak when writing on uninitialized variable returned from function

2010-06-10 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=52041&edit=1

 ID:   52041
 Updated by:   fel...@php.net
 Reported by:  fel...@php.net
 Summary:  Memory leak when writing on uninitialized variable
   returned from function
 Status:   Assigned
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: Linux
 PHP Version:  5.2, 5.3, Trunk
 Assigned To:  dmitry

 New Comment:

It is also reproducible with:

foo()[] = 1;


Previous Comments:

[2010-06-10 19:18:05] fel...@php.net

Description:

See below.

Test script:
---
a = 1;

Expected result:

No memory leak.

Actual result:
--
Zend/zend_execute.c(723) :  Freeing 0x0A395E1C (20 bytes),
script=../bug.php

=== Total 1 memory leaks detected ===






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


Bug #51988 [Opn]: No input file specfied when trying to exec any PHP script from Web Server

2010-06-10 Thread pedro dot galan at cscamaras dot es
Edit report at http://bugs.php.net/bug.php?id=51988&edit=1

 ID:   51988
 User updated by:  pedro dot galan at cscamaras dot es
 Reported by:  pedro dot galan at cscamaras dot es
 Summary:  No input file specfied when trying to exec any PHP
   script from Web Server
 Status:   Open
 Type: Bug
 Package:  CGI related
 Operating System: SunOS 5.8 sparc
 PHP Version:  5.2.13

 New Comment:

I've verfied that scripts using PHP Cli executable work fine with my Web
Server but the problem with PHP Cgi executable ramain the same.



So, PHP Cli allows to execute PHP scripts across Sun Java System Web
Server 6.1 but PHP Cgi products "no input file specified".


Previous Comments:

[2010-06-03 14:03:53] pedro dot galan at cscamaras dot es

Description:

When trying to run any PHP script from my Web Server (Sun Java System
Web Server 6.1) as CGI always get "No input file specified".



Configure options:



./configure  --with-curl --with-mysql=/usr/local/mysql
--prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/lib

-enable-force-cgi-redirect



Changed PUTS("No input file specifiedd.\n"); by
PUTS(zend_printf("%s",file_handle.filename)); at line 1947 in cgi_main.c
and what i can see at the browser is (null) so the problem is with
path_translated for sure.



I've a lot of PHPP4.1 scripts running at the same Web server so the
configurantion is the same. It is not too probalbe that the problem is
at the Web Server.



Thanks a lot.

Test script:
---
matrix /data/web_html/publicado/empresafamiliar/php5 425 #more
phpinfo5.php

#!/usr/local/bin/php5







Expected result:

I expect an HTML page with the result of the phpinfo function.

Actual result:
--
No input file specified








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


Bug #50374 [Com]: .user.ini subdirectory not working and problem with [PATH] in php.ini

2010-06-10 Thread jirka at pbox dot cz
Edit report at http://bugs.php.net/bug.php?id=50374&edit=1

 ID:   50374
 Comment by:   jirka at pbox dot cz
 Reported by:  tom_borgo at hotmail dot com
 Summary:  .user.ini subdirectory not working and problem with
   [PATH] in php.ini
 Status:   No Feedback
 Type: Bug
 Package:  Scripting Engine problem
 Operating System: XP SP3
 PHP Version:  5.3.1
 Assigned To:  pajoye

 New Comment:

Same issue with php 5.3.2 (CGI) on WinXP SP3. Build date Apr 1 2010
17:13:20.

.user.ini custom setting works in the directory where the ini file is
located, but 

has no effect in any of subdirectories.


Previous Comments:

[2009-12-11 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".


[2009-12-03 16:10:27] tom_borgo at hotmail dot com

Ok so i just tried with the 5.3.2-dev (Dec 3 2009 14:57:19) snapshot.



Problem .user.ini for php script in subdirectory is always the same.

/www/phpinfo.php -> take into account the /www/.user.ini

/www/administrator/phpinfo.php -> take NOT into account the
/www/.user.ini



For the [PATH] problem, i tried and problem is no more here.

So I tried again with 5.3.1, no more problem.

Problem is just with 5.3.0 (VC8 from ZendServer), so [PATH] problem is
just for ZendServer.

So we can forgot about the [PATH] problem.



But for the .user.ini, am i mistaken something ? Or is it a php problem
?



Thanks.

Thomas.


[2009-12-03 15:50:05] tom_borgo at hotmail dot com

To:  paj...@php.net



Yes I know it works only for CGI/FastCGI SAPI
(http://php.net/manual/en/configuration.file.per-user.php).

.user.ini works for me only for the directory where it is and without
any [PATH] section in the main php.ini.



I tried with a PHP downloaded from the php.net (5.3.1 NTS VC6 and i try
with VC9 too). It is the same as the one from ZendServer (VC8).

So problem is in ZendServer,but too in the last stable binary windows
compiled on the php.net website.



Is it a configuration problem on my side or does another people got the
same problems ?



I will try with the snapshot right now.

I keep you warning.

Thanks.

Thomas.


[2009-12-03 15:39:18] tom_borgo at hotmail dot com

Just a comment about the [PATH] section

It is said in http://php.net/ini.sections that directive in PATH section
overide custom and runtime ini directives. So I think it is in fact
normal that .user.ini don't change the display_errors flag.

But .user.ini are not parsed if [PATH] section are in the main php.ini
for other directory



Ex:

[PATH=/www2/]

display_errors = 1



/www/.user.ini is not more taken into account !

If i remove the PATH section (i put it inthe end of my php.ini),
.user.ini is taken into account.

Really strange...


[2009-12-03 15:39:18] paj...@php.net

It works only with the FastCGI SAPI, not apache. We don't support
ZendServer so I won't say what should work or not with their version.



Can you try using a snapshot please (FCGI VC9)?




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/bug.php?id=50374


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


Bug #51640 [Bgs]: Fwrite writes twice a text

2010-06-10 Thread spiderboy1989 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=51640&edit=1

 ID:   51640
 User updated by:  spiderboy1989 at gmail dot com
 Reported by:  spiderboy1989 at gmail dot com
 Summary:  Fwrite writes twice a text
 Status:   Bogus
 Type: Bug
 Package:  Filesystem function related
 Operating System: Windows XP
 PHP Version:  5.3.2

 New Comment:

No way... i tested again, the same code, the same code that was giving
me troubles... I tested the g_i_ivanov's code, and both are working!
This must be a joke... I didn't change php version, I didn't change the
code... This can't be true :/...



I'm sorry for wasting your time. If I see any weird behavior, I will let
you know it.


Previous Comments:

[2010-06-08 14:09:43] tony2...@php.net

Not reproducible.

Try providing a working example script, the one in the report doesn't
work.


[2010-06-01 10:19:44] g_i_ivanov at mail dot bg

I have the same problem: 



Windows XP Professional SP3, Apache/2.2.14, PHP 5.2.13 (cli)



code:

--

$fp = fopen("d:/Projects/test/logs/testfile.txt", "a");

fwrite($fp, date('c') . " - Sample text" . PHP_EOL);

fclose($fp);



result: 

--

2010-05-31T10:36:37+03:00 - Sample text

2010-05-31T10:36:37+03:00 - Sample text


[2010-04-23 01:57:42] spiderboy1989 at gmail dot com

Description:

I'm having troubles with fwrite() function. It is writing twice a text I
just need to write once. I searched in google for the same problem, and
I found the same bug reported here :
http://bugs.php.net/bug.php?id=21916, and here :
http://bugs.php.net/bug.php?id=16225, but neither of both was solved. 



This is how it writes into the file :



"First



Second



Hello world!

Hello world!

Third"



As you can see, the string "hello world!" is writed twice, and that
should not happen. Also, and this is weird, the line fwrite($op,
$lastLine); prints the text correctly, just once...



Test script:
---
$file = "test.txt";

$string = "Hello world!\r\n";

$op = fopen($file,"r+");

$exp = explode("\n", fread($op, filesize($file)));

$lastLine = end($exp);

fseek($op, -strlen($lastLine), SEEK_END);

fwrite($op, $string);

fwrite($op, $lastLine);

fclose($op);

Expected result:

The text should be writed just once.







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


Bug #50481 [Com]: Storing many SPLFixedArray in an array crashes

2010-06-10 Thread jan-phpbug at kantert dot net
Edit report at http://bugs.php.net/bug.php?id=50481&edit=1

 ID:   50481
 Comment by:   jan-phpbug at kantert dot net
 Reported by:  simon dot nuttall at gmail dot com
 Summary:  Storing many SPLFixedArray in an array crashes
 Status:   Feedback
 Type: Bug
 Package:  SPL related
 Operating System: Debian Linux www 2.6.26.2
 PHP Version:  5.3.1

 New Comment:

I can verify this on php 5.3.2 (Stock Ubuntu 10.04) and in php 5.3
latest (10.06.2010) on amd64. 2.6.32-22-server.


Previous Comments:

[2010-04-25 06:32:53] col...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




[2009-12-15 14:58:45] fel...@php.net

Program received signal SIGSEGV, Segmentation fault.

0x08543bad in gc_remove_from_buffer (zv=0x892722e, tsrm_ls=0x8925078) at
/home/felipe/dev/php5/Zend/zend_gc.h:189

189 root->next->prev = root->prev;

(gdb) bt

#0  0x08543bad in gc_remove_from_buffer (zv=0x892722e,
tsrm_ls=0x8925078) at /home/felipe/dev/php5/Zend/zend_gc.h:189

#1  gc_remove_zval_from_buffer (zv=0x892722e, tsrm_ls=0x8925078) at
/home/felipe/dev/php5/Zend/zend_gc.c:265

#2  0x0850c5f4 in _zval_ptr_dtor (zval_ptr=0x8ac8d2c,
__zend_filename=0x88f20d4 "/home/felipe/dev/php5/Zend/zend_variables.c",
__zend_lineno=175)

at /home/felipe/dev/php5/Zend/zend_execute_API.c:434

#3  0x0851bfbb in _zval_ptr_dtor_wrapper (zval_ptr=0x8ac8d2c) at
/home/felipe/dev/php5/Zend/zend_variables.c:175

#4  0x0852da55 in _zend_hash_index_update_or_next_insert (ht=0x8ac9d08,
h=0, pData=0x892723c, nDataSize=4, pDest=0x0, flag=1, 

__zend_filename=0x889aa4c
"/home/felipe/dev/php5/ext/spl/spl_fixedarray.c", __zend_lineno=161) at
/home/felipe/dev/php5/Zend/zend_hash.c:374

#5  0x083487b9 in spl_fixedarray_object_get_properties (obj=0x8ac9b90,
tsrm_ls=0x8925078) at
/home/felipe/dev/php5/ext/spl/spl_fixedarray.c:161

#6  0x08543d21 in zval_scan_black (pz=0x8ac9b90, tsrm_ls=0x8925078) at
/home/felipe/dev/php5/Zend/zend_gc.c:285

#7  0x08543de4 in zval_scan_black (pz=0x8ac9b90, tsrm_ls=0x8925078) at
/home/felipe/dev/php5/Zend/zend_gc.c:302

#8  0x08544453 in zval_scan (pz=0x8ac85ac, tsrm_ls=0x8925078) at
/home/felipe/dev/php5/Zend/zend_gc.c:435

#9  0x085447c8 in gc_scan_roots (tsrm_ls=0x8925078) at
/home/felipe/dev/php5/Zend/zend_gc.c:511

#10 0x08544d87 in gc_collect_cycles (tsrm_ls=0x8925078) at
/home/felipe/dev/php5/Zend/zend_gc.c:629

#11 0x085436d3 in gc_zval_possible_root (zv=0x8ac5618,
tsrm_ls=0x8925078) at /home/felipe/dev/php5/Zend/zend_gc.c:166

#12 0x0850c6ad in gc_zval_check_possible_root (zval_ptr=0x892adb0,
__zend_filename=0x88dd638 "/home/felipe/dev/php5/main/main.c",
__zend_lineno=1590)

at /home/felipe/dev/php5/Zend/zend_gc.h:183

#13 _zval_ptr_dtor (zval_ptr=0x892adb0, __zend_filename=0x88dd638
"/home/felipe/dev/php5/main/main.c", __zend_lineno=1590)

at /home/felipe/dev/php5/Zend/zend_execute_API.c:445

#14 0x08498f88 in php_request_shutdown (dummy=0x0) at
/home/felipe/dev/php5/main/main.c:1590

#15 0x085fecc5 in main (argc=2, argv=0xb6a4) at
/home/felipe/dev/php5/sapi/cli/php_cli.c:1373




[2009-12-15 14:23:23] simon dot nuttall at gmail dot com

Description:

The script generates a segmentation fault when $count > 9992.



I have tried it on three machines, and on one the problem only occurs
when $count > 9995.



Reproduce code:
---
$count = 9993;



$cache = array();



for($i = 0; $i < $count ; $i++) {



  $cache[$i] = new SplFixedArray(1);



}



echo 'Cache count: ' . count($cache);



Expected result:

Cache count: 9993

Actual result:
--
[Tue Dec 15 13:42:57 2009] [notice] child pid 10685 exit signal
Segmentation fault (11)








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


Bug #49143 [Com]: is_callable() and unnecessary backslash

2010-06-10 Thread alex dot howansky at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=49143&edit=1

 ID:   49143
 Comment by:   alex dot howansky at gmail dot com
 Reported by:  david at grudl dot com
 Summary:  is_callable() and unnecessary backslash
 Status:   Open
 Type: Bug
 Package:  Class/Object related
 Operating System: *
 PHP Version:  5.3.0

 New Comment:

This bug is still present in 5.3.2 and also affects instantiating a new
class 

from a string variable:



function __autoload($class)

{

echo "$class\n";

}



$obj = new MyProject\Thing();

// correct: MyProject\Thing



$obj = new \MyProject\Thing();

// correct: MyProject\Thing



$class = '\\MyProject\\Thing';

$obj = new $class();

// wrong: \MyProject\Thing


Previous Comments:

[2010-04-09 08:18:22] abca_b_cabcom at hotmail dot com

hi david, you are not in a namespace it is just a classname.


[2009-08-04 11:24:35] david at grudl dot com

The two same class invokes autoloader with different class name (maybe 

better term is non-canonicalized class name).



This means: every autoloader must call $name = ltrim($name, "\").



defined() removes leading "\" automatically, is_callable and 

method_exists do not.


[2009-08-04 11:16:07] j...@php.net

Yes, which problem..? I don't see any errors. 


[2009-08-04 00:34:46] david at grudl dot com

Tested with 5.3.1-dev (Sun, 02 Aug 2009 18:53:57 +), problem still 

exists.


[2009-08-03 16:19:59] david at grudl dot com

Description:

is_callable() and method_exists() may invoke autoloader with 
unnecessary namespace backslash.



\My\MyClass::func() is the same as My\MyClass::func().









Reproduce code:
---
function __autoload($name)

{

echo $name;

}



is_callable('\My\MyClass::func'); // ERROR



is_callable('My\MyClass::func'); // OK



method_exists('\My\MyClass', 'func'); // ERROR



method_exists('My\MyClass', 'func'); // OK



// defined works well:

defined('\My\MyClass::CONST'); // OK



defined('My\MyClass::CONST'); // OK





Expected result:

My\MyClass

My\MyClass



My\MyClass

My\MyClass



My\MyClass

My\MyClass

Actual result:
--
\My\MyClass

My\MyClass



\My\MyClass

My\MyClass



My\MyClass

My\MyClass






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


Bug #49143 [Opn->Csd]: is_callable() and unnecessary backslash

2010-06-10 Thread felipe
Edit report at http://bugs.php.net/bug.php?id=49143&edit=1

 ID:   49143
 Updated by:   fel...@php.net
 Reported by:  david at grudl dot com
 Summary:  is_callable() and unnecessary backslash
-Status:   Open
+Status:   Closed
 Type: Bug
 Package:  Class/Object related
 Operating System: *
 PHP Version:  5.3.0
-Assigned To:  
+Assigned To:  felipe

 New Comment:

This already was fixed for the next release.

See bug #50731



Thanks.


Previous Comments:

[2010-06-11 00:48:15] alex dot howansky at gmail dot com

This bug is still present in 5.3.2 and also affects instantiating a new
class 

from a string variable:



function __autoload($class)

{

echo "$class\n";

}



$obj = new MyProject\Thing();

// correct: MyProject\Thing



$obj = new \MyProject\Thing();

// correct: MyProject\Thing



$class = '\\MyProject\\Thing';

$obj = new $class();

// wrong: \MyProject\Thing


[2010-04-09 08:18:22] abca_b_cabcom at hotmail dot com

hi david, you are not in a namespace it is just a classname.


[2009-08-04 11:24:35] david at grudl dot com

The two same class invokes autoloader with different class name (maybe 

better term is non-canonicalized class name).



This means: every autoloader must call $name = ltrim($name, "\").



defined() removes leading "\" automatically, is_callable and 

method_exists do not.


[2009-08-04 11:16:07] j...@php.net

Yes, which problem..? I don't see any errors. 


[2009-08-04 00:34:46] david at grudl dot com

Tested with 5.3.1-dev (Sun, 02 Aug 2009 18:53:57 +), problem still 

exists.




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/bug.php?id=49143


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


[PHP-BUG] Bug #52042 [NEW]: Error creating MessageFormatter object with nested tags

2010-06-10 Thread zabruska at tugamail dot pt
From: 
Operating system: Ubuntu 9.10
PHP version:  5.3.2
Package:  *Languages/Translation
Bug Type: Bug
Bug description:Error creating MessageFormatter object with nested tags

Description:

Calling msgfmt_create(...) or new MessageFormatter(...) with patterns
having nested tags will return null.



Apparently the same happens with empty patterns, but returning NULL from an
object constructor is a SERIOUS bug.





Test script:
---
$f1 = new MessageFormatter('en_US', '{what is wrong {0} with this pattern
???}');

echo 'f1 is ', gettype($f1), PHP_EOL;



$f2 = MessageFormatter::create('en_US', '{what is wrong {0} with this
pattern ???}');

echo 'f2 is ', gettype($f2), PHP_EOL;



$f3 = msgfmt_create('en_US', '{what is wrong {0} with this pattern ???}');

echo 'f3 is ', gettype($f3), PHP_EOL;

Expected result:

f1 is object

f2 is object

f3 is object

Actual result:
--
f1 is NULL

f2 is NULL

f3 is NULL

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52042&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52042&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52042&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52042&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52042&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52042&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52042&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52042&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52042&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52042&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52042&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52042&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52042&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52042&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52042&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52042&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52042&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52042&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52042&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52042&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52042&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52042&r=mysqlcfg



Bug #52042 [Opn]: Error creating MessageFormatter object with nested tags

2010-06-10 Thread zabruska at tugamail dot pt
Edit report at http://bugs.php.net/bug.php?id=52042&edit=1

 ID:   52042
 User updated by:  zabruska at tugamail dot pt
 Reported by:  zabruska at tugamail dot pt
 Summary:  Error creating MessageFormatter object with nested
   tags
 Status:   Open
 Type: Bug
 Package:  *Languages/Translation
 Operating System: Ubuntu 9.10
 PHP Version:  5.3.2

 New Comment:

Escaping the tags makes no difference either


Previous Comments:

[2010-06-11 01:52:14] zabruska at tugamail dot pt

Description:

Calling msgfmt_create(...) or new MessageFormatter(...) with patterns
having nested tags will return null.



Apparently the same happens with empty patterns, but returning NULL from
an object constructor is a SERIOUS bug.





Test script:
---
$f1 = new MessageFormatter('en_US', '{what is wrong {0} with this
pattern ???}');

echo 'f1 is ', gettype($f1), PHP_EOL;



$f2 = MessageFormatter::create('en_US', '{what is wrong {0} with this
pattern ???}');

echo 'f2 is ', gettype($f2), PHP_EOL;



$f3 = msgfmt_create('en_US', '{what is wrong {0} with this pattern
???}');

echo 'f3 is ', gettype($f3), PHP_EOL;

Expected result:

f1 is object

f2 is object

f3 is object

Actual result:
--
f1 is NULL

f2 is NULL

f3 is NULL






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


[PHP-BUG] Bug #52043 [NEW]: GD doesn't recognize latest libJPEG version (8b)

2010-06-10 Thread php at group dot apple dot com
From: 
Operating system: all
PHP version:  5.3.2
Package:  GD related
Bug Type: Bug
Bug description:GD doesn't recognize latest libJPEG version (8b)

Description:

Building php-5.3.2 against libJPEGv8b (NOT 6b!) appears to be functional,
but php 

reports the wrong version number. The patch below adds an additional cast
to the 

switch statement.

Test script:
---
php -info | grep -i jpeg

Expected result:

libJPEG Version => 8b



Actual result:
--
libJPEG Version => unknown

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52043&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52043&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52043&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52043&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52043&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52043&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52043&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52043&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52043&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52043&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52043&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52043&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52043&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52043&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52043&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52043&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52043&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52043&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52043&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52043&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52043&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52043&r=mysqlcfg



Bug #52042 [Opn->Asn]: Error creating MessageFormatter object with nested tags

2010-06-10 Thread mike
Edit report at http://bugs.php.net/bug.php?id=52042&edit=1

 ID:   52042
 Updated by:   m...@php.net
 Reported by:  zabruska at tugamail dot pt
 Summary:  Error creating MessageFormatter object with nested
   tags
-Status:   Open
+Status:   Assigned
 Type: Bug
 Package:  *Languages/Translation
 Operating System: Ubuntu 9.10
 PHP Version:  5.3.2
-Assigned To:  
+Assigned To:  stas

 New Comment:

Constructors definitely should throw an Exception.


Previous Comments:

[2010-06-11 01:56:48] zabruska at tugamail dot pt

Escaping the tags makes no difference either


[2010-06-11 01:52:14] zabruska at tugamail dot pt

Description:

Calling msgfmt_create(...) or new MessageFormatter(...) with patterns
having nested tags will return null.



Apparently the same happens with empty patterns, but returning NULL from
an object constructor is a SERIOUS bug.





Test script:
---
$f1 = new MessageFormatter('en_US', '{what is wrong {0} with this
pattern ???}');

echo 'f1 is ', gettype($f1), PHP_EOL;



$f2 = MessageFormatter::create('en_US', '{what is wrong {0} with this
pattern ???}');

echo 'f2 is ', gettype($f2), PHP_EOL;



$f3 = msgfmt_create('en_US', '{what is wrong {0} with this pattern
???}');

echo 'f3 is ', gettype($f3), PHP_EOL;

Expected result:

f1 is object

f2 is object

f3 is object

Actual result:
--
f1 is NULL

f2 is NULL

f3 is NULL






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