#50145 [NEW]: srinatar

2009-11-11 Thread srina...@php.net
From: srina...@php.net
Operating system: solaris, linux
PHP version:  5.3.1RC3
PHP Bug Type: Reproducible crash
Bug description:  srinatar

Description:

with recent php 5.3.1 RC3, i noticed a crash when compiled with mbstring
and zend-multibyte and running the bug35634.phpt script found under
Zend/tests



Reproduce code:
---
'./configure' \
'--enable-cli' \
'--enable-mbstring' \
'--enable-zend-multibyte'

while running the test script Zend/tests/bug35634.phpt

?php
if (defined(pass3)) {

  class ErrorClass {
  }

} else if (defined(pass2)) {

  class TestClass {
function __construct() {
}
function TestClass() {
  $this-__construct();
}
  }

} else {

  function errorHandler($errorNumber, $errorMessage, $fileName,
$lineNumber) {
define(pass3, 1);
include(__FILE__);
die(Error: $errorMessage ($fileName:$lineNumber)\n);
  }

  set_error_handler('errorHandler');
  define(pass2, 1);
  include(__FILE__);
}
?


Expected result:

Error: Redefining already defined constructor for class TestClass
(/tmp/c.php:12)

Actual result:
--
here is the stack trace of this crash..


@1 (l...@1) program terminated by signal SEGV (no mapping at the fault
address)
Current function is _zend_mm_alloc_int
 1892   ZEND_MM_CHECK_BLOCK_LINKAGE(best_fit);
(dbx 1) where 
current thread: t...@1
=[1] _zend_mm_alloc_int(heap = 0x8b7f2f0, size = 496U), line 1892 in
zend_alloc.c
  [2] _emalloc(size = 496U), line 2295 in zend_alloc.c
  [3] open_file_for_scanning(file_handle = 0x80454f8), line 272 in
zend_language_scanner.l
  [4] compile_file(file_handle = 0x80454f8, type = 2), line 331 in
zend_language_scanner.l
  [5] phar_compile_file(file_handle = 0x80454f8, type = 2), line 3390 in
phar.c
  [6] compile_filename(type = 2, filename = 0x8b910b8), line 386 in
zend_language_scanner.l
  [7] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data = 0x8cd6560),
line 1915 in zend_vm_execute.h
  [8] execute(op_array = 0x8cd4438), line 104 in zend_vm_execute.h
  [9] zend_call_function(fci = 0x80456a8, fci_cache = 0x8045608), line 942
in zend_execute_API.c
  [10] call_user_function_ex(function_table = 0x8bbf5a0, object_pp =
(nil), function_name = 0x8b8db78, retval_ptr_ptr = 0x804572c, param_count =
5U, params = 0x8b906d0, no_separation = 1, symbol_table = (nil)), line 734
in zend_execute_API.c
  [11] zend_error(type = 2048, format = 0x8b145e8 Redefining already
defined constructor for class %s, ... = 0x8b8e730, ...), line 1101 in
zend.c
  [12] zend_do_begin_function_declaration(function_token = 0x8045b00,
function_name = 0x8045b28, is_method = 1, return_reference = 0,
fn_flags_znode = 0x8045aec), line 1289 in zend_compile.c
  [13] zendparse(), line 4082 in zend_language_parser.c
  [14] compile_file(file_handle = 0x8046da8, type = 2), line 343 in
zend_language_scanner.l
  [15] phar_compile_file(file_handle = 0x8046da8, type = 2), line 3390 in
phar.c
  [16] compile_filename(type = 2, filename = 0x8b8e4b4), line 386 in
zend_language_scanner.l
  [17] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data = 0x8cd6440),
line 1915 in zend_vm_execute.h
  [18] execute(op_array = 0x8b8d970), line 104 in zend_vm_execute.h
  [19] zend_execute_scripts(type = 8, retval = (nil), file_count = 3, ...
= (nil), ...), line 1194 in zend.c
  [20] php_execute_script(primary_file = 0x8047850), line 2225 in
main.c
  [21] main(argc = 2, argv = 0x80478c4), line 1190 in php_cli.c

and here looks like best_fit seems to have been corrupted..

(dbx 2) p *best_fit
dbx: cannot access address 0x66690a70


(dbx 3) p *heap   
*heap = {
use_zend_alloc = 1
_malloc= (nil)
_free  = (nil)
_realloc   = (nil)
free_bitmap= 1073741824U
large_free_bitmap  = 133376U
block_size = 262144U
compact_size   = 2097152U
segments_list  = 0x8cd6410
storage= 0x8b7eef0
real_size  = 524288U
real_peak  = 524288U
limit  = 134217728U
size   = 341616U
peak   = 342120U
reserve_size   = 8192U
reserve= 0x8b7f560
overflow   = 0
internal   = 0
cached = 456U
cache  = (0x8b90590, 0x8b90700, 0x8b90718, 0x8b90558,
0x8b90918, (nil), (nil), (nil), (nil), (nil), 0x8b8faa0, (nil), (nil),
(nil), (nil), 0x8b8c1e8, (nil), (nil), (nil), (nil), (nil), (nil), (nil),
(nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil))
free_buckets   = (0x8b7f3b8, 0x8b7f3b8, 0x8b7f3c0, 0x8b7f3c0,
0x8b7f3c8, 0x8b7f3c8, 0x8b7f3d0, 0x8b7f3d0, 0x8b7f3d8, 0x8b7f3d8,
0x8b7f3e0, 0x8b7f3e0, 0x8b7f3e8, 0x8b7f3e8, 0x8b7f3f0, 0x8b7f3f0,
0x8b7f3f8, 0x8b7f3f8, 0x8b7f400, 0x8b7f400, 0x8b7f408, 0x8b7f408,
0x8b7f410, 0x8b7f410, 0x8b7f418, 0x8b7f418, 0x8b7f420, 0x8b7f420,
0x8b7f428, 0x8b7f428, 0x8b7f430, 0x8b7f430, 

#50145 [Opn]: srinatar

2009-11-11 Thread srinatar
 ID:   50145
 Updated by:   srina...@php.net
 Reported By:  srina...@php.net
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: solaris, linux
 PHP Version:  5.3.1RC3
 New Comment:

af course, this issue is not reproduced when used with
USE_ZEND_ALLOC=0. this can be a temporary work around until this issue
is further investigated.


Previous Comments:


[2009-11-11 08:26:55] srina...@php.net

Description:

with recent php 5.3.1 RC3, i noticed a crash when compiled with
mbstring and zend-multibyte and running the bug35634.phpt script found
under Zend/tests



Reproduce code:
---
'./configure' \
'--enable-cli' \
'--enable-mbstring' \
'--enable-zend-multibyte'

while running the test script Zend/tests/bug35634.phpt

?php
if (defined(pass3)) {

  class ErrorClass {
  }

} else if (defined(pass2)) {

  class TestClass {
function __construct() {
}
function TestClass() {
  $this-__construct();
}
  }

} else {

  function errorHandler($errorNumber, $errorMessage, $fileName,
$lineNumber) {
define(pass3, 1);
include(__FILE__);
die(Error: $errorMessage ($fileName:$lineNumber)\n);
  }

  set_error_handler('errorHandler');
  define(pass2, 1);
  include(__FILE__);
}
?


Expected result:

Error: Redefining already defined constructor for class TestClass
(/tmp/c.php:12)

Actual result:
--
here is the stack trace of this crash..


@1 (l...@1) program terminated by signal SEGV (no mapping at the fault
address)
Current function is _zend_mm_alloc_int
 1892   ZEND_MM_CHECK_BLOCK_LINKAGE(best_fit);
(dbx 1) where 
current thread: t...@1
=[1] _zend_mm_alloc_int(heap = 0x8b7f2f0, size = 496U), line 1892 in
zend_alloc.c
  [2] _emalloc(size = 496U), line 2295 in zend_alloc.c
  [3] open_file_for_scanning(file_handle = 0x80454f8), line 272 in
zend_language_scanner.l
  [4] compile_file(file_handle = 0x80454f8, type = 2), line 331 in
zend_language_scanner.l
  [5] phar_compile_file(file_handle = 0x80454f8, type = 2), line 3390
in phar.c
  [6] compile_filename(type = 2, filename = 0x8b910b8), line 386 in
zend_language_scanner.l
  [7] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data =
0x8cd6560), line 1915 in zend_vm_execute.h
  [8] execute(op_array = 0x8cd4438), line 104 in zend_vm_execute.h
  [9] zend_call_function(fci = 0x80456a8, fci_cache = 0x8045608), line
942 in zend_execute_API.c
  [10] call_user_function_ex(function_table = 0x8bbf5a0, object_pp =
(nil), function_name = 0x8b8db78, retval_ptr_ptr = 0x804572c,
param_count = 5U, params = 0x8b906d0, no_separation = 1, symbol_table =
(nil)), line 734 in zend_execute_API.c
  [11] zend_error(type = 2048, format = 0x8b145e8 Redefining already
defined constructor for class %s, ... = 0x8b8e730, ...), line 1101 in
zend.c
  [12] zend_do_begin_function_declaration(function_token = 0x8045b00,
function_name = 0x8045b28, is_method = 1, return_reference = 0,
fn_flags_znode = 0x8045aec), line 1289 in zend_compile.c
  [13] zendparse(), line 4082 in zend_language_parser.c
  [14] compile_file(file_handle = 0x8046da8, type = 2), line 343 in
zend_language_scanner.l
  [15] phar_compile_file(file_handle = 0x8046da8, type = 2), line 3390
in phar.c
  [16] compile_filename(type = 2, filename = 0x8b8e4b4), line 386 in
zend_language_scanner.l
  [17] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data =
0x8cd6440), line 1915 in zend_vm_execute.h
  [18] execute(op_array = 0x8b8d970), line 104 in zend_vm_execute.h
  [19] zend_execute_scripts(type = 8, retval = (nil), file_count = 3,
... = (nil), ...), line 1194 in zend.c
  [20] php_execute_script(primary_file = 0x8047850), line 2225 in
main.c
  [21] main(argc = 2, argv = 0x80478c4), line 1190 in php_cli.c

and here looks like best_fit seems to have been corrupted..

(dbx 2) p *best_fit
dbx: cannot access address 0x66690a70


(dbx 3) p *heap   
*heap = {
use_zend_alloc = 1
_malloc= (nil)
_free  = (nil)
_realloc   = (nil)
free_bitmap= 1073741824U
large_free_bitmap  = 133376U
block_size = 262144U
compact_size   = 2097152U
segments_list  = 0x8cd6410
storage= 0x8b7eef0
real_size  = 524288U
real_peak  = 524288U
limit  = 134217728U
size   = 341616U
peak   = 342120U
reserve_size   = 8192U
reserve= 0x8b7f560
overflow   = 0
internal   = 0
cached = 456U
cache  = (0x8b90590, 0x8b90700, 0x8b90718, 0x8b90558,
0x8b90918, (nil), (nil), (nil), (nil), (nil), 0x8b8faa0, (nil), (nil),
(nil), (nil), 0x8b8c1e8, (nil), (nil), (nil), (nil), (nil), (nil),
(nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil), (nil))
free_buckets   

#50145 [Opn-Fbk]: srinatar

2009-11-11 Thread jani
 ID:   50145
 Updated by:   j...@php.net
 Reported By:  srina...@php.net
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: solaris, linux
 PHP Version:  5.3.1RC3
 New Comment:

Please fix Summary. 


Previous Comments:


[2009-11-11 08:33:23] srina...@php.net

af course, this issue is not reproduced when used with
USE_ZEND_ALLOC=0. this can be a temporary work around until this issue
is further investigated.



[2009-11-11 08:26:55] srina...@php.net

Description:

with recent php 5.3.1 RC3, i noticed a crash when compiled with
mbstring and zend-multibyte and running the bug35634.phpt script found
under Zend/tests



Reproduce code:
---
'./configure' \
'--enable-cli' \
'--enable-mbstring' \
'--enable-zend-multibyte'

while running the test script Zend/tests/bug35634.phpt

?php
if (defined(pass3)) {

  class ErrorClass {
  }

} else if (defined(pass2)) {

  class TestClass {
function __construct() {
}
function TestClass() {
  $this-__construct();
}
  }

} else {

  function errorHandler($errorNumber, $errorMessage, $fileName,
$lineNumber) {
define(pass3, 1);
include(__FILE__);
die(Error: $errorMessage ($fileName:$lineNumber)\n);
  }

  set_error_handler('errorHandler');
  define(pass2, 1);
  include(__FILE__);
}
?


Expected result:

Error: Redefining already defined constructor for class TestClass
(/tmp/c.php:12)

Actual result:
--
here is the stack trace of this crash..


@1 (l...@1) program terminated by signal SEGV (no mapping at the fault
address)
Current function is _zend_mm_alloc_int
 1892   ZEND_MM_CHECK_BLOCK_LINKAGE(best_fit);
(dbx 1) where 
current thread: t...@1
=[1] _zend_mm_alloc_int(heap = 0x8b7f2f0, size = 496U), line 1892 in
zend_alloc.c
  [2] _emalloc(size = 496U), line 2295 in zend_alloc.c
  [3] open_file_for_scanning(file_handle = 0x80454f8), line 272 in
zend_language_scanner.l
  [4] compile_file(file_handle = 0x80454f8, type = 2), line 331 in
zend_language_scanner.l
  [5] phar_compile_file(file_handle = 0x80454f8, type = 2), line 3390
in phar.c
  [6] compile_filename(type = 2, filename = 0x8b910b8), line 386 in
zend_language_scanner.l
  [7] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data =
0x8cd6560), line 1915 in zend_vm_execute.h
  [8] execute(op_array = 0x8cd4438), line 104 in zend_vm_execute.h
  [9] zend_call_function(fci = 0x80456a8, fci_cache = 0x8045608), line
942 in zend_execute_API.c
  [10] call_user_function_ex(function_table = 0x8bbf5a0, object_pp =
(nil), function_name = 0x8b8db78, retval_ptr_ptr = 0x804572c,
param_count = 5U, params = 0x8b906d0, no_separation = 1, symbol_table =
(nil)), line 734 in zend_execute_API.c
  [11] zend_error(type = 2048, format = 0x8b145e8 Redefining already
defined constructor for class %s, ... = 0x8b8e730, ...), line 1101 in
zend.c
  [12] zend_do_begin_function_declaration(function_token = 0x8045b00,
function_name = 0x8045b28, is_method = 1, return_reference = 0,
fn_flags_znode = 0x8045aec), line 1289 in zend_compile.c
  [13] zendparse(), line 4082 in zend_language_parser.c
  [14] compile_file(file_handle = 0x8046da8, type = 2), line 343 in
zend_language_scanner.l
  [15] phar_compile_file(file_handle = 0x8046da8, type = 2), line 3390
in phar.c
  [16] compile_filename(type = 2, filename = 0x8b8e4b4), line 386 in
zend_language_scanner.l
  [17] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data =
0x8cd6440), line 1915 in zend_vm_execute.h
  [18] execute(op_array = 0x8b8d970), line 104 in zend_vm_execute.h
  [19] zend_execute_scripts(type = 8, retval = (nil), file_count = 3,
... = (nil), ...), line 1194 in zend.c
  [20] php_execute_script(primary_file = 0x8047850), line 2225 in
main.c
  [21] main(argc = 2, argv = 0x80478c4), line 1190 in php_cli.c

and here looks like best_fit seems to have been corrupted..

(dbx 2) p *best_fit
dbx: cannot access address 0x66690a70


(dbx 3) p *heap   
*heap = {
use_zend_alloc = 1
_malloc= (nil)
_free  = (nil)
_realloc   = (nil)
free_bitmap= 1073741824U
large_free_bitmap  = 133376U
block_size = 262144U
compact_size   = 2097152U
segments_list  = 0x8cd6410
storage= 0x8b7eef0
real_size  = 524288U
real_peak  = 524288U
limit  = 134217728U
size   = 341616U
peak   = 342120U
reserve_size   = 8192U
reserve= 0x8b7f560
overflow   = 0
internal   = 0
cached = 456U
cache  = (0x8b90590, 0x8b90700, 0x8b90718, 0x8b90558,
0x8b90918, (nil), (nil), (nil), (nil), (nil), 0x8b8faa0, (nil), (nil),

#50145 [Fbk-Opn]: crash while running bug35634.phpt

2009-11-11 Thread srina...@php.net
 ID:   50145
 User updated by:  srina...@php.net
-Summary:  srinatar
 Reported By:  srina...@php.net
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: solaris, linux
 PHP Version:  5.3.1RC3
 New Comment:

updated bug summary - accidentally had my name as summary !


Previous Comments:


[2009-11-11 08:52:54] j...@php.net

Please fix Summary. 



[2009-11-11 08:33:23] srina...@php.net

af course, this issue is not reproduced when used with
USE_ZEND_ALLOC=0. this can be a temporary work around until this issue
is further investigated.



[2009-11-11 08:26:55] srina...@php.net

Description:

with recent php 5.3.1 RC3, i noticed a crash when compiled with
mbstring and zend-multibyte and running the bug35634.phpt script found
under Zend/tests



Reproduce code:
---
'./configure' \
'--enable-cli' \
'--enable-mbstring' \
'--enable-zend-multibyte'

while running the test script Zend/tests/bug35634.phpt

?php
if (defined(pass3)) {

  class ErrorClass {
  }

} else if (defined(pass2)) {

  class TestClass {
function __construct() {
}
function TestClass() {
  $this-__construct();
}
  }

} else {

  function errorHandler($errorNumber, $errorMessage, $fileName,
$lineNumber) {
define(pass3, 1);
include(__FILE__);
die(Error: $errorMessage ($fileName:$lineNumber)\n);
  }

  set_error_handler('errorHandler');
  define(pass2, 1);
  include(__FILE__);
}
?


Expected result:

Error: Redefining already defined constructor for class TestClass
(/tmp/c.php:12)

Actual result:
--
here is the stack trace of this crash..


@1 (l...@1) program terminated by signal SEGV (no mapping at the fault
address)
Current function is _zend_mm_alloc_int
 1892   ZEND_MM_CHECK_BLOCK_LINKAGE(best_fit);
(dbx 1) where 
current thread: t...@1
=[1] _zend_mm_alloc_int(heap = 0x8b7f2f0, size = 496U), line 1892 in
zend_alloc.c
  [2] _emalloc(size = 496U), line 2295 in zend_alloc.c
  [3] open_file_for_scanning(file_handle = 0x80454f8), line 272 in
zend_language_scanner.l
  [4] compile_file(file_handle = 0x80454f8, type = 2), line 331 in
zend_language_scanner.l
  [5] phar_compile_file(file_handle = 0x80454f8, type = 2), line 3390
in phar.c
  [6] compile_filename(type = 2, filename = 0x8b910b8), line 386 in
zend_language_scanner.l
  [7] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data =
0x8cd6560), line 1915 in zend_vm_execute.h
  [8] execute(op_array = 0x8cd4438), line 104 in zend_vm_execute.h
  [9] zend_call_function(fci = 0x80456a8, fci_cache = 0x8045608), line
942 in zend_execute_API.c
  [10] call_user_function_ex(function_table = 0x8bbf5a0, object_pp =
(nil), function_name = 0x8b8db78, retval_ptr_ptr = 0x804572c,
param_count = 5U, params = 0x8b906d0, no_separation = 1, symbol_table =
(nil)), line 734 in zend_execute_API.c
  [11] zend_error(type = 2048, format = 0x8b145e8 Redefining already
defined constructor for class %s, ... = 0x8b8e730, ...), line 1101 in
zend.c
  [12] zend_do_begin_function_declaration(function_token = 0x8045b00,
function_name = 0x8045b28, is_method = 1, return_reference = 0,
fn_flags_znode = 0x8045aec), line 1289 in zend_compile.c
  [13] zendparse(), line 4082 in zend_language_parser.c
  [14] compile_file(file_handle = 0x8046da8, type = 2), line 343 in
zend_language_scanner.l
  [15] phar_compile_file(file_handle = 0x8046da8, type = 2), line 3390
in phar.c
  [16] compile_filename(type = 2, filename = 0x8b8e4b4), line 386 in
zend_language_scanner.l
  [17] ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(execute_data =
0x8cd6440), line 1915 in zend_vm_execute.h
  [18] execute(op_array = 0x8b8d970), line 104 in zend_vm_execute.h
  [19] zend_execute_scripts(type = 8, retval = (nil), file_count = 3,
... = (nil), ...), line 1194 in zend.c
  [20] php_execute_script(primary_file = 0x8047850), line 2225 in
main.c
  [21] main(argc = 2, argv = 0x80478c4), line 1190 in php_cli.c

and here looks like best_fit seems to have been corrupted..

(dbx 2) p *best_fit
dbx: cannot access address 0x66690a70


(dbx 3) p *heap   
*heap = {
use_zend_alloc = 1
_malloc= (nil)
_free  = (nil)
_realloc   = (nil)
free_bitmap= 1073741824U
large_free_bitmap  = 133376U
block_size = 262144U
compact_size   = 2097152U
segments_list  = 0x8cd6410
storage= 0x8b7eef0
real_size  = 524288U
real_peak  = 524288U
limit  = 134217728U
size   = 341616U
peak   = 342120U
reserve_size   = 8192U
reserve= 0x8b7f560
overflow   

#49098 [Opn-Fbk]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread jani
 ID:   49098
 Updated by:   j...@php.net
 Reported By:  bugs at timj dot co dot uk
-Status:   Open
+Status:   Feedback
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

To narrow this down a bit: Does it happen with latest PHP 5.3 snapshot?


Previous Comments:


[2009-11-10 23:35:57] ras...@php.net

Looks like an ext/mysqli problem, but I looked through the code and I
don't see a case where MyG(error_msg) is free'ed without being NULL'ed
or immediately re-allocated.  It isn't NULL'ed in the RSHUTDOWN, but it
is NULL'ed in the RINIT, so there should be no way to get to
php_mysqli_set_error() without it being either NULL or correctly
allocated.





[2009-11-10 23:11:11] t...@php.net

==23150== Invalid free() / delete / delete[]
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==23150==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==23150==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==23150==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==23150==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==23150==by 0x5ED964: php_request_shutdown (main.c:1475)
==23150==by 0x6A065B: main (php_cli.c:1343)
==23150== 
==23150== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from
2)
==23150== malloc/free: in use at exit: 753 bytes in 4 blocks.
==23150== malloc/free: 52,204 allocs, 52,201 frees, 11,636,702 bytes
allocated.
==23150== For counts of detected errors, rerun with: -v
==23150== searching for pointers to 4 not-freed blocks.
==23150== checked 746,032 bytes.
==23150== 
==23150== 
==23150== 1 bytes in 1 blocks are definitely lost in loss record 1 of
4
==23150==at 0x4A0763E: malloc (vg_replace_malloc.c:207)
==23150==by 0x616129: _estrdup (zend_alloc.c:2428)
==23150==by 0xABA17C1: ???
==23150==by 0xABA61DD: ???
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150== 
==23150== LEAK SUMMARY:
==23150==definitely lost: 1 bytes in 1 blocks.
==23150==  possibly lost: 0 bytes in 0 blocks.
==23150==still reachable: 752 bytes in 3 blocks.
==23150== suppressed: 0 bytes in 0 blocks.
==23150== Reachable blocks (those to which a pointer was found) are not
shown.
==23150== To see them, rerun with: --leak-check=full
--show-reachable=yes




[2009-11-09 17:22:26] j...@php.net

Try with valgrind:

# USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php
yourscript.php




[2009-11-08 23:08:37] t...@php.net

Compiling with -O0 and *without* --enable-debug gives a backtrace 
which is almost (not quite) the same:

#0  0x006bec94 in _zend_mm_free_int ()
#1  0x006bfb06 in _efree ()
#2  0x006546cf in php_version_compare ()
#3  0x0065474f in zif_version_compare ()
#4  0x0070a98a in zend_do_fcall_common_helper_SPEC ()
#5  0x0070e932 in ZEND_DO_FCALL_SPEC_CONST_HANDLER ()
#6  0x0070a480 in execute ()
#7  0x0070ab3b in zend_do_fcall_common_helper_SPEC ()
#8  0x0070b081 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER ()
#9  0x0070a480 in execute ()
#10 0x0070ab3b in zend_do_fcall_common_helper_SPEC ()
#11 0x0070b081 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER ()
#12 0x0070a480 in execute ()
#13 

#50141 [Fbk-Opn]: folders inside a zip archive are not displayed

2009-11-11 Thread samantha86 at web dot de
 ID:   50141
 User updated by:  samantha86 at web dot de
 Reported By:  samantha86 at web dot de
-Status:   Feedback
+Status:   Open
 Bug Type: Zip Related
 Operating System: windows (xp and 7)
 PHP Version:  5.3.0
 New Comment:

yes, this folder includes some other folders, which can be seen when
using a linux machine.

the structure should look like this:

myzipfile.zip
   |_ /admin
   |_ /core
   |_ ...some othe folders...
   |_ config.php
   |_ ...some other files in the root of the zipfile...

the code i use to add the directories/files it looks exactly like
this:

?php
...
//for the directories:
$zip-addDir(PATH./admin, /admin);
$zip-addDir(PATH./core, /core);/languages);
...
for the files:
$zip-addFile(PATH./backup/files/config.php, config.php);
$zip-addFile(PATH./backup/files/index.php, index.php);
...
?


Previous Comments:


[2009-11-10 23:47:13] f...@php.net

If I open your zip file with 7-ZIP instead of the integrated windows
zip tool, there's a folder with a weird name.

Might be just a blank space, might be a null byte.
But in that folder I see many folders:
admin / backup / core / installation / and some more

Can you please verify that your generated subfolder name is not just
incorrectly set?



[2009-11-10 20:03:02] samantha86 at web dot de

here is some example code, an already generated zip file can be
downloaded at my demoserver
http://steffisgarten.bplaced.net/chillyCMS/admin/tools.site.php?tool=backup
username: admin, pw: demo
maybe this can save you some time.

?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}

$zip=new Zipper();
if ($zip-open($file_dest, ZIPARCHIVE::CREATE)) {
$zip-addDir(PATH./example, /example);
} else {
echo error;
}
?



[2009-11-10 19:31:27] paj...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2009-11-10 19:26:28] samantha86 at web dot de

Description:

hi,

i have a problem with files generated/altered via the ziparchive
class.
my problem is the same as Bug #39714, but i have been using php 5.3.0
instead of 5.2.x

i use to use ubuntu linux and i have NO problem there with extracting
the zip files. it does not matter on what server the zip files are
generated, windows or linux, it depends on the client where i try to
open one of these zip files.

the code for the zipfile generation looks like this:



Reproduce code:
---
?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}
?

Expected result:

i'd like to receive a zipfile where i can see the files, but also the
directories wit the included files that are generated in a deeper
recursion of the function

Actual result:
--
under windows i only see the files that are in 

#50141 [Opn]: folders inside a zip archive are not displayed

2009-11-11 Thread samantha86 at web dot de
 ID:   50141
 User updated by:  samantha86 at web dot de
 Reported By:  samantha86 at web dot de
 Status:   Open
 Bug Type: Zip Related
 Operating System: windows (xp and 7)
 PHP Version:  5.3.0
 New Comment:

oh sorry that piece: /languages);
was too much, it is not in my orignal code. just a copy and paste
error.


Previous Comments:


[2009-11-11 09:38:54] samantha86 at web dot de

yes, this folder includes some other folders, which can be seen when
using a linux machine.

the structure should look like this:

myzipfile.zip
   |_ /admin
   |_ /core
   |_ ...some othe folders...
   |_ config.php
   |_ ...some other files in the root of the zipfile...

the code i use to add the directories/files it looks exactly like
this:

?php
...
//for the directories:
$zip-addDir(PATH./admin, /admin);
$zip-addDir(PATH./core, /core);/languages);
...
for the files:
$zip-addFile(PATH./backup/files/config.php, config.php);
$zip-addFile(PATH./backup/files/index.php, index.php);
...
?



[2009-11-10 23:47:13] f...@php.net

If I open your zip file with 7-ZIP instead of the integrated windows
zip tool, there's a folder with a weird name.

Might be just a blank space, might be a null byte.
But in that folder I see many folders:
admin / backup / core / installation / and some more

Can you please verify that your generated subfolder name is not just
incorrectly set?



[2009-11-10 20:03:02] samantha86 at web dot de

here is some example code, an already generated zip file can be
downloaded at my demoserver
http://steffisgarten.bplaced.net/chillyCMS/admin/tools.site.php?tool=backup
username: admin, pw: demo
maybe this can save you some time.

?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}

$zip=new Zipper();
if ($zip-open($file_dest, ZIPARCHIVE::CREATE)) {
$zip-addDir(PATH./example, /example);
} else {
echo error;
}
?



[2009-11-10 19:31:27] paj...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2009-11-10 19:26:28] samantha86 at web dot de

Description:

hi,

i have a problem with files generated/altered via the ziparchive
class.
my problem is the same as Bug #39714, but i have been using php 5.3.0
instead of 5.2.x

i use to use ubuntu linux and i have NO problem there with extracting
the zip files. it does not matter on what server the zip files are
generated, windows or linux, it depends on the client where i try to
open one of these zip files.

the code for the zipfile generation looks like this:



Reproduce code:
---
?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}
?

Expected result:

i'd like to receive a zipfile where i 

#50143 [Opn-Bgs]: max_execution_time

2009-11-11 Thread jani
 ID:   50143
 Updated by:   j...@php.net
 Reported By:  chalithaw at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: CentOS 5.3
 PHP Version:  5.2.11
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:


[2009-11-11 05:08:40] chalithaw at gmail dot com

Description:

I am using php 5.2 in centOS with cli once I am running php scripts
from my web browser my php scripts is never get timed out I want to
reduce max_execution_time to 10s. I changed it from php.ini but no
effect. scripts are running with unlimited timeout. :-( please help me
the solve this problem






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



#50142 [Opn-Fbk]: parse_ini_file() constants not used correctly

2009-11-11 Thread jani
 ID:   50142
 Updated by:   j...@php.net
 Reported By:  jparneodo at yahoo dot fr
-Status:   Open
+Status:   Feedback
 Bug Type: Filesystem function related
 Operating System: Ubuntu
 PHP Version:  5.2.11


Previous Comments:


[2009-11-11 00:13:16] f...@php.net

What PHP version gave you your expected result?

With 5.2.6 I get this last line:
ONE=1 TWO=2.1 THREE=bug.TWO ONE

With 5.3.1-RC I get this:
ONE=1 TWO=2.1 THREE=bug.2.1 1

With 5.2.11 I get this:
ONE=1 TWO=2.1 THREE=bug.TWO ONE



[2009-11-10 19:44:38] jparneodo at yahoo dot fr

Description:

Item THREE has bad value.

Input file /tmp/jp.ini:

[CONSTANT]
ONE = 1
TWO = 2. ONE
THREE = bug. TWO ONE


Reproduce code:
---
?php
var_dump($ini1=parse_ini_file('/tmp/jp.ini',true));
define('ONE',$ini1['CONSTANT']['ONE']);
echo sprintf(ONE=%s\n,ONE);

var_dump($ini2=parse_ini_file('/tmp/jp.ini',true));
define('TWO',$ini2['CONSTANT']['TWO']);
echo sprintf(ONE=%s TWO=%s\n,ONE,TWO);

var_dump($ini3=parse_ini_file('/tmp/jp.ini',true));
define('THREE',$ini3['CONSTANT']['THREE']);
echo sprintf(ONE=%s TWO=%s THREE=%s\n,ONE,TWO,THREE);


Expected result:

array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.2.1
  }
}
ONE=1 TWO=2.1 THREE=bug.2.1


Actual result:
--
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1 THREE=c.TWO ONE






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



#50146 [NEW]: property_exists: Closure object cannot have properties

2009-11-11 Thread spam04 at pornel dot net
From: spam04 at pornel dot net
Operating system: *
PHP version:  5.3SVN-2009-11-11 (snap)
PHP Bug Type: Reflection related
Bug description:  property_exists: Closure object cannot have properties

Description:

property_exists() rejects closures with Closure object cannot have
properties rather than simply always returning false.

Since closures pass is_object() test, it's hard to avoid this error
without testing for instanceof Closure as well, which is discouraged in
the docs.


Reproduce code:
---
$obj = function(){}

is_object($obj)  property_exists($obj,'foo');


Expected result:

false

(either they should not be considered objects, or property_exists should
accept any object).


Actual result:
--
Closure object cannot have properties

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



#25132 [Com]: if compiled with --enable-gd-native-ttf images with -accents show font errors

2009-11-11 Thread itsme at tomkiss dot net
 ID:   25132
 Comment by:   itsme at tomkiss dot net
 Reported By:  mail_fidel at yahoo dot com
 Status:   No Feedback
 Bug Type: GD related
 Operating System: FreeBSD 4.7
 PHP Version:  4.3.3RC2
 Assigned To:  pajoye
 New Comment:

Just to report - I have also experienced this problem on varying 
versions of PHP (5.2.6 on MAMP on Mac and 5.2.11 on CentOS).

The example script on PHP.net for imagettftext produced the same result

listed here previously = Accents and extended character sets (Polish
for 
example) are all missed out or some characters displayed incorrectly 
when --enable-gd-native-ttf is enabled in the PHP compile.

Would be nice to fix this, looks like it's been around a while!


Previous Comments:


[2003-08-26 00:59:27] sni...@php.net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Open. Thank you.





[2003-08-21 06:33:40] paj...@php.net

Can you try this simple script instead?

$im = imagecreatetruecolor(200,200);
$black = imagecolorallocate($im, 255,0,0);
imagettftext($im, 20, 0, 10, 20, $black, arial.ttf,
  buen día);
imagepng($im, 'res.png');

On which platform do you work?

pierre



[2003-08-19 10:27:01] mail_fidel at yahoo dot com

This are the config options:

Configure Command =  './configure' '--enable-versioning'
'--enable-memory-limit' '--with-layout=GNU' '--with-zlib-dir=/usr'
'--disable-a
ll' '--with-regex=php' '--enable-discard-path' '--enable-bcmath'
'--enable-ctype' '--with-dom=/usr/local' '--with-dom-xslt=/usr/local'
'-
-with-dom-exslt=/usr/local' '--enable-filepro' '--with-gd'
'--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local'
'--with-png-dir=
/usr/local' '--with-xpm-dir=/usr/local' '--with-imap=/usr/local'
'--with-imap-ssl=/usr/local' '--enable-mbstring' '--enable-mbregex'
'--w
ith-mysql=/usr/local' '--enable-overload' '--with-pcre-regex=yes'
'--enable-posix' '--with-readline' '--enable-session' '--enable-tokeniz
er' '--enable-xml' '--with-expat-dir=/usr/local' '--with-zlib=yes'
'--prefix=/usr/local' 'i386-portbld-freebsd4.7'

This is my working built, without  --enable-gd-native-ttf 

Freetype version:

 freetype2-2.1.4_1

Example code:

  function getImage($font,$string,$point,$color,$bgcolor)
  {

$ses = session_id();
$fileName = $ses._.png;

$measures = imagettfbbox ( $point, 0, $this-fonts_path.$font,
$string);

$width = abs($measures[4] - $measures[0])+20;
$upper = abs($measures[5])+5;
$under = abs($measures[1])+5;
$height = $upper + $under;

$image = imagecreate($width, $height);

//Allocate some colors.
$color = eregi_replace(#,,$color);
$ri = hexdec(substr($color, 0, 2));
$gi = hexdec(substr($color, 2, 2));
$bi = hexdec(substr($color, 4, 2));
  
$bgcolor = eregi_replace(#,,$bgcolor);
$rb = hexdec(substr($bgcolor, 0, 2));
$gb = hexdec(substr($bgcolor, 2, 2));
$bb = hexdec(substr($bgcolor, 4, 2));
  
$bg_color = imagecolorallocate($image,$rb ,$gb,$bb);
  
$typeface_color = imagecolorallocate($image, $ri, $gi, $bi);
  
imagecolortransparent($image,$bg_color);
  
imagefilledrectangle($image, 0, 0, $width, $height, $bg_color);
  
imagettftext($image, $point, 0, 10, $upper+2,
$typeface_color,$this-fonts_path.$font, $string);

$path = $this-temp_path;

imagepng($image,$path.$fileName);

//Finally, free up the memory allocated for the image.

imagedestroy($image);
return($fileName);
  }

when trying to solve the problem we change the image type from png to
gif to jpg to see if this was the problem. We upgrade freetype and GD.
Then I read that php 4.3.3 was using some recomended native gd code
and when I saw the  --enable-gd-native-ttf I decided to turned off and
the scripts start working again.

I'm sure is not a font related problem, first because it worked just
before the update, and second bacause we have a big library of ttf fonts
and we test it with all of them (since some fonts do not have accent
characters we generate an image with each one to test them)

Also, I made a mistake in the description with the example buen día
the output was buen d . A customer of us wrote this todo por tus
células and the output was: todo por tus c ulas. If any one knows
spanish he/she can realize how embarrassing and funny is is (original
text all for your cells output text all for you ass).



[2003-08-18 18:31:23] paj...@php.net

everythings works fine here. Using bundled GD library, freetype 2.1.3
and the 

#50148 [NEW]: [PATCH] - zend_get_property_info should check for Z_TYPE_P(member) == IS_STRING

2009-11-11 Thread yoarvi at gmail dot com
From: yoarvi at gmail dot com
Operating system: Solaris 10/SPARC
PHP version:  6SVN-2009-11-11 (SVN)
PHP Bug Type: Unicode Engine related
Bug description:  [PATCH] - zend_get_property_info should check for 
Z_TYPE_P(member) == IS_STRING

Description:

When I ran 'gmake test' on my PHP6 tree on Solaris 10 (SPARC), I noticed
many test failures.



The following patch fixes many(~350) of these test failures:

Index: Zend/zend_object_handlers.c
===
--- Zend/zend_object_handlers.c (revision 290471)
+++ Zend/zend_object_handlers.c (working copy)
@@ -198,7 +198,7 @@
ulong h;

if ((Z_TYPE_P(member) == IS_UNICODE  Z_USTRVAL_P(member)[0] ==
0) ||
-   Z_STRVAL_P(member)[0] == '\0') {
+   (Z_TYPE_P(member) == IS_STRING  Z_STRVAL_P(member)[0] ==
'\0')) {
if (!silent) {
if (Z_UNILEN_P(member) == 0) {
zend_error(E_ERROR, Cannot access empty
property);


Reproduce code:
---
% sapi/cli/php tests/classes/__call_001.php


Expected result:

Method test called:
array(4) {
  [0]=
  int(1)
  [1]=
  unicode(1) 2
  [2]=
  float(3.4)
  [3]=
  bool(true)
}
array(3) {
  [0]=
  int(1)
  [1]=
  int(2)
  [2]=
  int(3)
}


Actual result:
--
Method test called:
array(4) {
  [0]=
  int(1)
  [1]=
  unicode(1) 2
  [2]=
  float(3.4)
  [3]=
  bool(true)
}

Fatal error: Cannot access property started with '\0' in
/space/arvind/php-src-6/tests/classes/__call_001.phpt on line 14

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



#50137 [Fbk-Opn]: I do not know apache 2.2.13

2009-11-11 Thread hrompik at gmail dot com
 ID:   50137
 User updated by:  hrompik at gmail dot com
 Reported By:  hrompik at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Windows 7 build 7600
 PHP Version:  5.2.11
 New Comment:

if (preg_match(/^[à-ÿ]+$/,'éöóê')) echo 'yes'; else echo 'no';
The same problem is not all the characters. displays no and should be
yes.
To work properly account for the entire alphabet list.
For example working properly:
if (preg_match(/^[àáâãäå¸æçèéêëìíîïðñòóôõö÷øùûúüýþÿ]+$/,'éöóê')) echo
'yes'; else echo 'no';


Previous Comments:


[2009-11-10 16:04:18] ras...@php.net

Works fine for me here on a Linux box.  Try it with preg_match instead
of ereg.



[2009-11-10 13:31:39] hrompik at gmail dot com

This makes it possible so that I do not know much English, I could not
use search, so I apologize if this message was.



[2009-11-10 13:28:11] hrompik at gmail dot com

Description:

I know English bad, so use a translator. 
The problem is that the Russian alphabet - Cyrillic is not properly
processed. 
Some letters are not included in the set [à-ÿ] example 'ð' or 'ô'

Reproduce code:
---
?php
$url = 'ô-ô';
if (ereg(^([à-ÿ]+)-([à-ÿ]+)$,$url)) echo 'yes'; else echo 'no';
?


Expected result:

yes

Actual result:
--
no





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



#50147 [Opn-Fbk]: DEFAULT NULL Values in mysql_query('SHOW COLUMNS FROM `xx`');

2009-11-11 Thread uw
 ID:   50147
 Updated by:   u...@php.net
 Reported By:  w at lder dot de
-Status:   Open
+Status:   Feedback
 Bug Type: MySQL related
 Operating System: Linux 2.6.16.21-0.25-default
 PHP Version:  5.2.11
 New Comment:

ext/mysql returns whatever MySQL delivers. Please verify that the MySQL
prompt returns the result you want. If not, this is a MySQL bug not a
PHP bug.

Please run on the command line:

mysql -uuser -ppassword database...
mysql SHOW COLUMNS FROM mytable




Previous Comments:


[2009-11-11 10:35:02] w at lder dot de

Description:

The attached Code results a wrong result.
MySQL:
Server Version: 5.0.26
MySQL-Client-Version: 5.0.26



Reproduce code:
---
?php
/* 
MySQL:
CREATE TABLE IF NOT EXISTS `test` (
  `hereIsDefaultNULL` int(255) default NULL,
  `defaultNULLvarchar` varchar(255) default NULL
)
*/
mysql_connect('localhost','user','');
mysql_select_db('test');
$columns_res = mysql_query('SHOW COLUMNS FROM `test`');
while ($fieldRow = mysql_fetch_assoc($columns_res)) {
print_r($fieldRow)  ;   
}
?

Expected result:

Array
(
[Field] = hereIsDefaultNULL
[Type] = int(255)
[Null] = YES
[Key] = 
[Default] = NULL
[Extra] = 
)
Array
(
[Field] = defaultNULLvarchar
[Type] = varchar(255)
[Null] = YES
[Key] = 
[Default] = NULL
[Extra] = 
)


Actual result:
--
Array
(
[Field] = hereIsDefaultNULL
[Type] = int(255)
[Null] = YES
[Key] = 
[Default] = 
[Extra] = 
)
Array
(
[Field] = defaultNULLvarchar
[Type] = varchar(255)
[Null] = YES
[Key] = 
[Default] = 
[Extra] = 
)





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



#50147 [NEW]: DEFAULT NULL Values in mysql_query('SHOW COLUMNS FROM `xx`');

2009-11-11 Thread w at lder dot de
From: w at lder dot de
Operating system: Linux 2.6.16.21-0.25-default
PHP version:  5.2.11
PHP Bug Type: MySQL related
Bug description:  DEFAULT NULL Values in mysql_query('SHOW COLUMNS FROM `xx`');

Description:

The attached Code results a wrong result.
MySQL:
Server Version: 5.0.26
MySQL-Client-Version: 5.0.26



Reproduce code:
---
?php
/* 
MySQL:
CREATE TABLE IF NOT EXISTS `test` (
  `hereIsDefaultNULL` int(255) default NULL,
  `defaultNULLvarchar` varchar(255) default NULL
)
*/
mysql_connect('localhost','user','');
mysql_select_db('test');
$columns_res = mysql_query('SHOW COLUMNS FROM `test`');
while ($fieldRow = mysql_fetch_assoc($columns_res)) {
print_r($fieldRow)  ;   
}
?

Expected result:

Array
(
[Field] = hereIsDefaultNULL
[Type] = int(255)
[Null] = YES
[Key] = 
[Default] = NULL
[Extra] = 
)
Array
(
[Field] = defaultNULLvarchar
[Type] = varchar(255)
[Null] = YES
[Key] = 
[Default] = NULL
[Extra] = 
)


Actual result:
--
Array
(
[Field] = hereIsDefaultNULL
[Type] = int(255)
[Null] = YES
[Key] = 
[Default] = 
[Extra] = 
)
Array
(
[Field] = defaultNULLvarchar
[Type] = varchar(255)
[Null] = YES
[Key] = 
[Default] = 
[Extra] = 
)

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



#50149 [NEW]: Enabling dynamic extensions make Apache 2.2.14 crash at startup

2009-11-11 Thread msabatier dot perso at gmail dot com
From: msabatier dot perso at gmail dot com
Operating system: Windows 7
PHP version:  5.2.11
PHP Bug Type: Dynamic loading
Bug description:  Enabling dynamic extensions make Apache 2.2.14 crash at 
startup

Description:

I installed PHP 5.2.11 via the installer on a Windows 7 with Apache
2.2.14. I chose to install 3 extensions MySQL, GD2 and XSL.

After editing http.conf to enable PHP, everything runs OK. Only prolem
found is that PHP errors are not appended to the Apache error log.

Then I go to the php.ini and enable any of the 3 extensions I installed.
Then try to restart Apache. Apache process start fails without giving any
error log.

I then uninstall PHP 5.2.11, install 5.2.9 and repeat the same process.
Everything runs fine this time.


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



#50147 [Com]: DEFAULT NULL Values in mysql_query('SHOW COLUMNS FROM `xx`');

2009-11-11 Thread w at lder dot de
 ID:   50147
 Comment by:   w at lder dot de
 Reported By:  w at lder dot de
 Status:   Feedback
 Bug Type: MySQL related
 Operating System: Linux 2.6.16.21-0.25-default
 PHP Version:  5.2.11
 New Comment:

Here is the result:
mysql SHOW COLUMNS FROM test;
++--+--+-+-+---+
| Field  | Type | Null | Key | Default | Extra |
++--+--+-+-+---+
| hereIsDefaultNULL  | int(255) | YES  | | NULL|   |
| defaultNULLvarchar | varchar(255) | YES  | | NULL|   |
++--+--+-+-+---+


Previous Comments:


[2009-11-11 10:44:06] u...@php.net

ext/mysql returns whatever MySQL delivers. Please verify that the MySQL
prompt returns the result you want. If not, this is a MySQL bug not a
PHP bug.

Please run on the command line:

mysql -uuser -ppassword database...
mysql SHOW COLUMNS FROM mytable





[2009-11-11 10:35:02] w at lder dot de

Description:

The attached Code results a wrong result.
MySQL:
Server Version: 5.0.26
MySQL-Client-Version: 5.0.26



Reproduce code:
---
?php
/* 
MySQL:
CREATE TABLE IF NOT EXISTS `test` (
  `hereIsDefaultNULL` int(255) default NULL,
  `defaultNULLvarchar` varchar(255) default NULL
)
*/
mysql_connect('localhost','user','');
mysql_select_db('test');
$columns_res = mysql_query('SHOW COLUMNS FROM `test`');
while ($fieldRow = mysql_fetch_assoc($columns_res)) {
print_r($fieldRow)  ;   
}
?

Expected result:

Array
(
[Field] = hereIsDefaultNULL
[Type] = int(255)
[Null] = YES
[Key] = 
[Default] = NULL
[Extra] = 
)
Array
(
[Field] = defaultNULLvarchar
[Type] = varchar(255)
[Null] = YES
[Key] = 
[Default] = NULL
[Extra] = 
)


Actual result:
--
Array
(
[Field] = hereIsDefaultNULL
[Type] = int(255)
[Null] = YES
[Key] = 
[Default] = 
[Extra] = 
)
Array
(
[Field] = defaultNULLvarchar
[Type] = varchar(255)
[Null] = YES
[Key] = 
[Default] = 
[Extra] = 
)





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



#50027 [Com]: $this becomes a non-object

2009-11-11 Thread phpbugs at colin dot guthr dot ie
 ID:   50027
 Comment by:   phpbugs at colin dot guthr dot ie
 Reported By:  phpbugs at colin dot guthr dot ie
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Mandriva Linux (Cooker x86_64)
 PHP Version:  5.3.1RC2
 New Comment:

(Hopefully this will not reset the Feedback status).

I've tried this on a similar i586 machine and cannot reproduce the
problem, this leads me to believe the problem is indeed x86_64 related.
I will try and obtain access to another x86_64 machine to reproduce the
problem there too.

If the bug status changes, please put it back to Feedback.


Previous Comments:


[2009-11-04 10:40:12] j...@php.net

Leave the report in Feedback (requested) status until you have that
script around. (do not reply before that ;)



[2009-11-04 08:43:49] phpbugs at colin dot guthr dot ie

I knew you were going to say that Jani :p

As I said on the original mail, even my simple test is not sufficient
to trigger this.

Sadly I'm not sure if I can create such a test script, but I will
certainly try. It may take me a few days to come up with something and
it's most likely that it will not be a simple application (my current
trigger case is part of the Zend Framework and I have no real desire to
dissect that!)

Give me a week or two.



[2009-11-03 10:57:43] j...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2009-10-28 09:05:14] phpbugs at colin dot guthr dot ie

Description:

This is a really hard bug to reproduce (e.g. build a simple test case)
but I can reliably do so here with my application. I'll attempt to
describe the problem in depth, although I warn in advance that it's a
bit of a confusing one.

During a particular request, PHP seems to corrupt itself quite badly
which cases $this to become corrupted within an object.

When this happens, is_object($this) still returns true, but any attempt
to access a member variable (e.g. $this-mFuncs) will result in the
Notice: Trying to get property of non-object warning. Similar warning
exist when trying to call methods etc.

Once this corruption happens, it will remain until the Apache process
is restarted (mpm-prefork) although some requests will succeed (I
presume it depends what mpm-preforked httpd handler is used?). When this
happens, a much simpler test case (which I'll link to) fails also (i.e.
it seems that the initial trigger of this causes it to continue, but the
simpler test case itself does not seem enough to trigger it initially).

The trigger case I have is a rather complex Zend Framework application
that I sadly cannot share.

I have confirmed this problem is present on 5.3.0 and 5.3.1RC2, so I
suspect it's a 5.3.x problem over all. I cannot reproduce the problem on
5.2.11.

All builds use -O0 for optimisations (as higher values have proven to
cause problems, particularly on x86_64).

Reproduce code:
---
A tarball containing three PHP files: one a UniversalAutoloader
structure we use in our projects (it predates spl stuff and actually
gives us a different fallback mechanism anyway), and a simple test class
that is meant to be autoloaded. Then the test.php file which actually
exhibits the bug.

As noted previously however, this test case only *exhibits* this bug if
the problem is triggered already by some other code. You can see from
the backtrace.txt the effect of it failing. I provide this in the hope
that it allows something obvious to jump out at you, but I suspect the
problem is really some form of stack frame corruption or similar
(possibly due to x86_64 as I've not tested to see if it affects 5.3.1
although I will be able to do so in the coming weeks).

The URL for this bundle is: http://colin.guthr.ie/php-bug.tar

Expected result:

It should just echo Foo\n. But as you can see the Notice is triggered
and the is_array() check fails (as can be seen, it is impossible for the
variable to be anything other than an array).

Actual result:
--
*After* triggering the problem, $this becomes a non-object (although in
other tests (is_object($this) still returns true).





-- 
Edit this bug report at 

#50149 [Opn-Bgs]: Enabling dynamic extensions make Apache 2.2.14 crash at startup

2009-11-11 Thread pajoye
 ID:   50149
 Updated by:   paj...@php.net
 Reported By:  msabatier dot perso at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Dynamic loading
 Operating System: Windows 7
 PHP Version:  5.2.11
 New Comment:

You are certainly either missing a DLL or using the wrong DLL (libmysql
certainly).

Be sure to have the PHP directory (where the DLL are) first in your
PATH.

No issue here but configuration problem.


Previous Comments:


[2009-11-11 11:04:22] msabatier dot perso at gmail dot com

Description:

I installed PHP 5.2.11 via the installer on a Windows 7 with Apache
2.2.14. I chose to install 3 extensions MySQL, GD2 and XSL.

After editing http.conf to enable PHP, everything runs OK. Only prolem
found is that PHP errors are not appended to the Apache error log.

Then I go to the php.ini and enable any of the 3 extensions I
installed. Then try to restart Apache. Apache process start fails
without giving any error log.

I then uninstall PHP 5.2.11, install 5.2.9 and repeat the same process.
Everything runs fine this time.






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



#50141 [Opn]: folders inside a zip archive are not displayed

2009-11-11 Thread fa
 ID:   50141
 Updated by:   f...@php.net
 Reported By:  samantha86 at web dot de
 Status:   Open
 Bug Type: Zip Related
 Operating System: windows (xp and 7)
 PHP Version:  5.3.0
 New Comment:

Addendum:
if I change
  $zip-addDir(PATH./example, /example);
to
  $zip-addDir(PATH./example, example);
I can avoid this in 5.2.6 (debian php), 5.3.0 and 5.3.1RC3
and get:
example/x.ini


Previous Comments:


[2009-11-11 09:40:21] samantha86 at web dot de

oh sorry that piece: /languages);
was too much, it is not in my orignal code. just a copy and paste
error.



[2009-11-11 09:38:54] samantha86 at web dot de

yes, this folder includes some other folders, which can be seen when
using a linux machine.

the structure should look like this:

myzipfile.zip
   |_ /admin
   |_ /core
   |_ ...some othe folders...
   |_ config.php
   |_ ...some other files in the root of the zipfile...

the code i use to add the directories/files it looks exactly like
this:

?php
...
//for the directories:
$zip-addDir(PATH./admin, /admin);
$zip-addDir(PATH./core, /core);/languages);
...
for the files:
$zip-addFile(PATH./backup/files/config.php, config.php);
$zip-addFile(PATH./backup/files/index.php, index.php);
...
?



[2009-11-10 23:47:13] f...@php.net

If I open your zip file with 7-ZIP instead of the integrated windows
zip tool, there's a folder with a weird name.

Might be just a blank space, might be a null byte.
But in that folder I see many folders:
admin / backup / core / installation / and some more

Can you please verify that your generated subfolder name is not just
incorrectly set?



[2009-11-10 20:03:02] samantha86 at web dot de

here is some example code, an already generated zip file can be
downloaded at my demoserver
http://steffisgarten.bplaced.net/chillyCMS/admin/tools.site.php?tool=backup
username: admin, pw: demo
maybe this can save you some time.

?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}

$zip=new Zipper();
if ($zip-open($file_dest, ZIPARCHIVE::CREATE)) {
$zip-addDir(PATH./example, /example);
} else {
echo error;
}
?



[2009-11-10 19:31:27] paj...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





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/50141

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



#49967 [Opn]: Custom iteration cannot return keys other than ints or strings

2009-11-11 Thread colder
 ID:   49967
 Updated by:   col...@php.net
-Summary:  Iteration over SplObjectStorage returns index=object
   instead of object=data
 Reported By:  an0nym at narod dot ru
 Status:   Open
-Bug Type: SPL related
+Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.3.0
 New Comment:

This is indeed a limitation of the iteration process itself, nothing
specific to splobjectstorage.


Previous Comments:


[2009-10-23 10:27:31] an0nym at narod dot ru

Ah, it seems that foreach can't handle anything non-scalar as a key.
What a pity. 

I think this should be changed in the future, because it limits the use
of Iterators. For instance, I can't use something like: 

?php
class MapObjectData extends SplObjectStorage
{
public function key ()
{
return parent::current ();
}

public function current ()
{
return parent::getInfo ();
}
}
$spl = new MapObjectData ();
$spl[new StdClass ()] = 'a';
$spl[new StdClass ()] = 'b';
foreach ($spl as $object = $data)
{
var_dump ($object, $data);
}
?



[2009-10-23 10:08:10] an0nym at narod dot ru

Description:

Iteration over SplObjectStorage returns unexpected results: internal
index = associated object instead of object = associated data. 

Reproduce code:
---
?php
$spl = new SplObjectStorage ();
$spl[new StdClass ()] = 'a';
$spl[new StdClass ()] = 'b';
foreach ($spl as $object = $data)
{
var_dump ($object, $data);
}
?

Expected result:

object(stdClass)#2 (0) {
}
string(1) a
object(stdClass)#3 (0) {
}
string(1) b

Actual result:
--
int(0)
object(stdClass)#2 (0) {
}
int(1)
object(stdClass)#2 (0) {
}





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



#50137 [Opn-Bgs]: I do not know apache 2.2.13

2009-11-11 Thread jani
 ID:   50137
 Updated by:   j...@php.net
 Reported By:  hrompik at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Windows 7 build 7600
 PHP Version:  5.2.11
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:


[2009-11-11 10:43:27] hrompik at gmail dot com

if (preg_match(/^[à-ÿ]+$/,'éöóê')) echo 'yes'; else echo 'no';
The same problem is not all the characters. displays no and should be
yes.
To work properly account for the entire alphabet list.
For example working properly:
if (preg_match(/^[àáâãäå¸æçèéêëìíîïðñòóôõö÷øùûúüýþÿ]+$/,'éöóê')) echo
'yes'; else echo 'no';



[2009-11-10 16:04:18] ras...@php.net

Works fine for me here on a Linux box.  Try it with preg_match instead
of ereg.



[2009-11-10 13:31:39] hrompik at gmail dot com

This makes it possible so that I do not know much English, I could not
use search, so I apologize if this message was.



[2009-11-10 13:28:11] hrompik at gmail dot com

Description:

I know English bad, so use a translator. 
The problem is that the Russian alphabet - Cyrillic is not properly
processed. 
Some letters are not included in the set [à-ÿ] example 'ð' or 'ô'

Reproduce code:
---
?php
$url = 'ô-ô';
if (ereg(^([à-ÿ]+)-([à-ÿ]+)$,$url)) echo 'yes'; else echo 'no';
?


Expected result:

yes

Actual result:
--
no





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



#50150 [NEW]: function stat(),lstat() dosn't wonk on a mounted cifs

2009-11-11 Thread balanalin2003 at yahoo dot com
From: balanalin2003 at yahoo dot com
Operating system: ubuntu 9.10
PHP version:  5.3.0
PHP Bug Type: Streams related
Bug description:  function stat(),lstat() dosn't wonk on a mounted cifs

Description:

Starting program: /php-cli/bin/php /home/alin/Desktop/test.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_stat (
filename=0x87e2e80 /mount/Arena/tickers.txt, 
filename_length=24, type=17, return_value=0x87e283c, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:762
762 {
(gdb) bt
#0  php_stat (filename=0x87e2e80 /mount/Arena/tickers.txt, 
filename_length=24, type=17, return_value=0x87e283c, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:762
#1  0x0826c85b in php_if_stat (ht=1, return_value=0x87e283c, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:1125
#2  0x081ca23c in phar_stat (ht=1, return_value=0x87e283c, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
tsrm_ls=0x86ea050)
at
/home/alin/Desktop/arhive/php-5.3.0/ext/phar/func_interceptors.c:1034
#3  0x083913f6 in zend_do_fcall_common_helper_SPEC (
execute_data=0x88126f4, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:313
#4  0x08395aec in ZEND_DO_FCALL_SPEC_CONST_HANDLER (
execute_data=0x88126f4, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:1601
#5  0x083906c6 in execute (op_array=0x87e2ecc, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:104
#6  0x0835ee92 in zend_execute_scripts (type=8, tsrm_ls=0x86ea050, 
retval=0x0, file_count=3)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend.c:1188
#7  0x082dacb9 in php_execute_script (primary_file=0xb660, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/main/main.c:2196
#8  0x08434634 in main (argc=2, argv=0xb7f4)
---Type return to continue, or q return to quit---
at /home/alin/Desktop/arhive/php-5.3.0/sapi/cli/php_cli.c:1188
(gdb) continue
Continuing.

Warning: stat(): stat failed for /mount/Arena/tickers.txt in
/home/alin/Desktop/test.php on line 3
bool(false)

Program exited normally.
---
 stat /mount/Arena2/tickers.txt
  File: `/mount/Arena2/tickers.txt'
  Size: 184118245   Blocks: 359680 IO Block: 16384  regular file
Device: 16h/22d Inode: 23080948090339228  Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (0/root)   Gid: (0/root)
Access: 2009-11-11 14:29:25.12500 +0200
Modify: 2009-11-10 17:26:20.099468800 +0200
Change: 2009-11-10 17:26:20.099468800 +0200


Reproduce code:
---
?php

var_dump(stat(/mount/Arena/tickers.txt));
?

Actual result:
--
Warning: stat(): stat failed for /mount/Arena/tickers.txt in
/home/alin/Desktop/test.php on line 3
bool(false)

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



#50140 [Opn-Fbk]: [PATCH] With default compilation option, php symbols are unresolved for nsapi

2009-11-11 Thread jani
 ID:   50140
 Updated by:   j...@php.net
-Summary:  [Patch] With default compilation option, php symbols
   are unresolved for nsapi
 Reported By:  basant dot kukreja at gmail dot com
-Status:   Open
+Status:   Feedback
-Bug Type: *General Issues
+Bug Type: iPlanet related
 Operating System: Linux
 PHP Version:  5.3SVN-2009-11-10 (SVN)
 New Comment:

Check how this is fixed for Apache: sapi/apache2handler/php_apache.h
and search for visibility. I think you should do that instead of using
any #pragma's.


Previous Comments:


[2009-11-10 19:20:57] basa...@php.net

From nsapi.h : 

#ifdef XP_UNIX
#define NSAPI_PUBLIC
...

It seems NSAPI_PUBLIC is expanded to empty string.



When I expanded after preprocessing nsapi.c, here is what I got :

# 915 .../php-src-5.3/sapi/nsapi/nsapi.c
int php5_init(pblock *pb, Session *sn, Request *rq)

--
So we need to tell gcc to export the NSAPI_PUBLIC symbols.



[2009-11-10 19:14:51] basa...@php.net

The previous patch didn't resolve the problem, here is what helped 
resolved the issue. NSAPI_PUBLIC should have made the symbols public
but it seems it doesn't.

Index: sapi/nsapi/nsapi.c
===
--- sapi/nsapi/nsapi.c  (revision 290447)
+++ sapi/nsapi/nsapi.c  (working copy)
@@ -67,6 +67,7 @@
  * NSAPI includes
  */
 #include nsapi.h
+#pragma GCC visibility push(default)
 
 #define NSLS_D struct nsapi_request_context *request_context
 #define NSLS_DC, NSLS_D



[2009-11-10 18:59:16] basa...@php.net

Here is the snipp from gcc man page :
man gcc

 -fvisibility=default|internal|hidden|protected
...
  For those adding visibility support to existing code, you may
find #pragma GCC visibility of
   use.  This works by you enclosing the declarations you wish
to set visibility for with (for
   example) #pragma GCC visibility push(hidden) and #pragma GCC
visibility pop. 
...



Pusing default visibility before including nsapi.h (and popping after)
would
help in compiling and loading php correctly with nsapi servers.

Here is the patch against recent php 5.3 svn

Index: sapi/nsapi/nsapi.c
===
--- sapi/nsapi/nsapi.c  (revision 290447)
+++ sapi/nsapi/nsapi.c  (working copy)
@@ -66,7 +66,9 @@
 /*
  * NSAPI includes
  */
+#pragma GCC visibility push(default)
 #include nsapi.h
+#pragma GCC visibility pop
 
 #define NSLS_D struct nsapi_request_context *request_context
 #define NSLS_DC, NSLS_D






[2009-11-10 18:48:30] basa...@php.net

Here is how symbols looks like :


$ nm .libs/libphp5.so | grep php5
004dcfb7 t php5_auth_trans
004dc661 t php5_close
004dc802 t php5_execute
004dc6d4 t php5_init

Symbols are not exported by default.

If we remove 
-fvisibility=hidden from compilation options then php compiles
fine and server is able to load libphp5.so correctly.




[2009-11-10 18:46:36] basant dot kukreja at gmail dot com

Description:

On Fedora 11, by default gcc uses 
-fvisibility=hidden, When we compile it for Sun Web Server using
following
configure options, php compiles fine.
'./configure' '--with-nsapi=server_path' '--with-zlib'
'--prefix=/usr/local'

But when we start the web server, we get the following error : 

failure: CORE2253: Error running Init function load-modules: dlsym for
php5_init failed (path/lib/libphp5.so: undefined symbol: php5_init)
failure: server initialization failed



Expected result:

Server should be able to load php correctly.

Actual result:
--
Sun Web Server fails to start because of unexported symbols.





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



#50150 [Opn-Fbk]: function stat(),lstat() dosn't wonk on a mounted cifs

2009-11-11 Thread jani
 ID:   50150
 Updated by:   j...@php.net
 Reported By:  balanalin2003 at yahoo dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Streams related
 Operating System: ubuntu 9.10
 PHP Version:  5.3.0
 New Comment:

And you're sure it's not this bug:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/220658


Previous Comments:


[2009-11-11 12:34:30] balanalin2003 at yahoo dot com

Description:

Starting program: /php-cli/bin/php /home/alin/Desktop/test.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_stat (
filename=0x87e2e80 /mount/Arena/tickers.txt, 
filename_length=24, type=17, return_value=0x87e283c, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:762
762 {
(gdb) bt
#0  php_stat (filename=0x87e2e80 /mount/Arena/tickers.txt, 
filename_length=24, type=17, return_value=0x87e283c, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:762
#1  0x0826c85b in php_if_stat (ht=1, return_value=0x87e283c, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
tsrm_ls=0x86ea050)
at
/home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:1125
#2  0x081ca23c in phar_stat (ht=1, return_value=0x87e283c, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
tsrm_ls=0x86ea050)
at
/home/alin/Desktop/arhive/php-5.3.0/ext/phar/func_interceptors.c:1034
#3  0x083913f6 in zend_do_fcall_common_helper_SPEC (
execute_data=0x88126f4, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:313
#4  0x08395aec in ZEND_DO_FCALL_SPEC_CONST_HANDLER (
execute_data=0x88126f4, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:1601
#5  0x083906c6 in execute (op_array=0x87e2ecc, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:104
#6  0x0835ee92 in zend_execute_scripts (type=8, tsrm_ls=0x86ea050, 
retval=0x0, file_count=3)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend.c:1188
#7  0x082dacb9 in php_execute_script (primary_file=0xb660, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/main/main.c:2196
#8  0x08434634 in main (argc=2, argv=0xb7f4)
---Type return to continue, or q return to quit---
at /home/alin/Desktop/arhive/php-5.3.0/sapi/cli/php_cli.c:1188
(gdb) continue
Continuing.

Warning: stat(): stat failed for /mount/Arena/tickers.txt in
/home/alin/Desktop/test.php on line 3
bool(false)

Program exited normally.
---
 stat /mount/Arena2/tickers.txt
  File: `/mount/Arena2/tickers.txt'
  Size: 184118245   Blocks: 359680 IO Block: 16384  regular file
Device: 16h/22d Inode: 23080948090339228  Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (0/root)   Gid: (0/   
root)
Access: 2009-11-11 14:29:25.12500 +0200
Modify: 2009-11-10 17:26:20.099468800 +0200
Change: 2009-11-10 17:26:20.099468800 +0200


Reproduce code:
---
?php

var_dump(stat(/mount/Arena/tickers.txt));
?

Actual result:
--
Warning: stat(): stat failed for /mount/Arena/tickers.txt in
/home/alin/Desktop/test.php on line 3
bool(false)





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



#50139 [Opn-Fbk]: text in UTF-8 encoded xml cut off by xml parser with German umlauts

2009-11-11 Thread jani
 ID:   50139
 Updated by:   j...@php.net
 Reported By:  gros at mpdl dot mpg dot de
-Status:   Open
+Status:   Feedback
 Bug Type: XML Reader
 Operating System: Mac OS-X 10.6.2
 PHP Version:  5.3.0
 New Comment:

It might work better if your xml file told the encoding OR if you told
the xml_parser_create() the input encoding..


Previous Comments:


[2009-11-10 18:02:57] gros at mpdl dot mpg dot de

Just to add:
I also used curl for fetching this piece of xml and the result was the
same.



[2009-11-10 17:59:10] gros at mpdl dot mpg dot de

Description:

When parsing an xml file with UTF-8 encoding (like this one:
http://bit.ly/3PSi44), text containing German umlauts is cut off:

original:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

result after parsing:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag


Reproduce code:
---
$snippet = file_get_contents(http://bit.ly/3PSi44;);

if (!($xml_parser = xml_parser_create())) 
die(Couldn't create parser.);

xml_parser_set_option($xml_parser,
XML_OPTION_TARGET_ENCODING,'UTF-8');  

xml_set_element_handler($xml_parser,startElementHandler,endElementHandler);
xml_set_character_data_handler( 
$xml_parser,
characterDataHandler);

$retstr = ;
if(!xml_parse($xml_parser, 
$snippet)) 
{
$retstr = sprintf(XML 
error: %s at line %d,

xml_error_string(xml_get_error_code($xml_parser)),

xml_get_current_line_number($xml_parser));
}
xml_parser_free($xml_parser);




Expected result:

I expect properly imported text like outlined in the description:

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

should result in:
Kaiser Wilhelm Institut für Züchtungsforschung

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

should result in Societäts-Verlag

Actual result:
--
I get cut-off pieces of text when the text contains German umlauts (see
two examples in the description).

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

results in:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag





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



#50139 [Fbk]: text in UTF-8 encoded xml cut off by xml parser with German umlauts

2009-11-11 Thread jani
 ID:   50139
 Updated by:   j...@php.net
 Reported By:  gros at mpdl dot mpg dot de
 Status:   Feedback
 Bug Type: XML Reader
 Operating System: Mac OS-X 10.6.2
 PHP Version:  5.3.0
 New Comment:

Duh, i missed the very first line in your xml file. :)
So what you're actually reporting is that the input encoding isn't
detected properly?


Previous Comments:


[2009-11-11 12:41:12] j...@php.net

It might work better if your xml file told the encoding OR if you told
the xml_parser_create() the input encoding..



[2009-11-10 18:02:57] gros at mpdl dot mpg dot de

Just to add:
I also used curl for fetching this piece of xml and the result was the
same.



[2009-11-10 17:59:10] gros at mpdl dot mpg dot de

Description:

When parsing an xml file with UTF-8 encoding (like this one:
http://bit.ly/3PSi44), text containing German umlauts is cut off:

original:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

result after parsing:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag


Reproduce code:
---
$snippet = file_get_contents(http://bit.ly/3PSi44;);

if (!($xml_parser = xml_parser_create())) 
die(Couldn't create parser.);

xml_parser_set_option($xml_parser,
XML_OPTION_TARGET_ENCODING,'UTF-8');  

xml_set_element_handler($xml_parser,startElementHandler,endElementHandler);
xml_set_character_data_handler( 
$xml_parser,
characterDataHandler);

$retstr = ;
if(!xml_parse($xml_parser, 
$snippet)) 
{
$retstr = sprintf(XML 
error: %s at line %d,

xml_error_string(xml_get_error_code($xml_parser)),

xml_get_current_line_number($xml_parser));
}
xml_parser_free($xml_parser);




Expected result:

I expect properly imported text like outlined in the description:

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

should result in:
Kaiser Wilhelm Institut für Züchtungsforschung

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

should result in Societäts-Verlag

Actual result:
--
I get cut-off pieces of text when the text contains German umlauts (see
two examples in the description).

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

results in:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag





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



#50149 [Bgs]: Enabling dynamic extensions make Apache 2.2.14 crash at startup

2009-11-11 Thread msabatier dot perso at gmail dot com
 ID:   50149
 User updated by:  msabatier dot perso at gmail dot com
 Reported By:  msabatier dot perso at gmail dot com
 Status:   Bogus
 Bug Type: Dynamic loading
 Operating System: Windows 7
 PHP Version:  5.2.11
 New Comment:

The problem occurs even if I don't activate the php_mysql extension, so
no link to any missing libmysql DLL. Just enabling the php_gd2.dll
triggers the problem.

Plus I don't have the issue with 5.2.9 following exactly the same
install problem. So this is not a configuration problem.


Previous Comments:


[2009-11-11 11:43:42] paj...@php.net

You are certainly either missing a DLL or using the wrong DLL (libmysql
certainly).

Be sure to have the PHP directory (where the DLL are) first in your
PATH.

No issue here but configuration problem.



[2009-11-11 11:04:22] msabatier dot perso at gmail dot com

Description:

I installed PHP 5.2.11 via the installer on a Windows 7 with Apache
2.2.14. I chose to install 3 extensions MySQL, GD2 and XSL.

After editing http.conf to enable PHP, everything runs OK. Only prolem
found is that PHP errors are not appended to the Apache error log.

Then I go to the php.ini and enable any of the 3 extensions I
installed. Then try to restart Apache. Apache process start fails
without giving any error log.

I then uninstall PHP 5.2.11, install 5.2.9 and repeat the same process.
Everything runs fine this time.






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



#50139 [Fbk-Opn]: text in UTF-8 encoded xml cut off by xml parser with German umlauts

2009-11-11 Thread gros at mpdl dot mpg dot de
 ID:   50139
 User updated by:  gros at mpdl dot mpg dot de
 Reported By:  gros at mpdl dot mpg dot de
-Status:   Feedback
+Status:   Open
 Bug Type: XML Reader
 Operating System: Mac OS-X 10.6.2
 PHP Version:  5.3.0
 New Comment:

Thanks, but the file is telling it's encoding, actually. Both in the
header (application/xml) and in the file:
?xml version=1.0 encoding=UTF-8 standalone=yes?


And also using 

$xml_parser = xml_parser_create(UTF-8);

does not help!


Previous Comments:


[2009-11-11 12:42:16] j...@php.net

Duh, i missed the very first line in your xml file. :)
So what you're actually reporting is that the input encoding isn't
detected properly?



[2009-11-11 12:41:12] j...@php.net

It might work better if your xml file told the encoding OR if you told
the xml_parser_create() the input encoding..



[2009-11-10 18:02:57] gros at mpdl dot mpg dot de

Just to add:
I also used curl for fetching this piece of xml and the result was the
same.



[2009-11-10 17:59:10] gros at mpdl dot mpg dot de

Description:

When parsing an xml file with UTF-8 encoding (like this one:
http://bit.ly/3PSi44), text containing German umlauts is cut off:

original:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

result after parsing:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag


Reproduce code:
---
$snippet = file_get_contents(http://bit.ly/3PSi44;);

if (!($xml_parser = xml_parser_create())) 
die(Couldn't create parser.);

xml_parser_set_option($xml_parser,
XML_OPTION_TARGET_ENCODING,'UTF-8');  

xml_set_element_handler($xml_parser,startElementHandler,endElementHandler);
xml_set_character_data_handler( 
$xml_parser,
characterDataHandler);

$retstr = ;
if(!xml_parse($xml_parser, 
$snippet)) 
{
$retstr = sprintf(XML 
error: %s at line %d,

xml_error_string(xml_get_error_code($xml_parser)),

xml_get_current_line_number($xml_parser));
}
xml_parser_free($xml_parser);




Expected result:

I expect properly imported text like outlined in the description:

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

should result in:
Kaiser Wilhelm Institut für Züchtungsforschung

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

should result in Societäts-Verlag

Actual result:
--
I get cut-off pieces of text when the text contains German umlauts (see
two examples in the description).

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

results in:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag





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



#50139 [Opn-Fbk]: text in UTF-8 encoded xml cut off by xml parser with German umlauts

2009-11-11 Thread jani
 ID:   50139
 Updated by:   j...@php.net
 Reported By:  gros at mpdl dot mpg dot de
-Status:   Open
+Status:   Feedback
 Bug Type: XML Reader
 Operating System: Mac OS-X 10.6.2
 PHP Version:  5.3.0
 New Comment:

And please provide the complete script you used. It works fine for me
with very crude script..


Previous Comments:


[2009-11-11 12:46:47] gros at mpdl dot mpg dot de

Thanks, but the file is telling it's encoding, actually. Both in the
header (application/xml) and in the file:
?xml version=1.0 encoding=UTF-8 standalone=yes?


And also using 

$xml_parser = xml_parser_create(UTF-8);

does not help!



[2009-11-11 12:42:16] j...@php.net

Duh, i missed the very first line in your xml file. :)
So what you're actually reporting is that the input encoding isn't
detected properly?



[2009-11-11 12:41:12] j...@php.net

It might work better if your xml file told the encoding OR if you told
the xml_parser_create() the input encoding..



[2009-11-10 18:02:57] gros at mpdl dot mpg dot de

Just to add:
I also used curl for fetching this piece of xml and the result was the
same.



[2009-11-10 17:59:10] gros at mpdl dot mpg dot de

Description:

When parsing an xml file with UTF-8 encoding (like this one:
http://bit.ly/3PSi44), text containing German umlauts is cut off:

original:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

result after parsing:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag


Reproduce code:
---
$snippet = file_get_contents(http://bit.ly/3PSi44;);

if (!($xml_parser = xml_parser_create())) 
die(Couldn't create parser.);

xml_parser_set_option($xml_parser,
XML_OPTION_TARGET_ENCODING,'UTF-8');  

xml_set_element_handler($xml_parser,startElementHandler,endElementHandler);
xml_set_character_data_handler( 
$xml_parser,
characterDataHandler);

$retstr = ;
if(!xml_parse($xml_parser, 
$snippet)) 
{
$retstr = sprintf(XML 
error: %s at line %d,

xml_error_string(xml_get_error_code($xml_parser)),

xml_get_current_line_number($xml_parser));
}
xml_parser_free($xml_parser);




Expected result:

I expect properly imported text like outlined in the description:

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

should result in:
Kaiser Wilhelm Institut für Züchtungsforschung

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

should result in Societäts-Verlag

Actual result:
--
I get cut-off pieces of text when the text contains German umlauts (see
two examples in the description).

parsing this:
e:organization-nameKaiser Wilhelm Institut für
Züchtungsforschung/e:organization-name

results in:
Kaiser Wilhelm Institut f

or parsing this
dc:publisherSocietäts-Verlag/dc:publisher

results in äts-Verlag





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



#50150 [Com]: function stat(),lstat() dosn't wonk on a mounted cifs

2009-11-11 Thread balanalin2003 at yahoo dot com
 ID:   50150
 Comment by:   balanalin2003 at yahoo dot com
 Reported By:  balanalin2003 at yahoo dot com
 Status:   Feedback
 Bug Type: Streams related
 Operating System: ubuntu 9.10
 PHP Version:  5.3.0
 New Comment:

well i think is not the same because if i run from the terminal:

stat /mount/Arena2/tickers.txt 

i get:

 stat /mount/Arena2/tickers.txt
  File: `/mount/Arena2/tickers.txt'
  Size: 184118245   Blocks: 359680 IO Block: 16384  regular file
Device: 16h/22d Inode: 23080948090339228  Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (0/root)   Gid: (0/   
root)
Access: 2009-11-11 14:29:25.12500 +0200
Modify: 2009-11-10 17:26:20.099468800 +0200
Change: 2009-11-10 17:26:20.099468800 +0200

if i have a script like this:

?php

$fp=fopen(/mount/Arena2/tickers.txt,r);
echo (fgets($fp));
?

i get first line from that file;
only stat() is the problem


Previous Comments:


[2009-11-11 12:38:02] j...@php.net

And you're sure it's not this bug:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/220658



[2009-11-11 12:34:30] balanalin2003 at yahoo dot com

Description:

Starting program: /php-cli/bin/php /home/alin/Desktop/test.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_stat (
filename=0x87e2e80 /mount/Arena/tickers.txt, 
filename_length=24, type=17, return_value=0x87e283c, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:762
762 {
(gdb) bt
#0  php_stat (filename=0x87e2e80 /mount/Arena/tickers.txt, 
filename_length=24, type=17, return_value=0x87e283c, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:762
#1  0x0826c85b in php_if_stat (ht=1, return_value=0x87e283c, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
tsrm_ls=0x86ea050)
at
/home/alin/Desktop/arhive/php-5.3.0/ext/standard/filestat.c:1125
#2  0x081ca23c in phar_stat (ht=1, return_value=0x87e283c, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, 
tsrm_ls=0x86ea050)
at
/home/alin/Desktop/arhive/php-5.3.0/ext/phar/func_interceptors.c:1034
#3  0x083913f6 in zend_do_fcall_common_helper_SPEC (
execute_data=0x88126f4, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:313
#4  0x08395aec in ZEND_DO_FCALL_SPEC_CONST_HANDLER (
execute_data=0x88126f4, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:1601
#5  0x083906c6 in execute (op_array=0x87e2ecc, tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend_vm_execute.h:104
#6  0x0835ee92 in zend_execute_scripts (type=8, tsrm_ls=0x86ea050, 
retval=0x0, file_count=3)
at /home/alin/Desktop/arhive/php-5.3.0/Zend/zend.c:1188
#7  0x082dacb9 in php_execute_script (primary_file=0xb660, 
tsrm_ls=0x86ea050)
at /home/alin/Desktop/arhive/php-5.3.0/main/main.c:2196
#8  0x08434634 in main (argc=2, argv=0xb7f4)
---Type return to continue, or q return to quit---
at /home/alin/Desktop/arhive/php-5.3.0/sapi/cli/php_cli.c:1188
(gdb) continue
Continuing.

Warning: stat(): stat failed for /mount/Arena/tickers.txt in
/home/alin/Desktop/test.php on line 3
bool(false)

Program exited normally.
---
 stat /mount/Arena2/tickers.txt
  File: `/mount/Arena2/tickers.txt'
  Size: 184118245   Blocks: 359680 IO Block: 16384  regular file
Device: 16h/22d Inode: 23080948090339228  Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (0/root)   Gid: (0/   
root)
Access: 2009-11-11 14:29:25.12500 +0200
Modify: 2009-11-10 17:26:20.099468800 +0200
Change: 2009-11-10 17:26:20.099468800 +0200


Reproduce code:
---
?php

var_dump(stat(/mount/Arena/tickers.txt));
?

Actual result:
--
Warning: stat(): stat failed for /mount/Arena/tickers.txt in
/home/alin/Desktop/test.php on line 3
bool(false)





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



#50136 [Opn-Bgs]: typo

2009-11-11 Thread iliaa
 ID:   50136
 Updated by:   il...@php.net
 Reported By:  chris42 dot b at googlemail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: SPL related
 Operating System: linux
 PHP Version:  5.2SVN-2009-11-10 (snap)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.


Previous Comments:


[2009-11-10 10:44:27] chris42 dot b at googlemail dot com

Description:

Typo in SplFileInfo, when SplFileInfo::getType fails.

Lstat instead of stat


Reproduce code:
---
?php

$file = new SplFileInfo('not_here');

try {
$file-getType();
} catch(Exception $e) {
echo $e-getMessage() . \n;
}

?

Expected result:

SplFileInfo::getType(): stat failed for not_here

Actual result:
--
SplFileInfo::getType(): Lstat failed for not_here





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



#50149 [Bgs]: Enabling dynamic extensions make Apache 2.2.14 crash at startup

2009-11-11 Thread pajoye
 ID:   50149
 Updated by:   paj...@php.net
 Reported By:  msabatier dot perso at gmail dot com
 Status:   Bogus
 Bug Type: Dynamic loading
 Operating System: Windows 7
 PHP Version:  5.2.11
 New Comment:

tr in CLI, that may give you more details:

 cd c:\php
 php -d extension_dir=ext -d extension=php_gd2.dll -m


Previous Comments:


[2009-11-11 12:43:22] msabatier dot perso at gmail dot com

The problem occurs even if I don't activate the php_mysql extension, so
no link to any missing libmysql DLL. Just enabling the php_gd2.dll
triggers the problem.

Plus I don't have the issue with 5.2.9 following exactly the same
install problem. So this is not a configuration problem.



[2009-11-11 11:43:42] paj...@php.net

You are certainly either missing a DLL or using the wrong DLL (libmysql
certainly).

Be sure to have the PHP directory (where the DLL are) first in your
PATH.

No issue here but configuration problem.



[2009-11-11 11:04:22] msabatier dot perso at gmail dot com

Description:

I installed PHP 5.2.11 via the installer on a Windows 7 with Apache
2.2.14. I chose to install 3 extensions MySQL, GD2 and XSL.

After editing http.conf to enable PHP, everything runs OK. Only prolem
found is that PHP errors are not appended to the Apache error log.

Then I go to the php.ini and enable any of the 3 extensions I
installed. Then try to restart Apache. Apache process start fails
without giving any error log.

I then uninstall PHP 5.2.11, install 5.2.9 and repeat the same process.
Everything runs fine this time.






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



#50142 [Fbk-Opn]: parse_ini_file() constants not used correctly

2009-11-11 Thread jparneodo at yahoo dot fr
 ID:   50142
 User updated by:  jparneodo at yahoo dot fr
 Reported By:  jparneodo at yahoo dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: Filesystem function related
 Operating System: Ubuntu
 PHP Version:  5.2.11
 New Comment:

None of 5.2 versions tried has the correct value.

And yes, the correct expected value is:
ONE=1 TWO=2.1 THREE=bug.2.1 1


Previous Comments:


[2009-11-11 00:13:16] f...@php.net

What PHP version gave you your expected result?

With 5.2.6 I get this last line:
ONE=1 TWO=2.1 THREE=bug.TWO ONE

With 5.3.1-RC I get this:
ONE=1 TWO=2.1 THREE=bug.2.1 1

With 5.2.11 I get this:
ONE=1 TWO=2.1 THREE=bug.TWO ONE



[2009-11-10 19:44:38] jparneodo at yahoo dot fr

Description:

Item THREE has bad value.

Input file /tmp/jp.ini:

[CONSTANT]
ONE = 1
TWO = 2. ONE
THREE = bug. TWO ONE


Reproduce code:
---
?php
var_dump($ini1=parse_ini_file('/tmp/jp.ini',true));
define('ONE',$ini1['CONSTANT']['ONE']);
echo sprintf(ONE=%s\n,ONE);

var_dump($ini2=parse_ini_file('/tmp/jp.ini',true));
define('TWO',$ini2['CONSTANT']['TWO']);
echo sprintf(ONE=%s TWO=%s\n,ONE,TWO);

var_dump($ini3=parse_ini_file('/tmp/jp.ini',true));
define('THREE',$ini3['CONSTANT']['THREE']);
echo sprintf(ONE=%s TWO=%s THREE=%s\n,ONE,TWO,THREE);


Expected result:

array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.2.1
  }
}
ONE=1 TWO=2.1 THREE=bug.2.1


Actual result:
--
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1 THREE=c.TWO ONE






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



#50142 [Opn-Csd]: parse_ini_file() constants not used correctly

2009-11-11 Thread jani
 ID:   50142
 Updated by:   j...@php.net
 Reported By:  jparneodo at yahoo dot fr
-Status:   Open
+Status:   Closed
 Bug Type: Filesystem function related
 Operating System: Ubuntu
 PHP Version:  5.2.11
 New Comment:

So it's fixed in (feature added) in 5.3, won't fix (add the feature)
for 5.2.


Previous Comments:


[2009-11-11 13:41:37] jparneodo at yahoo dot fr

None of 5.2 versions tried has the correct value.

And yes, the correct expected value is:
ONE=1 TWO=2.1 THREE=bug.2.1 1



[2009-11-11 00:13:16] f...@php.net

What PHP version gave you your expected result?

With 5.2.6 I get this last line:
ONE=1 TWO=2.1 THREE=bug.TWO ONE

With 5.3.1-RC I get this:
ONE=1 TWO=2.1 THREE=bug.2.1 1

With 5.2.11 I get this:
ONE=1 TWO=2.1 THREE=bug.TWO ONE



[2009-11-10 19:44:38] jparneodo at yahoo dot fr

Description:

Item THREE has bad value.

Input file /tmp/jp.ini:

[CONSTANT]
ONE = 1
TWO = 2. ONE
THREE = bug. TWO ONE


Reproduce code:
---
?php
var_dump($ini1=parse_ini_file('/tmp/jp.ini',true));
define('ONE',$ini1['CONSTANT']['ONE']);
echo sprintf(ONE=%s\n,ONE);

var_dump($ini2=parse_ini_file('/tmp/jp.ini',true));
define('TWO',$ini2['CONSTANT']['TWO']);
echo sprintf(ONE=%s TWO=%s\n,ONE,TWO);

var_dump($ini3=parse_ini_file('/tmp/jp.ini',true));
define('THREE',$ini3['CONSTANT']['THREE']);
echo sprintf(ONE=%s TWO=%s THREE=%s\n,ONE,TWO,THREE);


Expected result:

array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.2.1
  }
}
ONE=1 TWO=2.1 THREE=bug.2.1


Actual result:
--
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(5) 2.ONE
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1
array(1) {
  [CONSTANT]=
  array(3) {
[ONE]=
string(1) 1
[TWO]=
string(3) 2.1
[THREE]=
string(9) bug.TWO ONE
  }
}
ONE=1 TWO=2.1 THREE=c.TWO ONE






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



#50141 [Opn-Csd]: folders inside a zip archive are not displayed

2009-11-11 Thread samantha86 at web dot de
 ID:   50141
 User updated by:  samantha86 at web dot de
 Reported By:  samantha86 at web dot de
-Status:   Open
+Status:   Closed
 Bug Type: Zip Related
 Operating System: windows (xp and 7)
 PHP Version:  5.3.0
 New Comment:

now i feel pretty sheepish...

  ,---@
   W-W'

thank you for your support, it works under ubuntu/xp and 7 now!


Previous Comments:


[2009-11-11 12:11:12] f...@php.net

Addendum:
if I change
  $zip-addDir(PATH./example, /example);
to
  $zip-addDir(PATH./example, example);
I can avoid this in 5.2.6 (debian php), 5.3.0 and 5.3.1RC3
and get:
example/x.ini



[2009-11-11 09:40:21] samantha86 at web dot de

oh sorry that piece: /languages);
was too much, it is not in my orignal code. just a copy and paste
error.



[2009-11-11 09:38:54] samantha86 at web dot de

yes, this folder includes some other folders, which can be seen when
using a linux machine.

the structure should look like this:

myzipfile.zip
   |_ /admin
   |_ /core
   |_ ...some othe folders...
   |_ config.php
   |_ ...some other files in the root of the zipfile...

the code i use to add the directories/files it looks exactly like
this:

?php
...
//for the directories:
$zip-addDir(PATH./admin, /admin);
$zip-addDir(PATH./core, /core);/languages);
...
for the files:
$zip-addFile(PATH./backup/files/config.php, config.php);
$zip-addFile(PATH./backup/files/index.php, index.php);
...
?



[2009-11-10 23:47:13] f...@php.net

If I open your zip file with 7-ZIP instead of the integrated windows
zip tool, there's a folder with a weird name.

Might be just a blank space, might be a null byte.
But in that folder I see many folders:
admin / backup / core / installation / and some more

Can you please verify that your generated subfolder name is not just
incorrectly set?



[2009-11-10 20:03:02] samantha86 at web dot de

here is some example code, an already generated zip file can be
downloaded at my demoserver
http://steffisgarten.bplaced.net/chillyCMS/admin/tools.site.php?tool=backup
username: admin, pw: demo
maybe this can save you some time.

?php
class Zipper extends ZipArchive {

public function addDir($path, $newname) {
$nodes = glob($path.DIRECTORY_SEPARATOR.*);
if (!empty($nodes)) {
foreach ($nodes as $node) {
//exclude temporary files
if (substr($node,-1)!=~) {
$newnode=substr($node,strlen($path)+1);
$newnode=$newname.DIRECTORY_SEPARATOR.$newnode;
if (is_dir($node)) {
$this-addDir($node,$newnode);
} else if (is_file($node))  {
$this-addFile($node,$newnode);
}
}
}
}
}

}

$zip=new Zipper();
if ($zip-open($file_dest, ZIPARCHIVE::CREATE)) {
$zip-addDir(PATH./example, /example);
} else {
echo error;
}
?



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/50141

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



#50151 [NEW]: ODBC UPDATE query fails when using certain dates

2009-11-11 Thread chris at grcmc dot org
From: chris at grcmc dot org
Operating system: Windows XP SP3
PHP version:  5.3.0
PHP Bug Type: ODBC related
Bug description:  ODBC UPDATE query fails when using certain dates

Description:

When performing an UPDATE statement using odbc_exec, connected to an
Access 97 MDB database, queries fail when using a date between 8/22/2010
and 1/30/2011.  Access database is confirmed to NOT have any filters or
restrictions placed on the field in question, and the same SQL statement
properly executes when entered directly into Access query builder.

When this error occurs, it causes all subsequent UPDATE statements to
fail, even if they do not contain one of the black dates.  SELECT
statements placed before and after a failed query continue to function
properly.

Using Apache 2.2.11 (Win32).  Original code used the MDB via a network
path, but I have isolated the related code and tested with a local MDB with
the same results.


Config line
---
cscript /nologo configure.js --enable-snapshot-build --disable-isapi
--enable-debug-pack
--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared
--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared
--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
--with-enchant=shared

Reproduce code:
---
$cn = odbc_connect('Driver={Microsoft Access Driver (*.mdb)};
DBQ=Access97Database.mdb','','');

// query will work, returns 1/1/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID =
12431);
print_r(odbc_fetch_array($query_obj));

// statement will work
odbc_exec($cn, UPDATE tblPerson SET ExpireDate = #8/21/2010# WHERE ID =
12431);
print odbc_errormsg();

// query will work, returns 8/21/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID =
12431);
print_r(odbc_fetch_array($query_obj));

// statement will fail with error
odbc_exec($cn, UPDATE tblPerson SET ExpireDate = #8/22/2010# WHERE ID =
12431);
print odbc_errormsg();

// query will succed, returns 8/21/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID =
12431);
print_r(odbc_fetch_array($query_obj));

// same as first update statement, but will fail with same error as
previous
odbc_exec($cn, UPDATE tblPerson SET ExpireDate = #8/21/2010# WHERE ID =
12431);
print odbc_errormsg();

// query will work, returns 8/21/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID =
12431);
print_r(odbc_fetch_array($query_obj));

Expected result:

Expected behavior is successful execution of the query.  As is
demonstrated in the reproduction code, nothing changes between a query that
will work and a query that will fail save the date.

Actual result:
--
The actual result is as described in bug report, and the error received is
as follows:

---
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC
Microsoft Access Driver] Cannot open database '|'. It may not be a database
that your application recognizes, or the file may be corrupt., SQL state
S1000 in SQLExecDirect in C:\wamp\www\automation\odbc_bug.php on line 16
---

Line 16 is the UPDATE statement containing 8/22/2010.

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

#50151 [Opn]: ODBC UPDATE query fails when using certain dates

2009-11-11 Thread chris at grcmc dot org
 ID:   50151
 User updated by:  chris at grcmc dot org
 Reported By:  chris at grcmc dot org
 Status:   Open
 Bug Type: ODBC related
 Operating System: Windows XP SP3
 PHP Version:  5.3.0
 New Comment:

I forgot to mention, the black date range is from 8/22/2010 to
1/30/2011.  Any date outside this range works, any date within the range
fails.


Previous Comments:


[2009-11-11 15:53:59] chris at grcmc dot org

Description:

When performing an UPDATE statement using odbc_exec, connected to an
Access 97 MDB database, queries fail when using a date between 8/22/2010
and 1/30/2011.  Access database is confirmed to NOT have any filters or
restrictions placed on the field in question, and the same SQL statement
properly executes when entered directly into Access query builder.

When this error occurs, it causes all subsequent UPDATE statements to
fail, even if they do not contain one of the black dates.  SELECT
statements placed before and after a failed query continue to function
properly.

Using Apache 2.2.11 (Win32).  Original code used the MDB via a network
path, but I have isolated the related code and tested with a local MDB
with the same results.


Config line
---
cscript /nologo configure.js --enable-snapshot-build
--disable-isapi --enable-debug-pack
--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared
--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared
--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared
--with-enchant=shared

Reproduce code:
---
$cn = odbc_connect('Driver={Microsoft Access Driver (*.mdb)};
DBQ=Access97Database.mdb','','');

// query will work, returns 1/1/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID
= 12431);
print_r(odbc_fetch_array($query_obj));

// statement will work
odbc_exec($cn, UPDATE tblPerson SET ExpireDate = #8/21/2010# WHERE ID
= 12431);
print odbc_errormsg();

// query will work, returns 8/21/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID
= 12431);
print_r(odbc_fetch_array($query_obj));

// statement will fail with error
odbc_exec($cn, UPDATE tblPerson SET ExpireDate = #8/22/2010# WHERE ID
= 12431);
print odbc_errormsg();

// query will succed, returns 8/21/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID
= 12431);
print_r(odbc_fetch_array($query_obj));

// same as first update statement, but will fail with same error as
previous
odbc_exec($cn, UPDATE tblPerson SET ExpireDate = #8/21/2010# WHERE ID
= 12431);
print odbc_errormsg();

// query will work, returns 8/21/2010
$query_obj = odbc_exec($cn, SELECT ExpireDate FROM tblPerson WHERE ID
= 12431);
print_r(odbc_fetch_array($query_obj));

Expected result:

Expected behavior is successful execution of the query.  As is
demonstrated in the reproduction code, nothing changes between a query
that will work and a query that will fail save the date.

Actual result:
--
The actual result is as described in bug report, and the error received
is as follows:

---
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC
Microsoft Access Driver] Cannot open database '|'. It may not be a
database that your application recognizes, or the file may be corrupt.,
SQL state S1000 in SQLExecDirect in C:\wamp\www\automation\odbc_bug.php
on line 16
---

Line 16 is the UPDATE statement containing 8/22/2010.





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



#50139 [Fbk-Opn]: text in UTF-8 encoded xml cut off by xml parser with German umlauts

2009-11-11 Thread gros at mpdl dot mpg dot de
 ID:   50139
 User updated by:  gros at mpdl dot mpg dot de
 Reported By:  gros at mpdl dot mpg dot de
-Status:   Feedback
+Status:   Open
 Bug Type: XML Reader
 Operating System: Mac OS-X 10.6.2
-PHP Version:  5.3.0
+PHP Version:  5.3.0 - 5.2.5
 New Comment:

Apologies, apparently there are two php installations on my system. The
one that the xampp installation uses is actually 5.2.5, not 5.3.0. 


I am using DOMDocument now for parsing and it works like a charm.


Previous Comments:


[2009-11-11 12:47:59] j...@php.net

And please provide the complete script you used. It works fine for me
with very crude script..



[2009-11-11 12:46:47] gros at mpdl dot mpg dot de

Thanks, but the file is telling it's encoding, actually. Both in the
header (application/xml) and in the file:
?xml version=1.0 encoding=UTF-8 standalone=yes?


And also using 

$xml_parser = xml_parser_create(UTF-8);

does not help!



[2009-11-11 12:42:16] j...@php.net

Duh, i missed the very first line in your xml file. :)
So what you're actually reporting is that the input encoding isn't
detected properly?



[2009-11-11 12:41:12] j...@php.net

It might work better if your xml file told the encoding OR if you told
the xml_parser_create() the input encoding..



[2009-11-10 18:02:57] gros at mpdl dot mpg dot de

Just to add:
I also used curl for fetching this piece of xml and the result was the
same.



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/50139

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



#50148 [Opn-Csd]: [PATCH] - zend_get_property_info should check for Z_TYPE_P(member) == IS_STRING

2009-11-11 Thread felipe
 ID:   50148
 Updated by:   fel...@php.net
 Reported By:  yoarvi at gmail dot com
-Status:   Open
+Status:   Closed
 Bug Type: Unicode Engine related
 Operating System: Solaris 10/SPARC
 PHP Version:  6SVN-2009-11-11 (SVN)
 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.

Thanks!


Previous Comments:


[2009-11-11 10:43:01] yoarvi at gmail dot com

Description:

When I ran 'gmake test' on my PHP6 tree on Solaris 10 (SPARC), I
noticed many test failures.



The following patch fixes many(~350) of these test failures:

Index: Zend/zend_object_handlers.c
===
--- Zend/zend_object_handlers.c (revision 290471)
+++ Zend/zend_object_handlers.c (working copy)
@@ -198,7 +198,7 @@
ulong h;

if ((Z_TYPE_P(member) == IS_UNICODE  Z_USTRVAL_P(member)[0]
== 0) ||
-   Z_STRVAL_P(member)[0] == '\0') {
+   (Z_TYPE_P(member) == IS_STRING  Z_STRVAL_P(member)[0] ==
'\0')) {
if (!silent) {
if (Z_UNILEN_P(member) == 0) {
zend_error(E_ERROR, Cannot access
empty property);


Reproduce code:
---
% sapi/cli/php tests/classes/__call_001.php


Expected result:

Method test called:
array(4) {
  [0]=
  int(1)
  [1]=
  unicode(1) 2
  [2]=
  float(3.4)
  [3]=
  bool(true)
}
array(3) {
  [0]=
  int(1)
  [1]=
  int(2)
  [2]=
  int(3)
}


Actual result:
--
Method test called:
array(4) {
  [0]=
  int(1)
  [1]=
  unicode(1) 2
  [2]=
  float(3.4)
  [3]=
  bool(true)
}

Fatal error: Cannot access property started with '\0' in
/space/arvind/php-src-6/tests/classes/__call_001.phpt on line 14





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



#48614 [Com]: Loading pdo_sqlite.so fails: undefined symbol: sqlite3_libversion

2009-11-11 Thread kenashkov at gmail dot com
 ID:   48614
 Comment by:   kenashkov at gmail dot com
 Reported By:  kaspernj at gmail dot com
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Ubuntu Jaunty
 PHP Version:  5.3.0RC4
 Assigned To:  scottmac
 New Comment:

I'm able to reproduce this with 5.3.1 RC3 on debian 5.


Previous Comments:


[2009-08-23 00:22:27] koubel at volny dot cz

yes, same problem with php 5.3.0 final instalation on debian stable



[2009-07-09 18:18:07] dkepplinger at gmail dot com

I have the same problem with PHP 5.3 on Debian 5.0.2 when loading the
pdo_sqlite.so extension in the config file.



[2009-06-23 07:18:49] dominics at gmail dot com

I can reproduce this bug (Debian Lenny) with the following minimal
configure line:

./configure --with-zlib --enable-pdo=shared --with-sqlite=shared
--with-pdo-sqlite=shared

For now, not building PDO as shared seems to be a workaround.



[2009-06-20 16:41:46] kaspernj at gmail dot com

sqlite3.so loads fine.

It does not help to load pdo_sqlite.so afterwards though - getting
the exact same error.

Here is what I did:
#!/opt/php53/bin/php
?php
dl(gd.so);
dl(sqlite3.so);
dl(pdo.so);
dl(pdo_sqlite.so);
echo(Hejsa\n);
?



[2009-06-20 16:35:43] scott...@php.net

If you load

sqlite3.so first does it 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/48614

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



#50140 [Fbk]: [PATCH] With default compilation option, php symbols are unresolved for nsapi

2009-11-11 Thread basantk
 ID:   50140
 Updated by:   basa...@php.net
 Reported By:  basant dot kukreja at gmail dot com
 Status:   Feedback
 Bug Type: iPlanet related
 Operating System: Linux
 PHP Version:  5.3SVN-2009-11-10 (SVN)
 New Comment:

Thanks Jani for your suggestion. Based on your suggestion, I have
revised the patch. Here is the new patch :
-
Index: sapi/nsapi/nsapi.c
===
--- sapi/nsapi/nsapi.c  (revision 290447)
+++ sapi/nsapi/nsapi.c  (working copy)
@@ -67,6 +67,11 @@
  * NSAPI includes
  */
 #include nsapi.h
+/* fix for gcc4 visibility issue */
+#ifndef PHP_WIN32
+# undef NSAPI_PUBLIC
+# define NSAPI_PUBLIC PHPAPI
+#endif
 
 #define NSLS_D struct nsapi_request_context *request_context
 #define NSLS_DC, NSLS_D
---

With this patch, when I preprocess the file, on linux I get following
for php5_init :

int __attribute__ ((visibility(default))) php5_init(pblock *pb,
Session *sn, Request *rq)
---

The above correctly export the symbols.



Previous Comments:


[2009-11-11 12:35:11] j...@php.net

Check how this is fixed for Apache: sapi/apache2handler/php_apache.h
and search for visibility. I think you should do that instead of using
any #pragma's.



[2009-11-10 19:20:57] basa...@php.net

From nsapi.h : 

#ifdef XP_UNIX
#define NSAPI_PUBLIC
...

It seems NSAPI_PUBLIC is expanded to empty string.



When I expanded after preprocessing nsapi.c, here is what I got :

# 915 .../php-src-5.3/sapi/nsapi/nsapi.c
int php5_init(pblock *pb, Session *sn, Request *rq)

--
So we need to tell gcc to export the NSAPI_PUBLIC symbols.



[2009-11-10 19:14:51] basa...@php.net

The previous patch didn't resolve the problem, here is what helped 
resolved the issue. NSAPI_PUBLIC should have made the symbols public
but it seems it doesn't.

Index: sapi/nsapi/nsapi.c
===
--- sapi/nsapi/nsapi.c  (revision 290447)
+++ sapi/nsapi/nsapi.c  (working copy)
@@ -67,6 +67,7 @@
  * NSAPI includes
  */
 #include nsapi.h
+#pragma GCC visibility push(default)
 
 #define NSLS_D struct nsapi_request_context *request_context
 #define NSLS_DC, NSLS_D



[2009-11-10 18:59:16] basa...@php.net

Here is the snipp from gcc man page :
man gcc

 -fvisibility=default|internal|hidden|protected
...
  For those adding visibility support to existing code, you may
find #pragma GCC visibility of
   use.  This works by you enclosing the declarations you wish
to set visibility for with (for
   example) #pragma GCC visibility push(hidden) and #pragma GCC
visibility pop. 
...



Pusing default visibility before including nsapi.h (and popping after)
would
help in compiling and loading php correctly with nsapi servers.

Here is the patch against recent php 5.3 svn

Index: sapi/nsapi/nsapi.c
===
--- sapi/nsapi/nsapi.c  (revision 290447)
+++ sapi/nsapi/nsapi.c  (working copy)
@@ -66,7 +66,9 @@
 /*
  * NSAPI includes
  */
+#pragma GCC visibility push(default)
 #include nsapi.h
+#pragma GCC visibility pop
 
 #define NSLS_D struct nsapi_request_context *request_context
 #define NSLS_DC, NSLS_D






[2009-11-10 18:48:30] basa...@php.net

Here is how symbols looks like :


$ nm .libs/libphp5.so | grep php5
004dcfb7 t php5_auth_trans
004dc661 t php5_close
004dc802 t php5_execute
004dc6d4 t php5_init

Symbols are not exported by default.

If we remove 
-fvisibility=hidden from compilation options then php compiles
fine and server is able to load libphp5.so correctly.




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/50140

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



#50141 [Csd-Bgs]: folders inside a zip archive are not displayed

2009-11-11 Thread pajoye
 ID:   50141
 Updated by:   paj...@php.net
 Reported By:  samantha86 at web dot de
-Status:   Closed
+Status:   Bogus
 Bug Type: Zip Related
 Operating System: windows (xp and 7)
 PHP Version:  5.3.0


Previous Comments:


[2009-11-11 15:31:13] samantha86 at web dot de

now i feel pretty sheepish...

  ,---@
   W-W'

thank you for your support, it works under ubuntu/xp and 7 now!



[2009-11-11 12:11:12] f...@php.net

Addendum:
if I change
  $zip-addDir(PATH./example, /example);
to
  $zip-addDir(PATH./example, example);
I can avoid this in 5.2.6 (debian php), 5.3.0 and 5.3.1RC3
and get:
example/x.ini



[2009-11-11 09:40:21] samantha86 at web dot de

oh sorry that piece: /languages);
was too much, it is not in my orignal code. just a copy and paste
error.



[2009-11-11 09:38:54] samantha86 at web dot de

yes, this folder includes some other folders, which can be seen when
using a linux machine.

the structure should look like this:

myzipfile.zip
   |_ /admin
   |_ /core
   |_ ...some othe folders...
   |_ config.php
   |_ ...some other files in the root of the zipfile...

the code i use to add the directories/files it looks exactly like
this:

?php
...
//for the directories:
$zip-addDir(PATH./admin, /admin);
$zip-addDir(PATH./core, /core);/languages);
...
for the files:
$zip-addFile(PATH./backup/files/config.php, config.php);
$zip-addFile(PATH./backup/files/index.php, index.php);
...
?



[2009-11-10 23:47:13] f...@php.net

If I open your zip file with 7-ZIP instead of the integrated windows
zip tool, there's a folder with a weird name.

Might be just a blank space, might be a null byte.
But in that folder I see many folders:
admin / backup / core / installation / and some more

Can you please verify that your generated subfolder name is not just
incorrectly set?



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/50141

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



#50152 [Opn-Asn]: ReflectionClass::hasPropertys hehaves like isset() not property_exists

2009-11-11 Thread felipe
 ID:   50152
 Updated by:   fel...@php.net
 Reported By:  fel...@php.net
-Status:   Open
+Status:   Assigned
 Bug Type: Reflection related
 Operating System: Linux
 PHP Version:  5.3SVN-2009-11-11 (SVN)
-Assigned To:  
+Assigned To:  felipe


Previous Comments:


[2009-11-11 18:39:41] fel...@php.net

Description:

This change looks to be introduced accidentaly in HEAD, and was MFHd by
me times ago. the hasProperty() is currently using the __isset magic
method, this doesn't look right from a reflection perspective. It must
behaves like property_exists() that doesn't uses the magic stuff.

Reproduce code:
---
?php

class foo {
function __isset($a) {
var_dump($a);   
return 1;
}
}

$x = new foo;
$ref = new ReflectionObject($x);
var_dump($ref-hasProperty('b'));


Expected result:

bool(false)

Actual result:
--
string(1) b
bool(true)






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



#50152 [Asn-Csd]: ReflectionClass::hasProperty behaves like isset() not property_exists

2009-11-11 Thread felipe
 ID:   50152
 Updated by:   fel...@php.net
-Summary:  ReflectionClass::hasProperty hehaves like isset() not
   property_exists
 Reported By:  fel...@php.net
-Status:   Assigned
+Status:   Closed
 Bug Type: Reflection related
 Operating System: Linux
 PHP Version:  5.3SVN-2009-11-11 (SVN)
 Assigned To:  felipe
 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.

5.2 is okay, it already checks like property_exists().


Previous Comments:


[2009-11-11 18:52:15] s...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=290515
Log: - Fixed bug #50152 (ReflectionClass::hasProperty hehaves like
isset() not property_exists)
  [5_2 is OK]



[2009-11-11 18:39:41] fel...@php.net

Description:

This change looks to be introduced accidentaly in HEAD, and was MFHd by
me times ago. the hasProperty() is currently using the __isset magic
method, this doesn't look right from a reflection perspective. It must
behaves like property_exists() that doesn't uses the magic stuff.

Reproduce code:
---
?php

class foo {
function __isset($a) {
var_dump($a);   
return 1;
}
}

$x = new foo;
$ref = new ReflectionObject($x);
var_dump($ref-hasProperty('b'));


Expected result:

bool(false)

Actual result:
--
string(1) b
bool(true)






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



#50146 [Opn-Csd]: property_exists: Closure object cannot have properties

2009-11-11 Thread felipe
 ID:   50146
 Updated by:   fel...@php.net
 Reported By:  spam04 at pornel dot net
-Status:   Open
+Status:   Closed
 Bug Type: Reflection related
 Operating System: *
 PHP Version:  5.3SVN-2009-11-11 (snap)
-Assigned To:  
+Assigned To:  felipe
 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:


[2009-11-11 10:24:24] spam04 at pornel dot net

Description:

property_exists() rejects closures with Closure object cannot have
properties rather than simply always returning false.

Since closures pass is_object() test, it's hard to avoid this error
without testing for instanceof Closure as well, which is discouraged
in the docs.


Reproduce code:
---
$obj = function(){}

is_object($obj)  property_exists($obj,'foo');


Expected result:

false

(either they should not be considered objects, or property_exists
should accept any object).


Actual result:
--
Closure object cannot have properties





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



#45351 [Opn]: Exception::getTrace() should return 'object' array-element

2009-11-11 Thread lasse100 at planet dot nl
 ID:   45351
 User updated by:  lasse100 at planet dot nl
 Reported By:  lasse100 at planet dot nl
 Status:   Open
-Bug Type: Feature/Change Request
+Bug Type: Class/Object related
 Operating System: Irrelevant
-PHP Version:  5.2.6
+PHP Version:  5.3
 New Comment:

.


Previous Comments:


[2008-07-09 19:11:38] cgamesplay at cgamesplay dot com

cc



[2008-06-24 20:23:26] lasse100 at planet dot nl

Description:

As in function debug_backtrace(), the method Exception::getTrace()
should return a array with a 'object' element, representing the current
object.

The method Exception::getTrace() should also have a $provide_object
parameter like the parameter in function debug_backtrace(), to disable
the 'object'-element in the array.

Reproduce code:
---
?php
class Foo {
public $bar;
public function __construct($bar) {
$this-bar = $bar;
echo 'debug_backtrace: pre';
var_dump(debug_backtrace());
echo '/pre';
throw new Exception('Foo throws an exception!');
}
}
try {
$foo = new Foo('test');
} catch (Exception $e) {
echo 'Exception::getTrace(): pre';
var_dump($e-getTrace());
echo '/pre';
}
?

Expected result:

debug_backtrace:

array(1) {
  [0]=
  array(7) {
[file]=
string(50) C:\server\apache\htdocs\forum\htdocs\bugreport.php
[line]=
int(13)
[function]=
string(11) __construct
[class]=
string(3) Foo
[object]=
object(Foo)#1 (1) {
  [bar]=
  string(4) test
}
[type]=
string(2) -
[args]=
array(1) {
  [0]=
  string(4) test
}
  }
}

Exception::getTrace():

array(1) {
  [0]=
  array(6) {
[file]=
string(50) C:\server\apache\htdocs\forum\htdocs\bugreport.php
[line]=
int(13)
[function]=
string(11) __construct
[class]=
string(3) Foo
[object]=
object(Foo)#1 (1) {
  [bar]=
  string(4) test
}
[type]=
string(2) -
[args]=
array(1) {
  [0]=
  string(4) test
}
  }
}

Actual result:
--
debug_backtrace:

array(1) {
  [0]=
  array(7) {
[file]=
string(50) C:\server\apache\htdocs\forum\htdocs\bugreport.php
[line]=
int(13)
[function]=
string(11) __construct
[class]=
string(3) Foo
[object]=
object(Foo)#1 (1) {
  [bar]=
  string(4) test
}
[type]=
string(2) -
[args]=
array(1) {
  [0]=
  string(4) test
}
  }
}

Exception::getTrace():

array(1) {
  [0]=
  array(6) {
[file]=
string(50) C:\server\apache\htdocs\forum\htdocs\bugreport.php
[line]=
int(13)
[function]=
string(11) __construct
[class]=
string(3) Foo
[type]=
string(2) -
[args]=
array(1) {
  [0]=
  string(4) test
}
  }
}





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



#49098 [Fbk-Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
-Status:   Feedback
+Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Yes it still segfaults in the same way in 5.3-snap20091930.
Essentially the same valgrind output.

Going back to the original issue, it started happening in 5.2.10. A
diff of the mysqli directory between 5.2.9 and 5.2.10 shows only one
change: mysqli_api.c in SVN r281844.


Previous Comments:


[2009-11-11 08:48:02] j...@php.net

To narrow this down a bit: Does it happen with latest PHP 5.3 snapshot?



[2009-11-10 23:35:57] ras...@php.net

Looks like an ext/mysqli problem, but I looked through the code and I
don't see a case where MyG(error_msg) is free'ed without being NULL'ed
or immediately re-allocated.  It isn't NULL'ed in the RSHUTDOWN, but it
is NULL'ed in the RINIT, so there should be no way to get to
php_mysqli_set_error() without it being either NULL or correctly
allocated.





[2009-11-10 23:11:11] t...@php.net

==23150== Invalid free() / delete / delete[]
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==23150==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==23150==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==23150==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==23150==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==23150==by 0x5ED964: php_request_shutdown (main.c:1475)
==23150==by 0x6A065B: main (php_cli.c:1343)
==23150== 
==23150== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from
2)
==23150== malloc/free: in use at exit: 753 bytes in 4 blocks.
==23150== malloc/free: 52,204 allocs, 52,201 frees, 11,636,702 bytes
allocated.
==23150== For counts of detected errors, rerun with: -v
==23150== searching for pointers to 4 not-freed blocks.
==23150== checked 746,032 bytes.
==23150== 
==23150== 
==23150== 1 bytes in 1 blocks are definitely lost in loss record 1 of
4
==23150==at 0x4A0763E: malloc (vg_replace_malloc.c:207)
==23150==by 0x616129: _estrdup (zend_alloc.c:2428)
==23150==by 0xABA17C1: ???
==23150==by 0xABA61DD: ???
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150== 
==23150== LEAK SUMMARY:
==23150==definitely lost: 1 bytes in 1 blocks.
==23150==  possibly lost: 0 bytes in 0 blocks.
==23150==still reachable: 752 bytes in 3 blocks.
==23150== suppressed: 0 bytes in 0 blocks.
==23150== Reachable blocks (those to which a pointer was found) are not
shown.
==23150== To see them, rerun with: --leak-check=full
--show-reachable=yes




[2009-11-09 17:22:26] j...@php.net

Try with valgrind:

# USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php
yourscript.php




[2009-11-08 23:08:37] t...@php.net

Compiling with -O0 and *without* --enable-debug gives a backtrace 
which is almost (not quite) the same:

#0  0x006bec94 in _zend_mm_free_int ()
#1  0x006bfb06 in _efree ()
#2  0x006546cf in php_version_compare ()
#3  0x0065474f in zif_version_compare ()
#4  0x0070a98a in zend_do_fcall_common_helper_SPEC ()
#5  0x0070e932 in 

#50057 [Com]: crash in _php_pgsql_notice_ptr_dtor - efree with Horde

2009-11-11 Thread svanegmond at tinyplanet dot ca
 ID:   50057
 Comment by:   svanegmond at tinyplanet dot ca
 Reported By:  proforg at maloletka dot ru
 Status:   Feedback
 Bug Type: PostgreSQL related
 Operating System: Debian Lenny 2.6.26-2-amd64
 PHP Version:  5.2SVN-2009-11-02 (snap)
 New Comment:

Hi,
We have produced this crash on a MacOSX machine using MacPorts. We 
were running an internal publishing framework under Apache2, and 
the bug is difficult to isolate. It occurs every two or three hits, 
only a certain page and no others. 

Reviewing the crash log, we saw that it was handling an error message.

The database server had just thrown a warning message in 
response to a query; from pgsql's server log:

WARNING:  nonstandard use of escape in a string literal at character 
34
HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.

Fixing the query to not trigger this notice eliminated the problem.



$ postgres -V
postgres (PostgreSQL) 8.4.1

$ ./httpd -v
Server version: Apache/2.2.13 (Unix)
Server built:   Nov 11 2009 14:26:14

$ php -v
PHP 5.3.0 (cli) (built: Nov 11 2009 14:32:44) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies


Stack trace:

/Library/Logs/CrashReporter/httpd_2009-11-11-160757_xserve2.crash
Process: httpd [18789]
Path:/opt/local/apache2/bin/httpd
Identifier:  httpd
Version: ??? (???)
Code Type:   X86 (Native)
Parent Process:  httpd [17820]

Date/Time:   2009-11-11 16:07:57.993 -0500
OS Version:  Mac OS X Server 10.5.8 (9L30)
Report Version:  6
Anonymous UUID:  97323980-327D-4574-BA0D-3ECFD564DB05

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x72702f34
Crashed Thread:  0

Application Specific Information:
*** single-threaded process forked ***

Thread 0 Crashed:
0   libphp5.so  0x011e18a9 _zend_mm_free_int + 
25
1   pgsql.so0x017a307a 
_php_pgsql_notice_ptr_dtor + 26
2   libphp5.so  0x01210b82 
_zend_hash_index_update_or_next_insert + 562
3   pgsql.so0x017a301f 
_php_pgsql_notice_handler + 143
4   libpq.5.dylib   0x01790630 pqGetErrorNotice3 + 
1232
5   libpq.5.dylib   0x01791080 pqParseInput3 + 976
6   libpq.5.dylib   0x01787d48 parseInput + 24
7   libpq.5.dylib   0x0178882d PQgetResult + 173
8   libpq.5.dylib   0x017889fd PQexecFinish + 45
9   pgsql.so0x017a4690 zif_pg_query + 416
10  libphp5.so  0x012326cc 
zend_do_fcall_common_helper_SPEC + 2860
11  libphp5.so  0x01231635 execute + 485
12  libphp5.so  0x01203886 
zend_execute_scripts + 102
13  libphp5.so  0x011aad78 php_execute_script 
+ 392
14  libphp5.so  0x0129137b php_handler + 1691
15  httpd   0x2368 ap_run_handler + 72
16  httpd   0x2877 ap_invoke_handler + 
119
17  httpd   0x000280ae ap_process_request 
+ 430
18  httpd   0x000247a8 
ap_process_http_connection + 344
19  httpd   0x000103b8 
ap_run_process_connection + 72
20  httpd   0x0002cef7 child_main + 1031
21  httpd   0x0002d253 make_child + 323
22  httpd   0x0002d330 startup_children + 
96
23  httpd   0x0002ea83 ap_mpm_run + 4003
24  httpd   0x8ce0 main + 2544
25  httpd   0x1826 start + 54

Thread 0 crashed with X86 Thread State (32-bit):
 eax: 0x008fdc00  ebx: 0x011e189e  ecx: 0x0001  edx: 0x72702f3c
 edi: 0x72702f34  esi: 0x01aa37c0  ebp: 0xbfffece8  esp: 0xbfffecb0
  ss: 0x001f  efl: 0x00200206  eip: 0x011e18a9   cs: 0x0017
  ds: 0x001f   es: 0x001f   fs: 0x   gs: 0x0037
 cr2: 0x72702f34

Binary Images:
   0x1000 -0x37fe7 +httpd ??? (???) 
b168b1baf5a905648504a18b6389516b /opt/local/apache2/bin/httpd
  0x57000 -0x84fe7 +libpcre.0.dylib ??? (???) 
e850e6a552f9505aa3af76bab3599caa /opt/local/lib/libpcre.0.dylib
  0x89000 -0x9dff3 +libaprutil-1.0.dylib ??? (???) 
35ba3b12730afda10626fe0bea4774c7 /opt/local/lib/libaprutil-1.0.dylib
  0xa6000 -0xc2fe3 +libexpat.1.dylib ??? (???) 
86bb4cce4c61a5db862ebfb991656809 /opt/local/lib/libexpat.1.dylib
  0xca000 -0xe3fef +libapr-1.0.dylib ??? (???) 
56c87ffb4d4b5d67272ae1d3836e08e7 /opt/local/lib/libapr-1.0.dylib
  0xf1000 -0xf1ff5 +mod_authn_file.so ??? (???) 
1f3aa9d5825ca6109f63df61b390f153 
/opt/local/apache2/modules/mod_authn_file.so
  0xf5000 -0xf5ffe +mod_authn_dbm.so ??? (???) 
59d6f1179bc711e2320c5934578ef098 

#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Reverting the change from r281844 doesn't seem to fix it (tested on
5.3-snap20091930)


Previous Comments:


[2009-11-11 20:41:46] t...@php.net

Yes it still segfaults in the same way in 5.3-snap20091930.
Essentially the same valgrind output.

Going back to the original issue, it started happening in 5.2.10. A
diff of the mysqli directory between 5.2.9 and 5.2.10 shows only one
change: mysqli_api.c in SVN r281844.



[2009-11-11 08:48:02] j...@php.net

To narrow this down a bit: Does it happen with latest PHP 5.3 snapshot?



[2009-11-10 23:35:57] ras...@php.net

Looks like an ext/mysqli problem, but I looked through the code and I
don't see a case where MyG(error_msg) is free'ed without being NULL'ed
or immediately re-allocated.  It isn't NULL'ed in the RSHUTDOWN, but it
is NULL'ed in the RINIT, so there should be no way to get to
php_mysqli_set_error() without it being either NULL or correctly
allocated.





[2009-11-10 23:11:11] t...@php.net

==23150== Invalid free() / delete / delete[]
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==23150==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==23150==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==23150==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==23150==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==23150==by 0x5ED964: php_request_shutdown (main.c:1475)
==23150==by 0x6A065B: main (php_cli.c:1343)
==23150== 
==23150== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from
2)
==23150== malloc/free: in use at exit: 753 bytes in 4 blocks.
==23150== malloc/free: 52,204 allocs, 52,201 frees, 11,636,702 bytes
allocated.
==23150== For counts of detected errors, rerun with: -v
==23150== searching for pointers to 4 not-freed blocks.
==23150== checked 746,032 bytes.
==23150== 
==23150== 
==23150== 1 bytes in 1 blocks are definitely lost in loss record 1 of
4
==23150==at 0x4A0763E: malloc (vg_replace_malloc.c:207)
==23150==by 0x616129: _estrdup (zend_alloc.c:2428)
==23150==by 0xABA17C1: ???
==23150==by 0xABA61DD: ???
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150== 
==23150== LEAK SUMMARY:
==23150==definitely lost: 1 bytes in 1 blocks.
==23150==  possibly lost: 0 bytes in 0 blocks.
==23150==still reachable: 752 bytes in 3 blocks.
==23150== suppressed: 0 bytes in 0 blocks.
==23150== Reachable blocks (those to which a pointer was found) are not
shown.
==23150== To see them, rerun with: --leak-check=full
--show-reachable=yes




[2009-11-09 17:22:26] j...@php.net

Try with valgrind:

# USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php
yourscript.php




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/49098

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



#50139 [Opn-Bgs]: text in UTF-8 encoded xml cut off by xml parser with German umlauts

2009-11-11 Thread jani
 ID:   50139
 Updated by:   j...@php.net
 Reported By:  gros at mpdl dot mpg dot de
-Status:   Open
+Status:   Bogus
 Bug Type: XML Reader
 Operating System: Mac OS-X 10.6.2
 PHP Version:  5.3.0 - 5.2.5
 New Comment:

Reopen if you can reproduce with something more recent.


Previous Comments:


[2009-11-11 17:04:27] gros at mpdl dot mpg dot de

Apologies, apparently there are two php installations on my system. The
one that the xampp installation uses is actually 5.2.5, not 5.3.0. 


I am using DOMDocument now for parsing and it works like a charm.



[2009-11-11 12:47:59] j...@php.net

And please provide the complete script you used. It works fine for me
with very crude script..



[2009-11-11 12:46:47] gros at mpdl dot mpg dot de

Thanks, but the file is telling it's encoding, actually. Both in the
header (application/xml) and in the file:
?xml version=1.0 encoding=UTF-8 standalone=yes?


And also using 

$xml_parser = xml_parser_create(UTF-8);

does not help!



[2009-11-11 12:42:16] j...@php.net

Duh, i missed the very first line in your xml file. :)
So what you're actually reporting is that the input encoding isn't
detected properly?



[2009-11-11 12:41:12] j...@php.net

It might work better if your xml file told the encoding OR if you told
the xml_parser_create() the input encoding..



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/50139

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



#49098 [Opn-Fbk]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread jani
 ID:   49098
 Updated by:   j...@php.net
 Reported By:  bugs at timj dot co dot uk
-Status:   Open
+Status:   Feedback
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

What's the valgrind output then, same as before?


Previous Comments:


[2009-11-11 22:48:14] t...@php.net

Reverting the change from r281844 doesn't seem to fix it (tested on
5.3-snap20091930)



[2009-11-11 20:41:46] t...@php.net

Yes it still segfaults in the same way in 5.3-snap20091930.
Essentially the same valgrind output.

Going back to the original issue, it started happening in 5.2.10. A
diff of the mysqli directory between 5.2.9 and 5.2.10 shows only one
change: mysqli_api.c in SVN r281844.



[2009-11-11 08:48:02] j...@php.net

To narrow this down a bit: Does it happen with latest PHP 5.3 snapshot?



[2009-11-10 23:35:57] ras...@php.net

Looks like an ext/mysqli problem, but I looked through the code and I
don't see a case where MyG(error_msg) is free'ed without being NULL'ed
or immediately re-allocated.  It isn't NULL'ed in the RSHUTDOWN, but it
is NULL'ed in the RINIT, so there should be no way to get to
php_mysqli_set_error() without it being either NULL or correctly
allocated.





[2009-11-10 23:11:11] t...@php.net

==23150== Invalid free() / delete / delete[]
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==23150==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==23150==at 0x4A0633D: free (vg_replace_malloc.c:323)
==23150==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==23150==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==23150==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==23150==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==23150==by 0x5ED964: php_request_shutdown (main.c:1475)
==23150==by 0x6A065B: main (php_cli.c:1343)
==23150== 
==23150== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from
2)
==23150== malloc/free: in use at exit: 753 bytes in 4 blocks.
==23150== malloc/free: 52,204 allocs, 52,201 frees, 11,636,702 bytes
allocated.
==23150== For counts of detected errors, rerun with: -v
==23150== searching for pointers to 4 not-freed blocks.
==23150== checked 746,032 bytes.
==23150== 
==23150== 
==23150== 1 bytes in 1 blocks are definitely lost in loss record 1 of
4
==23150==at 0x4A0763E: malloc (vg_replace_malloc.c:207)
==23150==by 0x616129: _estrdup (zend_alloc.c:2428)
==23150==by 0xABA17C1: ???
==23150==by 0xABA61DD: ???
==23150==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==23150==by 0x652AFB: execute (zend_vm_execute.h:92)
==23150== 
==23150== LEAK SUMMARY:
==23150==definitely lost: 1 bytes in 1 blocks.
==23150==  possibly lost: 0 bytes in 0 blocks.
==23150==still reachable: 752 bytes in 3 blocks.
==23150== suppressed: 0 bytes in 0 blocks.
==23150== Reachable blocks (those to which a pointer was found) are not
shown.
==23150== To see them, rerun with: --leak-check=full
--show-reachable=yes




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/49098

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



#23877 [Com]: ob_implicit_flush does not work

2009-11-11 Thread haakon at avelia dot no
 ID:   23877
 Comment by:   haakon at avelia dot no
 Reported By:  sthomas at townnews dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Redhat Linux
 PHP Version:  4.3.2
 New Comment:

According to the manual:
ob_implicit_flush() will turn implicit flushing on or off. Implicit
flushing will result in a flush operation after every output call, so
that explicit calls to flush() will no longer be needed.

This means that if I have registered a output-handler like this:

  function myhandler($str) {
// handle $str internally
  }

  ob_start('myhandler');
  ob_implicit_flush(true);

Then according to the manual, each time I call echo, print or
output data outside PHP tags; it should call the ob_handler callback.

This does not work in PHP CLI mode.

If this is not expected to work, the manual should be updated. But this
is a feature i really need, since i want to be able to let people write
print/echo in their scripts, but my handler should preprocess the
data.

IMHO, it would have been really nice if this function worked as the
documentation says. Either by actually automatically firing flush() on
each echo/print/etc, or by implicitly calling the callback on each
echo/print/etc.


Previous Comments:


[2005-07-19 14:40:29] jeff at tillwicks dot us

I agree with sthomas totally on this.  I have been promised that there
is a way to get the output preformance of perl with php using output
buffering and flush.  I use the cli version and have yet to get it
working once.  I have followed every example (copy and pasted exact)
that is featured in php's own documentation.  With every attempt all
data is sent after the entire page has finished loading.  It is just
lack of support on this issue.



[2004-07-22 11:16:48] everyone at example dot com

Look dude, you don't have to be so damn obnoxious about it. Be a bit
more polite and you will get a more favorable response.



[2003-06-30 11:05:43] sthomas at townnews dot com

Implicit flush is turned off in the php.ini file, but that's only the
default status.  Calling ob_implicit_flush should enable autoflushing. 
The CLI *does* work if I set the output_buffering setting to 0, but
here's the screwy part: Set it to any non-zero value, and flushing
doesn't occur at all.  

Setting output_buffering to 1024 would imply that after 1024 characters
are sent to the buffer, the buffer is sent to screen/browser.  This is
not the case.  So not only is ob_implict_flush completely ignored when
output_buffering is set to a non-zero value, but output_buffering
doesn't flush after the designated value either.  At least not with the
CLI.

But don't take my word for it.  Set output_buffering to *anything*
above 0, then run this script with the CLI:

?PHP
ob_start();
ob_implicit_flush(1);

while(1)
{
  for ($i = 0; $i  1024; $i++)
print .;
  flush();
  sleep(1);
}
?

You'll see that no flushing is taking place... at all.  Even with an
explicit call to flush(), and even though ob_implicit_flush says that
output buffering should now be disabled.  Yes ob_end_flush() works,
however the PHP documentation says ob_implicit_flush does an implied
call to ob_end_flush().  So either the documentation is wrong, or PHP is
broken.  If the documentation is wrong, why have ob_implicit_flush in
the first place if it doesn't actually do anything?

Because so far with recent versions of PHP, I haven't been able to
create a single test case where ob_implicit_flush actually did anything.



[2003-06-30 09:33:08] m...@php.net

There's a second level of buffering after the ob_ buffering.  What is
your implicit_flush setting?  Please also refer to
http://www.php.net/flush



[2003-06-30 08:02:09] sthomas at townnews dot com

So... did you read the report at all?  Did you see the part where I
quoted the PHP documentation?  Let me do it again:

Turning implicit flushing on will disable output buffering, the output
buffers current output will be sent as if ob_end_flush() had been
called.

Therefore, according to this, calling ob_implicit_flush *IMPLIES A CALL
TO OB_END_FLUSH*! What part of YOUR OWN DOCUMENTATION do you not
understand?  Either the documentation is wrong, or PHP is wrong. 
Whichever it is, fix it so there's at least some consistancy.



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/23877

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



#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread rasmus
 ID:   49098
 Updated by:   ras...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Could you set a gdb breakpoint on the php_mysqli_set_error call and
show the arguments passed to it?

I still don't see anything in the code around that part that would
cause this though.  It feels like something else is stepping on global
memory here, but it is too consistent to be random memory corruption.

Would be nice if someone else could reproduce it.



Previous Comments:


[2009-11-11 23:01:13] t...@php.net

Yep. Also checked on 5.2, just in case.

Here's some valgrind from 5.3 for info:

==17517== Invalid free() / delete / delete[]
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==17517==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==17517==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==17517==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==17517==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==17517==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==17517==by 0x5ED964: php_request_shutdown (main.c:1475)
==17517==by 0x6A065B: main (php_cli.c:1343)
==17517== 





[2009-11-11 22:50:47] j...@php.net

What's the valgrind output then, same as before?



[2009-11-11 22:48:14] t...@php.net

Reverting the change from r281844 doesn't seem to fix it (tested on
5.3-snap20091930)



[2009-11-11 20:41:46] t...@php.net

Yes it still segfaults in the same way in 5.3-snap20091930.
Essentially the same valgrind output.

Going back to the original issue, it started happening in 5.2.10. A
diff of the mysqli directory between 5.2.9 and 5.2.10 shows only one
change: mysqli_api.c in SVN r281844.



[2009-11-11 08:48:02] j...@php.net

To narrow this down a bit: Does it happen with latest PHP 5.3 snapshot?



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/49098

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



#49098 [Fbk-Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
-Status:   Feedback
+Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Yep. Also checked on 5.2, just in case.

Here's some valgrind from 5.3 for info:

==17517== Invalid free() / delete / delete[]
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==17517==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==17517==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==17517==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==17517==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==17517==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==17517==by 0x5ED964: php_request_shutdown (main.c:1475)
==17517==by 0x6A065B: main (php_cli.c:1343)
==17517== 




Previous Comments:


[2009-11-11 22:50:47] j...@php.net

What's the valgrind output then, same as before?



[2009-11-11 22:48:14] t...@php.net

Reverting the change from r281844 doesn't seem to fix it (tested on
5.3-snap20091930)



[2009-11-11 20:41:46] t...@php.net

Yes it still segfaults in the same way in 5.3-snap20091930.
Essentially the same valgrind output.

Going back to the original issue, it started happening in 5.2.10. A
diff of the mysqli directory between 5.2.9 and 5.2.10 shows only one
change: mysqli_api.c in SVN r281844.



[2009-11-11 08:48:02] j...@php.net

To narrow this down a bit: Does it happen with latest PHP 5.3 snapshot?



[2009-11-10 23:35:57] ras...@php.net

Looks like an ext/mysqli problem, but I looked through the code and I
don't see a case where MyG(error_msg) is free'ed without being NULL'ed
or immediately re-allocated.  It isn't NULL'ed in the RSHUTDOWN, but it
is NULL'ed in the RINIT, so there should be no way to get to
php_mysqli_set_error() without it being either NULL or correctly
allocated.





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/49098

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



#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001



Previous Comments:


[2009-11-11 23:14:25] ras...@php.net

Could you set a gdb breakpoint on the php_mysqli_set_error call and
show the arguments passed to it?

I still don't see anything in the code around that part that would
cause this though.  It feels like something else is stepping on global
memory here, but it is too consistent to be random memory corruption.

Would be nice if someone else could reproduce it.




[2009-11-11 23:01:13] t...@php.net

Yep. Also checked on 5.2, just in case.

Here's some valgrind from 5.3 for info:

==17517== Invalid free() / delete / delete[]
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==17517==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==17517==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==17517==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==17517==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==17517==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==17517==by 0x5ED964: php_request_shutdown (main.c:1475)
==17517==by 0x6A065B: main (php_cli.c:1343)
==17517== 





[2009-11-11 22:50:47] j...@php.net

What's the valgrind output then, same as before?



[2009-11-11 22:48:14] t...@php.net

Reverting the change from r281844 doesn't seem to fix it (tested on
5.3-snap20091930)



[2009-11-11 20:41:46] t...@php.net

Yes it still segfaults in the same way in 5.3-snap20091930.
Essentially the same valgrind output.

Going back to the original issue, it started happening in 5.2.10. A
diff of the mysqli directory between 5.2.9 and 5.2.10 shows only one
change: mysqli_api.c in SVN r281844.



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/49098

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



#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

To be more specific, php_mysqli_set_error gets called twice before
crashing with the same params:

Starting program: /usr/local/bin/php -c /usr/local/etc
php-bug49098.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.
ok -- *** this is program output to stdout, everything is OK here

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x9e02b0, size=12)
at /path/to/php5.2-200911070930/Zend/zend_alloc.c:1785
1785heap-cache[index] = best_fit-prev_free_block;



Previous Comments:


[2009-11-11 23:30:33] t...@php.net

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001




[2009-11-11 23:14:25] ras...@php.net

Could you set a gdb breakpoint on the php_mysqli_set_error call and
show the arguments passed to it?

I still don't see anything in the code around that part that would
cause this though.  It feels like something else is stepping on global
memory here, but it is too consistent to be random memory corruption.

Would be nice if someone else could reproduce it.




[2009-11-11 23:01:13] t...@php.net

Yep. Also checked on 5.2, just in case.

Here's some valgrind from 5.3 for info:

==17517== Invalid free() / delete / delete[]
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==17517==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==17517==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==17517==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==17517==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==17517==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==17517==by 0x5ED964: php_request_shutdown (main.c:1475)
==17517==by 0x6A065B: main (php_cli.c:1343)
==17517== 





[2009-11-11 22:50:47] j...@php.net

What's the valgrind output then, same as before?



[2009-11-11 22:48:14] t...@php.net

Reverting the change from r281844 doesn't seem to fix it (tested on
5.3-snap20091930)



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/49098

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



#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread rasmus
 ID:   49098
 Updated by:   ras...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Could you try this patch and see if it changes anything?

Index: mysqli_nonapi.c
===
--- mysqli_nonapi.c (revision 290565)
+++ mysqli_nonapi.c (working copy)
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_err) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */


Previous Comments:


[2009-11-11 23:38:36] t...@php.net

To be more specific, php_mysqli_set_error gets called twice before
crashing with the same params:

Starting program: /usr/local/bin/php -c /usr/local/etc
php-bug49098.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.
ok -- *** this is program output to stdout, everything is OK here

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x9e02b0, size=12)
at /path/to/php5.2-200911070930/Zend/zend_alloc.c:1785
1785heap-cache[index] = best_fit-prev_free_block;




[2009-11-11 23:30:33] t...@php.net

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001




[2009-11-11 23:14:25] ras...@php.net

Could you set a gdb breakpoint on the php_mysqli_set_error call and
show the arguments passed to it?

I still don't see anything in the code around that part that would
cause this though.  It feels like something else is stepping on global
memory here, but it is too consistent to be random memory corruption.

Would be nice if someone else could reproduce it.




[2009-11-11 23:01:13] t...@php.net

Yep. Also checked on 5.2, just in case.

Here's some valgrind from 5.3 for info:

==17517== Invalid free() / delete / delete[]
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==17517==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==17517==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==17517==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==17517==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==17517==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==17517==by 0x5ED964: php_request_shutdown (main.c:1475)
==17517==by 0x6A065B: main (php_cli.c:1343)
==17517== 





[2009-11-11 22:50:47] j...@php.net

What's the valgrind output then, same as before?



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/49098

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



#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Nope, still the same result. (back on the 5.3 snapshot now)


Previous Comments:


[2009-11-11 23:38:53] ras...@php.net

Could you try this patch and see if it changes anything?

Index: mysqli_nonapi.c
===
--- mysqli_nonapi.c (revision 290565)
+++ mysqli_nonapi.c (working copy)
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_err) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */



[2009-11-11 23:38:36] t...@php.net

To be more specific, php_mysqli_set_error gets called twice before
crashing with the same params:

Starting program: /usr/local/bin/php -c /usr/local/etc
php-bug49098.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.
ok -- *** this is program output to stdout, everything is OK here

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x9e02b0, size=12)
at /path/to/php5.2-200911070930/Zend/zend_alloc.c:1785
1785heap-cache[index] = best_fit-prev_free_block;




[2009-11-11 23:30:33] t...@php.net

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001




[2009-11-11 23:14:25] ras...@php.net

Could you set a gdb breakpoint on the php_mysqli_set_error call and
show the arguments passed to it?

I still don't see anything in the code around that part that would
cause this though.  It feels like something else is stepping on global
memory here, but it is too consistent to be random memory corruption.

Would be nice if someone else could reproduce it.




[2009-11-11 23:01:13] t...@php.net

Yep. Also checked on 5.2, just in case.

Here's some valgrind from 5.3 for info:

==17517== Invalid free() / delete / delete[]
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA17B9: php_mysqli_set_error (mysqli.c:1004)
==17517==by 0xABA61DD: zif_mysqli_real_connect (mysqli_api.c:1476)
==17517==by 0x656BD2: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:200)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==by 0x652AFB: execute (zend_vm_execute.h:92)
==17517==by 0x656545: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:234)
==17517==  Address 0xba0af20 is 0 bytes inside a block of size 1
free'd
==17517==at 0x4A0633D: free (vg_replace_malloc.c:323)
==17517==by 0xABA1348: zm_deactivate_mysqli (mysqli.c:711)
==17517==by 0x63165B: module_registry_cleanup (zend_API.c:1976)
==17517==by 0x63A3B3: zend_hash_reverse_apply (zend_hash.c:755)
==17517==by 0x6301EC: zend_deactivate_modules (zend.c:838)
==17517==by 0x5ED964: php_request_shutdown (main.c:1475)
==17517==by 0x6A065B: main (php_cli.c:1343)
==17517== 





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/49098

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



#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Stepping through the code though, that patch wouldn't have made any
difference. On the final incantation of php_mysqli_set_error before
crash, estrdup() still gets called:

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0x10325a7
) at /path/to/php5.3-20091930/ext/mysqli/mysqli_nonapi.c:44
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
46  if (MyG(error_msg)) {
(gdb) step
47  efree(MyG(error_msg));
(gdb) next
49  if(mysql_err) { 
(gdb) step
50  MyG(error_msg) = estrdup(mysql_err);



Previous Comments:


[2009-11-11 23:48:50] t...@php.net

Nope, still the same result. (back on the 5.3 snapshot now)



[2009-11-11 23:38:53] ras...@php.net

Could you try this patch and see if it changes anything?

Index: mysqli_nonapi.c
===
--- mysqli_nonapi.c (revision 290565)
+++ mysqli_nonapi.c (working copy)
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_err) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */



[2009-11-11 23:38:36] t...@php.net

To be more specific, php_mysqli_set_error gets called twice before
crashing with the same params:

Starting program: /usr/local/bin/php -c /usr/local/etc
php-bug49098.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.
ok -- *** this is program output to stdout, everything is OK here

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x9e02b0, size=12)
at /path/to/php5.2-200911070930/Zend/zend_alloc.c:1785
1785heap-cache[index] = best_fit-prev_free_block;




[2009-11-11 23:30:33] t...@php.net

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001




[2009-11-11 23:14:25] ras...@php.net

Could you set a gdb breakpoint on the php_mysqli_set_error call and
show the arguments passed to it?

I still don't see anything in the code around that part that would
cause this though.  It feels like something else is stepping on global
memory here, but it is too consistent to be random memory corruption.

Would be nice if someone else could reproduce it.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49098

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



#49098 [Opn]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Open
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

I'm not sure if this is useful/correct, but at first pass this stops
the crash:

--- ext/mysqli/mysqli_nonapi.c.orig 2009-10-15 23:34:41.0
+0100
+++ ext/mysqli/mysqli_nonapi.c  2009-11-11 23:56:40.271496635 +
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_errno!=0) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */



Previous Comments:


[2009-11-11 23:55:09] t...@php.net

Stepping through the code though, that patch wouldn't have made any
difference. On the final incantation of php_mysqli_set_error before
crash, estrdup() still gets called:

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0x10325a7
) at /path/to/php5.3-20091930/ext/mysqli/mysqli_nonapi.c:44
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
46  if (MyG(error_msg)) {
(gdb) step
47  efree(MyG(error_msg));
(gdb) next
49  if(mysql_err) { 
(gdb) step
50  MyG(error_msg) = estrdup(mysql_err);




[2009-11-11 23:48:50] t...@php.net

Nope, still the same result. (back on the 5.3 snapshot now)



[2009-11-11 23:38:53] ras...@php.net

Could you try this patch and see if it changes anything?

Index: mysqli_nonapi.c
===
--- mysqli_nonapi.c (revision 290565)
+++ mysqli_nonapi.c (working copy)
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_err) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */



[2009-11-11 23:38:36] t...@php.net

To be more specific, php_mysqli_set_error gets called twice before
crashing with the same params:

Starting program: /usr/local/bin/php -c /usr/local/etc
php-bug49098.php
[Thread debugging using libthread_db enabled]

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.
ok -- *** this is program output to stdout, everything is OK here

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001
1001{
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x9e02b0, size=12)
at /path/to/php5.2-200911070930/Zend/zend_alloc.c:1785
1785heap-cache[index] = best_fit-prev_free_block;




[2009-11-11 23:30:33] t...@php.net

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0xbd1f77
)
at /path/to/php5.2-200911070930/ext/mysqli/mysqli.c:1001




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/49098

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



#50005 [Ver-Csd]: Throwing through Reflection modified Exception object makes segmentation fault

2009-11-11 Thread felipe
 ID:   50005
 Updated by:   fel...@php.net
 Reported By:  arturas dot moskvinas at gmail dot com
-Status:   Verified
+Status:   Closed
 Bug Type: Reproducible crash
 Operating System: Centos 5.3 Final 64bit
-PHP Version:  5.3.0
+PHP Version:  5.2, 5.3.0, 6
-Assigned To:  
+Assigned To:  felipe
 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.

Thanks for the patch, but I've committed a bit different fix avoiding
this '(null)' in the message.


Previous Comments:


[2009-11-12 00:10:20] s...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revisionrevision=290567
Log: - Fixed bug #50005 (Throwing through Reflection modified Exception
object makes segmentation fault)



[2009-11-05 19:41:03] arturas dot moskvinas at gmail dot com

Probable strdup or strlen implementation on windows differs from
linux.
Here is one of possible fix patches (on 5.3.0 release)
--- php-5.3.0.orig/main/main.c  2009-06-04 10:41:01.0 +0300
+++ php-5.3.0/main/main.c   2009-10-30 17:49:40.0 +0200
@@ -865,7 +865,10 @@
}
PG(last_error_type) = type;
PG(last_error_message) = strdup(buffer);
-   PG(last_error_file) = strdup(error_filename);
+   if (error_filename)
+   {
+   PG(last_error_file) = strdup(error_filename);
+   }
PG(last_error_lineno) = error_lineno;
}



[2009-11-05 14:50:00] ka...@php.net

I cannot reproduce this using VC9 TS builds on Windows, using 5.3.0 and
5.3.2-dev:

C:\phpphp -v
PHP 5.3.2-dev (cli) (built: Nov  5 2009 15:19:54)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

C:\phpphp bug50005.php

Fatal error: Uncaught exception 'Exception' in :2
Stack trace:
#0 {main}
  thrown in (null) on line 2




[2009-10-26 22:22:53] johan...@php.net

(dbx) where 
current thread: t...@1
  [1] strlen(0x0, 0x0, 0x44, 0xfefefefefefefeff, 0x0, 0x4000), at
0xfd7fff18d520 
  [2] strdup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfd7fff1ccf78 
  [3] php_error_cb(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x894252 
=[4] zend_error_va(type = 1, file = (nil), lineno = 2U, format =
0xcf5f12 Uncaught %s\n  thrown, ...), line 749 in zend_exceptions.c
  [5] zend_exception_error(exception = 0xd6a890, severity = 1), line
789 in zend_exceptions.c
  [6] zend_execute_scripts(type = 8, retval = (nil), file_count = 3,
...), line 1212 in zend.c
  [7] php_execute_script(primary_file = 0xfd7fffdff780), line 2226
in main.c
  [8] main(argc = 1, argv = 0xfd7fffdff858), line 1190 in
php_cli.c




[2009-10-26 21:23:39] arturas dot moskvinas at gmail dot com

Description:

Throwing through Reflection modified Exception (or any other Exception
type) object makes php segment fault when file property is set to null.



Reproduce code:
---
?php
$e = new Exception();
$reflection = new ReflectionObject($e);
$property = $reflection-getProperty(file);
$property-setAccessible(true);
$property-setValue($e, null);
throw $e;
?

Expected result:

PHP Fatal error:  Uncaught exception 'Exception' in null:xx

Actual result:
--
Segmentation fault





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



#49936 [Opn]: crash with ftp stream in php_stream_context_get_option()

2009-11-11 Thread pierrick
 ID:   49936
 Updated by:   pierr...@php.net
 Reported By:  marielyne at acanac dot net
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: Windows 7
 PHP Version:  5.3SVN-2009-10-20 (snap)
 New Comment:

The same problem can be reproduce with the following code 

?php
$dir = 'ftp://your:s...@localhost/';

opendir($dir);
opendir($dir);

This bug was introduce in 5.3 with the new way to manage references of
stream context.

Patch can be found here (it modify the php_stream_context_set
signature) :
http://www.adoy.net/php/stream-nofetch.diff

Or here (same version but with TSRMLS_FETCH to avoid any signature
modification):
http://www.adoy.net/php/stream-fetch.diff


Previous Comments:


[2009-10-24 20:06:23] marielyne at acanac dot net

New information

Reproduce code:
---
?php
$file = 'ftp://your:s...@localhost/test.txt';

echo start\n;
$fo1 = fopen($file, 'rb');
echo opened.1\n;
fclose($fo1);
echo closed.1\n;
$fo2 = fopen($file, 'rb');
echo opened.2\n;
fclose($fo2);
echo closed.2\n;
?


Expected result:

start
opened.1
closed.1
opened.2
closed.2


Actual result:
--
start
opened.1
closed.1


Same result if opening different files
Same result if opening different files from different servers

However, if I move first fclose() below second fopen(), it works as
expected



[2009-10-21 14:58:13] marielyne at acanac dot net

Does not happen with 5.2.11
Does not happen with local directory

ftp://@localhost/php5.dll.001
fopen 2
fread
fwrite
ftp://@localhost/php5.dll.002
fopen 3
fread
fwrite
ftp://@localhost/php5.dll.003
fopen 3
fread
fwrite
ftp://@localhost/php5.dll.004
fopen 3
fread
fwrite
ftp://@localhost/php5.dll.005
fopen 3
fread
fwrite
done



[2009-10-21 12:36:12] j...@php.net

Does this happen with PHP 5.2.11 ? Does this happen using local
filesystem instead of remote ftp site?



[2009-10-20 22:12:21] marielyne at acanac dot net

Description:

Trying to split a local file (at least 1 megabyte) to a FTP server à la
Hjsplit

PHP
=
This snapshot was automatically generated on
Tue, 20 Oct 2009 19:16:25 +

Version: 5.3.2-dev
Branch: HEAD
Build: Release
=

FTP
=
FileZilla server 0.9.33
=

Reproduce code:
---
http://www.pastebin.ca/1633753

Expected result:

*filename
fopen 2
fread
fwrite
[repeat last 2]
*filename
fopen 3
fread
fwrite
[repeat last 4]
done

Actual result:
--
*filename
fopen 2
fread
fwrite
*filename
CRASH

backtrace and FTP log @ http://www.pastebin.ca/1633797





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



#49997 [NoF-Fbk]: Implementing a namespaced interface crashes

2009-11-11 Thread felipe
 ID:   49997
 Updated by:   fel...@php.net
 Reported By:  flavius dot as at gmail dot com
-Status:   No Feedback
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Linux x86_64
 PHP Version:  5.3.0
 New Comment:

Please try using this snapshot:

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

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




Previous Comments:


[2009-11-11 01:00:01] 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-11-03 10:22:57] scott...@php.net

Please try using this snapshot:

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

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

There was a fix for autoload crashing on an interface in bug #49908



[2009-11-03 05:59:15] flavius dot as at gmail dot com

Could someone do something with this report?



[2009-11-03 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-10-28 19:30:23] flavius dot as at gmail dot com

Sorry for the incomplete post.

This happens in my scripts because it's trying to autoload an
interface.
My code was indeed buggy, but I woudn't expect PHP to crash.



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/49997

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



#49098 [Opn-Csd]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread rasmus
 ID:   49098
 Updated by:   ras...@php.net
 Reported By:  bugs at timj dot co dot uk
-Status:   Open
+Status:   Closed
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Should be fixed now in svn.  Please verify.


Previous Comments:


[2009-11-12 01:09:16] s...@php.net

Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revisionrevision=290570
Log: Fix bug #49098



[2009-11-11 23:59:51] t...@php.net

I'm not sure if this is useful/correct, but at first pass this stops
the crash:

--- ext/mysqli/mysqli_nonapi.c.orig 2009-10-15 23:34:41.0
+0100
+++ ext/mysqli/mysqli_nonapi.c  2009-11-11 23:56:40.271496635 +
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_errno!=0) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */




[2009-11-11 23:55:09] t...@php.net

Stepping through the code though, that patch wouldn't have made any
difference. On the final incantation of php_mysqli_set_error before
crash, estrdup() still gets called:

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0x10325a7
) at /path/to/php5.3-20091930/ext/mysqli/mysqli_nonapi.c:44
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
46  if (MyG(error_msg)) {
(gdb) step
47  efree(MyG(error_msg));
(gdb) next
49  if(mysql_err) { 
(gdb) step
50  MyG(error_msg) = estrdup(mysql_err);




[2009-11-11 23:48:50] t...@php.net

Nope, still the same result. (back on the 5.3 snapshot now)



[2009-11-11 23:38:53] ras...@php.net

Could you try this patch and see if it changes anything?

Index: mysqli_nonapi.c
===
--- mysqli_nonapi.c (revision 290565)
+++ mysqli_nonapi.c (working copy)
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_err) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */



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/49098

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



#50153 [NEW]: mb_convert_encoding couldn't convert GB2312 to UTF8 well?

2009-11-11 Thread kiange at gmail dot com
From: kiange at gmail dot com
Operating system: Ubuntu 9.04
PHP version:  5.2.11
PHP Bug Type: mbstring related
Bug description:  mb_convert_encoding couldn't convert GB2312 to UTF8 well?

Description:

A mail message fetched from gmail. The original message encoded in 
big5, but the result come from gmail become GB2312 in attachments' 
name. And when converting it into utf8 with mb_convert_encoding(), the 
result become unreadable. But when change GB2312 to GBK, the result 
becomes better. Although I'm not sure if it still correct in 
characters' code, but I could read it.

Hope you won't mind that I only tested it in PHP 5.2.6.

Reproduce code:
---
?php
$encodedString =
'=?GB2312?B?MjAwOTExMDZfQ1lDVU1JU0xhYl+5UNObX5pXwM+On9Ob5JsuZG9j?=';
$imapDecode = imap_mime_header_decode($string);
// Returning unreadable result
mb_convert_encoding($imapDecode[0]-text, 'UTF-8', 'GB2312');
// Returning correct result
mb_convert_encoding($imapDecode[0]-text, 'UTF-8', 'GBK');


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



#49521 [Ver-Asn]: PDO fetchObject sets values before calling constructor

2009-11-11 Thread pierrick
 ID:   49521
 Updated by:   pierr...@php.net
 Reported By:  waps at pisem dot net
-Status:   Verified
+Status:   Assigned
 Bug Type: PDO related
 Operating System: Ubuntu 8.10 x64
 PHP Version:  5.2.10
-Assigned To:  
+Assigned To:  pierrick


Previous Comments:


[2009-11-06 17:07:46] caferrari at gmail dot com

Thats evil!...

My code with an Ugly solution!

?php

class TestObject {
public function __construct($id=0, $name='', $mail=''){
// if (isset($this-id)) return; // Ugly solution necessary atm 
to
bypass the problem!.
$this-id   = $id;
$this-name = $nome;
$this-mail = $mail;
}
}

$dbh = new PDO('sqlite:'.dirname(__FILE__).'/foo.db');
$qr = $dbh-query(SELECT 1 as id, 'test' as name, 'a...@def.com' as
mail);
$x = $qr-fetchObject('TestObject');

print_r($x);

Expected:
TestObject Object ( [id] = 1 [name] = test [mail] = a...@def.com ) 

Actual Result:
TestObject Object ( [id] = 0 [name] = [mail] = )



[2009-09-22 07:06:38] waps at pisem dot net

sjoerd, yes!

Im my php5 framework phpDays (http://phpdays.sf.net) I faced with this
problem. Pleae, fix it in php 5.2.x and 5.3.x and 6.x.x. Thnanks!

P.S. Maybe this problem exists in other php components. Need to code
review to find this problem in all components.

P.P.S. Please, tell me about fix this problem in future. Thanks!



[2009-09-21 18:45:30] sjo...@php.net

Confirmed. If the constructor sets default values for some fields, as
is typical, the constructor will overwrite the values just retrieved
from the database.

?php
class Book {
function __construct() {
$this-title = Default;
}
}

$pdo = new PDO('mysql:dbname=books', 'root');
$statement = $pdo-prepare('SELECT * FROM book WHERE
title=\'Peopleware\'');
$statement-execute();
$obj = $statement-fetchObject('Book');
echo $obj-title; // Expected: Peopleware. Actual: Default
? 



[2009-09-10 11:45:31] waps at pisem dot net

Description:

Incorrect creating user object: set data before call constructor
method.

Reproduce code:
---
---
From manual page: pdostatement.fetchobject
---

class Product {
public function __construct() {
echo 'create object, ';
}
public function __set($offset, $value) {
echo 'set value, ';
}
}

// fetch object
$stmt-fetchObject('Product', array());

Expected result:

Expected result: create object, set value, 

Actual result:
--
Actual result: set value, create object,





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



#49910 [Opn-Asn]: no support for ././@LongLink for long filenames in phar tar support

2009-11-11 Thread cellog
 ID:   49910
 Updated by:   cel...@php.net
 Reported By:  cel...@php.net
-Status:   Open
+Status:   Assigned
 Bug Type: PHAR related
 Operating System: n/a
 PHP Version:  5.3SVN-2009-10-18 (SVN)
-Assigned To:  
+Assigned To:  cellog
 New Comment:

read support enabled.  Will keep this open while I decide whether to
also implement write support for filenames  256 characters


Previous Comments:


[2009-11-11 21:03:00] s...@php.net

Automatic comment from SVN on behalf of cellog
Revision: http://svn.php.net/viewvc/?view=revisionrevision=290527
Log: fix PHP Bug #49910: no support for ././@LongLink for long
filenames in phar tar support



[2009-10-18 04:27:47] cel...@php.net

Description:

The arcane (and poorly documented) ././@LongLink method of storing long
filenames is not supported by ext/phar.

The header stores the size of the filename, and the next block stores
the filename itself.






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



#49521 [Asn]: PDO fetchObject sets values before calling constructor

2009-11-11 Thread pierrick
 ID:   49521
 Updated by:   pierr...@php.net
 Reported By:  waps at pisem dot net
 Status:   Assigned
 Bug Type: PDO related
 Operating System: Ubuntu 8.10 x64
 PHP Version:  5.2.10
 Assigned To:  pierrick
 New Comment:

Patch available at:

http://www.adoy.net/php/49521.PHP_5_2.patch
http://www.adoy.net/php/49521.PHP_5_3.patch
http://www.adoy.net/php/49521.PHP_6_0.patch


Previous Comments:


[2009-11-06 17:07:46] caferrari at gmail dot com

Thats evil!...

My code with an Ugly solution!

?php

class TestObject {
public function __construct($id=0, $name='', $mail=''){
// if (isset($this-id)) return; // Ugly solution necessary atm 
to
bypass the problem!.
$this-id   = $id;
$this-name = $nome;
$this-mail = $mail;
}
}

$dbh = new PDO('sqlite:'.dirname(__FILE__).'/foo.db');
$qr = $dbh-query(SELECT 1 as id, 'test' as name, 'a...@def.com' as
mail);
$x = $qr-fetchObject('TestObject');

print_r($x);

Expected:
TestObject Object ( [id] = 1 [name] = test [mail] = a...@def.com ) 

Actual Result:
TestObject Object ( [id] = 0 [name] = [mail] = )



[2009-09-22 07:06:38] waps at pisem dot net

sjoerd, yes!

Im my php5 framework phpDays (http://phpdays.sf.net) I faced with this
problem. Pleae, fix it in php 5.2.x and 5.3.x and 6.x.x. Thnanks!

P.S. Maybe this problem exists in other php components. Need to code
review to find this problem in all components.

P.P.S. Please, tell me about fix this problem in future. Thanks!



[2009-09-21 18:45:30] sjo...@php.net

Confirmed. If the constructor sets default values for some fields, as
is typical, the constructor will overwrite the values just retrieved
from the database.

?php
class Book {
function __construct() {
$this-title = Default;
}
}

$pdo = new PDO('mysql:dbname=books', 'root');
$statement = $pdo-prepare('SELECT * FROM book WHERE
title=\'Peopleware\'');
$statement-execute();
$obj = $statement-fetchObject('Book');
echo $obj-title; // Expected: Peopleware. Actual: Default
? 



[2009-09-10 11:45:31] waps at pisem dot net

Description:

Incorrect creating user object: set data before call constructor
method.

Reproduce code:
---
---
From manual page: pdostatement.fetchobject
---

class Product {
public function __construct() {
echo 'create object, ';
}
public function __set($offset, $value) {
echo 'set value, ';
}
}

// fetch object
$stmt-fetchObject('Product', array());

Expected result:

Expected result: create object, set value, 

Actual result:
--
Actual result: set value, create object,





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



#49936 [Opn-Asn]: crash with ftp stream in php_stream_context_get_option()

2009-11-11 Thread pierrick
 ID:   49936
 Updated by:   pierr...@php.net
 Reported By:  marielyne at acanac dot net
-Status:   Open
+Status:   Assigned
 Bug Type: Filesystem function related
 Operating System: Windows 7
 PHP Version:  5.3SVN-2009-10-20 (snap)
 Assigned To:  pierrick


Previous Comments:


[2009-11-12 00:14:51] pierr...@php.net

The same problem can be reproduce with the following code 

?php
$dir = 'ftp://your:s...@localhost/';

opendir($dir);
opendir($dir);

This bug was introduce in 5.3 with the new way to manage references of
stream context.

Patch can be found here (it modify the php_stream_context_set
signature) :
http://www.adoy.net/php/stream-nofetch.diff

Or here (same version but with TSRMLS_FETCH to avoid any signature
modification):
http://www.adoy.net/php/stream-fetch.diff



[2009-10-24 20:06:23] marielyne at acanac dot net

New information

Reproduce code:
---
?php
$file = 'ftp://your:s...@localhost/test.txt';

echo start\n;
$fo1 = fopen($file, 'rb');
echo opened.1\n;
fclose($fo1);
echo closed.1\n;
$fo2 = fopen($file, 'rb');
echo opened.2\n;
fclose($fo2);
echo closed.2\n;
?


Expected result:

start
opened.1
closed.1
opened.2
closed.2


Actual result:
--
start
opened.1
closed.1


Same result if opening different files
Same result if opening different files from different servers

However, if I move first fclose() below second fopen(), it works as
expected



[2009-10-21 14:58:13] marielyne at acanac dot net

Does not happen with 5.2.11
Does not happen with local directory

ftp://@localhost/php5.dll.001
fopen 2
fread
fwrite
ftp://@localhost/php5.dll.002
fopen 3
fread
fwrite
ftp://@localhost/php5.dll.003
fopen 3
fread
fwrite
ftp://@localhost/php5.dll.004
fopen 3
fread
fwrite
ftp://@localhost/php5.dll.005
fopen 3
fread
fwrite
done



[2009-10-21 12:36:12] j...@php.net

Does this happen with PHP 5.2.11 ? Does this happen using local
filesystem instead of remote ftp site?



[2009-10-20 22:12:21] marielyne at acanac dot net

Description:

Trying to split a local file (at least 1 megabyte) to a FTP server à la
Hjsplit

PHP
=
This snapshot was automatically generated on
Tue, 20 Oct 2009 19:16:25 +

Version: 5.3.2-dev
Branch: HEAD
Build: Release
=

FTP
=
FileZilla server 0.9.33
=

Reproduce code:
---
http://www.pastebin.ca/1633753

Expected result:

*filename
fopen 2
fread
fwrite
[repeat last 2]
*filename
fopen 3
fread
fwrite
[repeat last 4]
done

Actual result:
--
*filename
fopen 2
fread
fwrite
*filename
CRASH

backtrace and FTP log @ http://www.pastebin.ca/1633797





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



#49098 [Csd]: Using custom session handler causes segfault in session_save_state

2009-11-11 Thread timj
 ID:   49098
 Updated by:   t...@php.net
 Reported By:  bugs at timj dot co dot uk
 Status:   Closed
 Bug Type: Session related
 Operating System: Linux
 PHP Version:  5.2.10
 New Comment:

Confirmed works for me. Below tested on PHP 5.2 which also seems to
work - could you fix it on that branch too?:

--- ext/mysqli/mysqli.c.orig2009-07-17 13:17:25.0 +0100
+++ ext/mysqli/mysqli.c 2009-11-12 07:10:19.054055576 +
@@ -1003,7 +1003,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_err  *mysql_err) {
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */

Many thanks Rasmus (and to Jani/Sriram for your help). 


Previous Comments:


[2009-11-12 01:10:33] ras...@php.net

Should be fixed now in svn.  Please verify.



[2009-11-12 01:09:16] s...@php.net

Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revisionrevision=290570
Log: Fix bug #49098



[2009-11-11 23:59:51] t...@php.net

I'm not sure if this is useful/correct, but at first pass this stops
the crash:

--- ext/mysqli/mysqli_nonapi.c.orig 2009-10-15 23:34:41.0
+0100
+++ ext/mysqli/mysqli_nonapi.c  2009-11-11 23:56:40.271496635 +
@@ -46,7 +46,11 @@
if (MyG(error_msg)) {
efree(MyG(error_msg));
}
-   MyG(error_msg) = estrdup(mysql_err);
+   if(mysql_errno!=0) { 
+   MyG(error_msg) = estrdup(mysql_err);
+   } else {
+   MyG(error_msg) = NULL;
+   }
 }
 /* }}} */




[2009-11-11 23:55:09] t...@php.net

Stepping through the code though, that patch wouldn't have made any
difference. On the final incantation of php_mysqli_set_error before
crash, estrdup() still gets called:

Breakpoint 1, php_mysqli_set_error (mysql_errno=0, mysql_err=0x10325a7
) at /path/to/php5.3-20091930/ext/mysqli/mysqli_nonapi.c:44
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
44  {
(gdb) step
45  MyG(error_no) = mysql_errno;
(gdb) step
46  if (MyG(error_msg)) {
(gdb) step
47  efree(MyG(error_msg));
(gdb) next
49  if(mysql_err) { 
(gdb) step
50  MyG(error_msg) = estrdup(mysql_err);




[2009-11-11 23:48:50] t...@php.net

Nope, still the same result. (back on the 5.3 snapshot 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/49098

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



#50154 [NEW]: session_set_save_handler cann't get global variable(instance of object)

2009-11-11 Thread 0809 at 21cn dot com
From: 0809 at 21cn dot com
Operating system: linux as4
PHP version:  5.3.0
PHP Bug Type: Session related
Bug description:  session_set_save_handler cann't get global variable(instance 
of object)

Description:

hi staff,
  In my programs of  my php5.3,i use function session_set_save_handler
to set the sessions into database,this function must set the
parameters:names of the functions like :(open,close,read,write,destroy,gc)
as string.
  when i use the functions :read,write,destroy,gc ,i set a global
variable(an instance of object) in them ,but i found it works normally in
these functions except in write;i cann't get the value of the
variable,only appears in the wirte function.
  i change the version of php to  5.3 like :4.x ¡¢5.2, the problem above
disappears.
  i don't know the reason.can you help me to find it out?

  jjjackie

Reproduce code:
---
ini_set('session.save_handler', 'user');
class a{
var $var_a = 'here';
function a(){
}
}
$v = new a();
function open($save_path,$session_name){return true;}
function close(){   return true;}
function read($id){ return true;}
function write($id,$value){
global $v;
echo($v -var_a);
}
function destroy($id){ return true; }
function gc(){ return true; }
session_set_save_handler('open','close','read','write','destroy','gc');
session_start();

Expected result:

here

Actual result:
--
Notice: Trying to get property of non-object in
/home/wwwroot/dgunion/inc/inc.session.php on line 182 

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