[PHP-BUG] Bug #63615 [NEW]: DateTime::modify() ignores timezone

2012-11-26 Thread flavius dot as at gmail dot com
From: flavius dot as at gmail dot com
Operating system: Linux x64
PHP version:  5.4.9
Package:  Date/time related
Bug Type: Bug
Bug description:DateTime::modify() ignores timezone

Description:

DateTime::modify() ignores the timezone (when using the RFC 2822 format for
instance).

The right timestamp should be $t1 (from the example below).

Test script:
---
modify($str);

$t1 = $d1->getTimestamp();
$t2 = $d2->getTimestamp();
$tz1 = $d1->getTimezone()->getName();
$tz2 = $d2->getTimezone()->getName();
$f1 = $d1->format(DateTime::RFC2822);
$f2 = $d2->format(DateTime::RFC2822);

var_dump(compact('t1', 't2', 'tz1', 'tz2', 'f1', 'f2'));
/*
array(6) {
  't1' =>
  int(1334046476)
  't2' =>
  int(1334050076)
  'tz1' =>
  string(6) "+03:00"
  'tz2' =>
  string(13) "Europe/Vienna"
  'f1' =>
  string(31) "Tue, 10 Apr 2012 11:27:56 +0300"
  'f2' =>
  string(31) "Tue, 10 Apr 2012 11:27:56 +0200"
}
*/

Expected result:

$t1 == $t2

Actual result:
--
$t1 != $t2

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



Bug #53672 [Com]: Parser inconsistency for nowdoc/Heredoc vs. "normal" variable assignment at EOF

2011-01-06 Thread flavius dot as at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53672&edit=1

 ID: 53672
 Comment by: flavius dot as at gmail dot com
 Reported by:dicugeorge1987 at yahoo dot com
 Summary:Parser inconsistency for nowdoc/Heredoc vs. "normal"
 variable assignment at EOF
 Status: Open
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Windows 7 64bit
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Note that this will work though:

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


Bug #51155 [Fbk->Opn]: serialize() crashes with unreasonable/unexplicable "out of memory" for objects

2010-03-27 Thread flavius dot as at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=51155&edit=1

 ID:   51155
 User updated by:  flavius dot as at gmail dot com
 Reported by:  flavius dot as at gmail dot com
 Summary:  serialize() crashes with unreasonable/unexplicable
   "out of memory" for objects
-Status:   Feedback
+Status:   Open
 Type: Bug
 Package:  SPL related
 Operating System: ArchLinux x86_64
-PHP Version:  5.3.1
+PHP Version:  5.3.2

 New Comment:

updated version


Previous Comments:

[2010-03-04 15:10:04] flavius dot as at gmail dot com

Ok, I've managed to compile and test with php5.3-201003041130, the bug
is still there, but it seems to crash for higher values.



for 2 items, the peak is

peak 21.71 mb before serialize,

peak 45.59 mb after serialize. simple maths: it should need
approximatively 5 mb for every 5000 items.



The following test run for 25000 confirms my theory (roughly, +/- due to
temporarily saving the return value, runtime memory, etc): 

before serialization: peak 26.98 mb

after: peak 56.7 mb



Ok, it's slightly higher than 5mb, after serialization is a small
increase over the expected (which I presumed) 2*n linear growth.



Now the final run. But first and foremost

$ sapi/cli/php -i |grep memory

memory_limit => 128M => 128M



And the test run, for 3 items:

GENERATING DONE

peak 32.24 mb

---



Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 28574231 bytes)





The expected value was somewhere around (and I'll be generous) 80mb. But
I suppose it still has that spark of exponential growth somewhere
between 25000 and 3 items.


[2010-03-04 14:30:17] paj...@php.net

That's unrelated to this bug, disable imap to test a new build.



However, about this error, get a decent c-client and it will work (like
less than 4-5 years old).

----------------
[2010-03-04 14:26:28] flavius dot as at gmail dot com

Using it gives the configure error:

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL
is missing. This should not happen. Check config.log for additional
information.


[2010-03-01 17:02:22] j...@php.net

Please try using this snapshot:

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

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



----------------
[2010-02-26 13:41:59] flavius dot as at gmail dot com

Oh and I've forgot to mention, there's plenty of RAM and swap space
before running php -f:



free -m

 total   used   free sharedbuffers
cached

Mem:  1975   1732243  0131  
1027

-/+ buffers/cache:573   1402

Swap: 5718  0   5718




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=51155


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


#51155 [Opn]: serialize() crashes with unreasonable/unexplicable "out of memory" for objects

2010-02-26 Thread flavius dot as at gmail dot com
 ID:   51155
 User updated by:  flavius dot as at gmail dot com
 Reported By:  flavius dot as at gmail dot com
 Status:   Open
 Bug Type: *Programming Data Structures
 Operating System: ArchLinux x86_64
 PHP Version:  5.3.1
 New Comment:

Oh and I've forgot to mention, there's plenty of RAM and swap space
before running php -f:

free -m
 total   used   free sharedbuffers
cached
Mem:  1975   1732243  0131  
1027
-/+ buffers/cache:573   1402
Swap: 5718  0   5718


Previous Comments:


[2010-02-26 13:38:28] flavius dot as at gmail dot com

Updated OS: ArchLinux x86_64



[2010-02-26 13:35:13] flavius dot as at gmail dot com

Description:

When serializing a SplFixedArray with serialize(), the script dies with
"Fatal error: Allowed memory size of 134217728 bytes exhausted"

The "expected result" works and allocates at most 20.96 mb for $cnt =
8565 on line 15.

The "actual result" crashes when serialize()'ing with $cnt only
incremented by one, which is not understandable.

The actual values may vary, but if you play enough with it you'll find
at which amount of items serialize() has that spark.

Then you can toggle to using plain arrays on line 17, and that problem
will disappear, although arrays actually consume more memory (in my
experiments around 1.2 mb more).

Reproduce code:
---
 1  http://bugs.php.net/?id=51155&edit=1



#51155 [Opn]: serialize() crashes with unreasonable/unexplicable "out of memory" for objects

2010-02-26 Thread flavius dot as at gmail dot com
 ID:   51155
 User updated by:  flavius dot as at gmail dot com
 Reported By:  flavius dot as at gmail dot com
 Status:   Open
 Bug Type: *Programming Data Structures
-Operating System: Linux
+Operating System: ArchLinux x86_64
 PHP Version:  5.3.1
 New Comment:

Updated OS: ArchLinux x86_64


Previous Comments:


[2010-02-26 13:35:13] flavius dot as at gmail dot com

Description:

When serializing a SplFixedArray with serialize(), the script dies with
"Fatal error: Allowed memory size of 134217728 bytes exhausted"

The "expected result" works and allocates at most 20.96 mb for $cnt =
8565 on line 15.

The "actual result" crashes when serialize()'ing with $cnt only
incremented by one, which is not understandable.

The actual values may vary, but if you play enough with it you'll find
at which amount of items serialize() has that spark.

Then you can toggle to using plain arrays on line 17, and that problem
will disappear, although arrays actually consume more memory (in my
experiments around 1.2 mb more).

Reproduce code:
---
 1  http://bugs.php.net/?id=51155&edit=1



#51155 [NEW]: serialize() crashes with unreasonable/unexplicable "out of memory" for objects

2010-02-26 Thread flavius dot as at gmail dot com
From: flavius dot as at gmail dot com
Operating system: Linux
PHP version:  5.3.1
PHP Bug Type: *Programming Data Structures
Bug description:  serialize() crashes with unreasonable/unexplicable "out of 
memory" for objects

Description:

When serializing a SplFixedArray with serialize(), the script dies with
"Fatal error: Allowed memory size of 134217728 bytes exhausted"

The "expected result" works and allocates at most 20.96 mb for $cnt = 8565
on line 15.

The "actual result" crashes when serialize()'ing with $cnt only
incremented by one, which is not understandable.

The actual values may vary, but if you play enough with it you'll find at
which amount of items serialize() has that spark.

Then you can toggle to using plain arrays on line 17, and that problem
will disappear, although arrays actually consume more memory (in my
experiments around 1.2 mb more).

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



#49997 [NoF->Opn]: Implementing a namespaced interface crashes

2009-11-02 Thread flavius dot as at gmail dot com
 ID:   49997
 User updated by:  flavius dot as at gmail dot com
 Reported By:  flavius dot as at gmail dot com
-Status:   No Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: Linux x86_64
 PHP Version:  5.3.0
 New Comment:

Could someone do something with this report?


Previous Comments:


[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.



[2009-10-28 19:27:29] flavius dot as at gmail dot com

After some debugging, I came to the conclusion that it crashes because
of an exception being thrown inside a spl_register_autoload()'ed
userland method.

Here's the bt:

#0  zend_lookup_class_ex (name=0x15b9d40 "Exception", name_length=9,
use_autoload=1, ce=0x7fffb2e0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:1016
#1  0x007954d1 in zend_fetch_class (class_name=0x15b9d40
"Exception", class_name_len=9, fetch_type=4)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1524
#2  0x007d8d22 in ZEND_FETCH_CLASS_SPEC_CONST_HANDLER
(execute_data=0x76552cc0) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:724
#3  0x007d6b50 in execute (op_array=0x15bc828) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#4  0x007940e5 in zend_call_function (fci=0x7fffb640,
fci_cache=0x7fffb5d0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:936
#5  0x007bfae4 in zend_call_method (object_pp=0x0,
obj_ce=0x15b8eb0, fn_proxy=0x15b09f8, function_name=0x15ba410
"\\yap\\base::autoload",
function_name_len=20, retval_ptr_ptr=0x7fffb748, param_count=1,
arg1=0x15f8930, arg2=0x0) at
/home/flav/php-5.3.0/Zend/zend_interfaces.c:97
#6  0x00600de0 in zif_spl_autoload_call (ht=1,
return_value=0x161c620, return_value_ptr=0x7fffba70, this_ptr=0x0,
return_value_used=1)
at /home/flav/php-5.3.0/ext/spl/php_spl.c:395
#7  0x007942c2 in zend_call_function (fci=0x7fffba20,
fci_cache=0x7fffb9f0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:958
#8  0x00794999 in zend_lookup_class_ex (name=0x15f8a30
"YAP\\patterns\\IInheritable", name_length=25, use_autoload=1,
ce=0x7fffbb20)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1089
#9  0x007954d1 in zend_fetch_class (class_name=0x15f8a30
"YAP\\patterns\\IInheritable", class_name_len=25, fetch_type=6)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1524
#10 0x007d93d3 in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x76552bb8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:890
#11 0x007d6b50 in execute (op_array=0x15f68c8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#12 0x007a38de in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/flav/php-5.3.0/Zend/zend.c:1188
#13 0x0072ed19 in php_execute_script
(primary_file=0x7fffe1b0) at /home/flav/php-5.3.0/main/main.c:2196
#14 0x0088c885 in main (argc=7, argv=0x7fffe408) at
/home/flav/php-5.3.0/sapi/cli/php_cli.c:1188

------------------------

[2009-10-26 16:54:38] flavius dot as at gmail dot com

Done. The output:

Reading symbols from /home/flav/php-5.3.0/sapi/cli/php...done.
(gdb) run /usr/bin/phpunit --bootstrap bootstrap.php --configuration
phpunit.xml testunit/
Starting program: /home/flav/php-5.3.0/sapi/cli/php /usr/bin/phpunit
--bootstrap bootstrap.php --configuration phpunit.xml testunit/
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
892 if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
(gdb) bt
#0  0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
#1  0x007d6b50 in execute (op_array=0x161f078) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#2  0x007a38de in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/flav/php-5.3.0/Zend/zend.c:1188
#3  0x0072ed19 in php_execute_script
(primary_file=0x7fffe1e0) at /home/flav/php-5.3.0/main/main.c:2196
#4  0x00

#49997 [Com]: Implementing a namespaced interface crashes

2009-10-28 Thread flavius dot as at gmail dot com
 ID:   49997
 Comment by:   flavius dot as at gmail dot com
 Reported By:  flavius dot as at gmail dot com
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Linux x86_64
 PHP Version:  5.3.0
 New Comment:

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.


Previous Comments:


[2009-10-28 19:27:29] flavius dot as at gmail dot com

After some debugging, I came to the conclusion that it crashes because
of an exception being thrown inside a spl_register_autoload()'ed
userland method.

Here's the bt:

#0  zend_lookup_class_ex (name=0x15b9d40 "Exception", name_length=9,
use_autoload=1, ce=0x7fffb2e0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:1016
#1  0x007954d1 in zend_fetch_class (class_name=0x15b9d40
"Exception", class_name_len=9, fetch_type=4)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1524
#2  0x007d8d22 in ZEND_FETCH_CLASS_SPEC_CONST_HANDLER
(execute_data=0x76552cc0) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:724
#3  0x007d6b50 in execute (op_array=0x15bc828) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#4  0x007940e5 in zend_call_function (fci=0x7fffb640,
fci_cache=0x7fffb5d0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:936
#5  0x007bfae4 in zend_call_method (object_pp=0x0,
obj_ce=0x15b8eb0, fn_proxy=0x15b09f8, function_name=0x15ba410
"\\yap\\base::autoload",
function_name_len=20, retval_ptr_ptr=0x7fffb748, param_count=1,
arg1=0x15f8930, arg2=0x0) at
/home/flav/php-5.3.0/Zend/zend_interfaces.c:97
#6  0x00600de0 in zif_spl_autoload_call (ht=1,
return_value=0x161c620, return_value_ptr=0x7fffba70, this_ptr=0x0,
return_value_used=1)
at /home/flav/php-5.3.0/ext/spl/php_spl.c:395
#7  0x007942c2 in zend_call_function (fci=0x7fffba20,
fci_cache=0x7fffb9f0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:958
#8  0x00794999 in zend_lookup_class_ex (name=0x15f8a30
"YAP\\patterns\\IInheritable", name_length=25, use_autoload=1,
ce=0x7fffbb20)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1089
#9  0x007954d1 in zend_fetch_class (class_name=0x15f8a30
"YAP\\patterns\\IInheritable", class_name_len=25, fetch_type=6)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1524
#10 0x007d93d3 in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x76552bb8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:890
#11 0x007d6b50 in execute (op_array=0x15f68c8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#12 0x007a38de in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/flav/php-5.3.0/Zend/zend.c:1188
#13 0x0072ed19 in php_execute_script
(primary_file=0x7fffe1b0) at /home/flav/php-5.3.0/main/main.c:2196
#14 0x0088c885 in main (argc=7, argv=0x7fffe408) at
/home/flav/php-5.3.0/sapi/cli/php_cli.c:1188

----------------------------

[2009-10-26 16:54:38] flavius dot as at gmail dot com

Done. The output:

Reading symbols from /home/flav/php-5.3.0/sapi/cli/php...done.
(gdb) run /usr/bin/phpunit --bootstrap bootstrap.php --configuration
phpunit.xml testunit/
Starting program: /home/flav/php-5.3.0/sapi/cli/php /usr/bin/phpunit
--bootstrap bootstrap.php --configuration phpunit.xml testunit/
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
892 if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
(gdb) bt
#0  0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
#1  0x007d6b50 in execute (op_array=0x161f078) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#2  0x007a38de in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/flav/php-5.3.0/Zend/zend.c:1188
#3  0x0072ed19 in php_execute_script
(primary_file=0x7fffe1e0) at /home/flav/php-5.3.0/main/main.c:2196
#4  0x0088c885 in main (argc=7, argv=0x7fffe438) at
/home/flav/php-5.3.0/sapi/cli/php_cli.c:1188



[2009-10-26 14:39:50] johan...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it t

#49997 [Com]: Implementing a namespaced interface crashes

2009-10-28 Thread flavius dot as at gmail dot com
 ID:   49997
 Comment by:   flavius dot as at gmail dot com
 Reported By:  flavius dot as at gmail dot com
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Linux x86_64
 PHP Version:  5.3.0
 New Comment:

After some debugging, I came to the conclusion that it crashes because
of an exception being thrown inside a spl_register_autoload()'ed
userland method.

Here's the bt:

#0  zend_lookup_class_ex (name=0x15b9d40 "Exception", name_length=9,
use_autoload=1, ce=0x7fffb2e0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:1016
#1  0x007954d1 in zend_fetch_class (class_name=0x15b9d40
"Exception", class_name_len=9, fetch_type=4)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1524
#2  0x007d8d22 in ZEND_FETCH_CLASS_SPEC_CONST_HANDLER
(execute_data=0x76552cc0) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:724
#3  0x007d6b50 in execute (op_array=0x15bc828) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#4  0x007940e5 in zend_call_function (fci=0x7fffb640,
fci_cache=0x7fffb5d0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:936
#5  0x007bfae4 in zend_call_method (object_pp=0x0,
obj_ce=0x15b8eb0, fn_proxy=0x15b09f8, function_name=0x15ba410
"\\yap\\base::autoload",
function_name_len=20, retval_ptr_ptr=0x7fffb748, param_count=1,
arg1=0x15f8930, arg2=0x0) at
/home/flav/php-5.3.0/Zend/zend_interfaces.c:97
#6  0x00600de0 in zif_spl_autoload_call (ht=1,
return_value=0x161c620, return_value_ptr=0x7fffba70, this_ptr=0x0,
return_value_used=1)
at /home/flav/php-5.3.0/ext/spl/php_spl.c:395
#7  0x007942c2 in zend_call_function (fci=0x7fffba20,
fci_cache=0x7fffb9f0) at
/home/flav/php-5.3.0/Zend/zend_execute_API.c:958
#8  0x00794999 in zend_lookup_class_ex (name=0x15f8a30
"YAP\\patterns\\IInheritable", name_length=25, use_autoload=1,
ce=0x7fffbb20)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1089
#9  0x007954d1 in zend_fetch_class (class_name=0x15f8a30
"YAP\\patterns\\IInheritable", class_name_len=25, fetch_type=6)
at /home/flav/php-5.3.0/Zend/zend_execute_API.c:1524
#10 0x007d93d3 in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x76552bb8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:890
#11 0x007d6b50 in execute (op_array=0x15f68c8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#12 0x007a38de in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/flav/php-5.3.0/Zend/zend.c:1188
#13 0x0072ed19 in php_execute_script
(primary_file=0x7fffe1b0) at /home/flav/php-5.3.0/main/main.c:2196
#14 0x0088c885 in main (argc=7, argv=0x7fffe408) at
/home/flav/php-5.3.0/sapi/cli/php_cli.c:1188


Previous Comments:
------------------------

[2009-10-26 16:54:38] flavius dot as at gmail dot com

Done. The output:

Reading symbols from /home/flav/php-5.3.0/sapi/cli/php...done.
(gdb) run /usr/bin/phpunit --bootstrap bootstrap.php --configuration
phpunit.xml testunit/
Starting program: /home/flav/php-5.3.0/sapi/cli/php /usr/bin/phpunit
--bootstrap bootstrap.php --configuration phpunit.xml testunit/
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
892 if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
(gdb) bt
#0  0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
#1  0x007d6b50 in execute (op_array=0x161f078) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#2  0x007a38de in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/flav/php-5.3.0/Zend/zend.c:1188
#3  0x0072ed19 in php_execute_script
(primary_file=0x7fffe1e0) at /home/flav/php-5.3.0/main/main.c:2196
#4  0x0088c885 in main (argc=7, argv=0x7fffe438) at
/home/flav/php-5.3.0/sapi/cli/php_cli.c:1188



[2009-10-26 14:39:50] johan...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

----------------------------

[2009-10-26 13:22:49] flavius dot as at gmail dot com

Description:

PHP 5.3.0 crashes when a cla

#49997 [Com]: Implementing a namespaced interface crashes

2009-10-26 Thread flavius dot as at gmail dot com
 ID:   49997
 Comment by:   flavius dot as at gmail dot com
 Reported By:  flavius dot as at gmail dot com
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Linux x86_64
 PHP Version:  5.3.0
 New Comment:

Done. The output:

Reading symbols from /home/flav/php-5.3.0/sapi/cli/php...done.
(gdb) run /usr/bin/phpunit --bootstrap bootstrap.php --configuration
phpunit.xml testunit/
Starting program: /home/flav/php-5.3.0/sapi/cli/php /usr/bin/phpunit
--bootstrap bootstrap.php --configuration phpunit.xml testunit/
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
892 if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
(gdb) bt
#0  0x007d93db in ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER
(execute_data=0x765529a8) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:892
#1  0x007d6b50 in execute (op_array=0x161f078) at
/home/flav/php-5.3.0/Zend/zend_vm_execute.h:104
#2  0x007a38de in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/flav/php-5.3.0/Zend/zend.c:1188
#3  0x0072ed19 in php_execute_script
(primary_file=0x7fffe1e0) at /home/flav/php-5.3.0/main/main.c:2196
#4  0x0088c885 in main (argc=7, argv=0x7fffe438) at
/home/flav/php-5.3.0/sapi/cli/php_cli.c:1188


Previous Comments:


[2009-10-26 14:39:50] johan...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.



[2009-10-26 13:22:49] flavius dot as at gmail dot com

Description:

PHP 5.3.0 crashes when a class is implementing an interface declared in
another namespace

Reproduce code:
---
Hi

I am sorry, I was unable to isolate the bug and create a PoC.
However the code (which is rather small) can be found at
svn://yet-another-project.com/projects/yap.

Rev 1. is working, but the crashing code is commented out, Rev.2
crashes when issuing /trunk/tests/runtests.sh.

The tests were written with PHPUnit 3.4.1 in mind.
The error message when running the testsuite through /usr/bin/phpunit
is:
./runtests.sh: line 3: 16512 Segmentation fault  phpunit
--bootstrap bootstrap.php --configuration phpunit.xml testunit/

But when issuing /usr/bin/php /usr/bin/phpunit --bootstrap
bootstrap.php --configuration phpunit.xml testunit/ I only get:
Segmentation fault

See the diff between r1 and r2.






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



#49997 [NEW]: Implementing a namespaced interface crashes

2009-10-26 Thread flavius dot as at gmail dot com
From: flavius dot as at gmail dot com
Operating system: Linux x86_64
PHP version:  5.3.0
PHP Bug Type: Reproducible crash
Bug description:  Implementing a namespaced interface crashes

Description:

PHP 5.3.0 crashes when a class is implementing an interface declared in
another namespace

Reproduce code:
---
Hi

I am sorry, I was unable to isolate the bug and create a PoC.
However the code (which is rather small) can be found at
svn://yet-another-project.com/projects/yap.

Rev 1. is working, but the crashing code is commented out, Rev.2 crashes
when issuing /trunk/tests/runtests.sh.

The tests were written with PHPUnit 3.4.1 in mind.
The error message when running the testsuite through /usr/bin/phpunit is:
./runtests.sh: line 3: 16512 Segmentation fault  phpunit --bootstrap
bootstrap.php --configuration phpunit.xml testunit/

But when issuing /usr/bin/php /usr/bin/phpunit --bootstrap bootstrap.php
--configuration phpunit.xml testunit/ I only get:
Segmentation fault

See the diff between r1 and r2.


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