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

 ID:                 53748
 User updated by:    contact at chdemko dot com
 Reported by:        contact at chdemko dot com
 Summary:            Using traits lead to a segmentation fault
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Fedora core 11
 PHP Version:        trunk-SVN-2011-01-14 (SVN)
 Block user comment: N
 Private report:     N

 New Comment:

I've compiled php with --enable-debug



This is the trace:



bash-4.0$ gdb ./sapi/cli/php

GNU gdb (GDB) Fedora (6.8.50.20090302-40.fc11)

Copyright (C) 2009 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"

and "show warranty" for details.

This GDB was configured as "i586-redhat-linux-gnu".

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>...

(gdb) r ~/trait.php

Starting program: /Utilisateurs/cdemko01/php/sapi/cli/php ~/trait.php

[Thread debugging using libthread_db enabled]

int(1)

int(2)

array(1) {

  [1]=>

  int(2)

}





Program received signal SIGSEGV, Segmentation fault.

zval_mark_grey (pz=0xb7fb144c) at
/Utilisateurs/cdemko01/php/Zend/zend_gc.c:372

372                             pz = *(zval**)p->pData;

Missing separate debuginfos, use: debuginfo-install glibc-2.10.2-1.i686
libxml2-2.7.6-1.fc11.i586 nss-softokn-freebl-3.12.6-1.2.fc11.i586
zlib-1.2.3-22.fc11.i586

(gdb) bt

#0  zval_mark_grey (pz=0xb7fb144c) at
/Utilisateurs/cdemko01/php/Zend/zend_gc.c:372

#1  0x082d5995 in gc_mark_roots () at
/Utilisateurs/cdemko01/php/Zend/zend_gc.c:435

#2  gc_collect_cycles () at
/Utilisateurs/cdemko01/php/Zend/zend_gc.c:664

#3  0x082b9035 in zend_deactivate () at
/Utilisateurs/cdemko01/php/Zend/zend.c:925

#4  0x082606eb in php_request_shutdown (dummy=0x0) at
/Utilisateurs/cdemko01/php/main/main.c:1671

#5  0x0835160f in main (argc=2, argv=0xbffff754) at
/Utilisateurs/cdemko01/php/sapi/cli/php_cli.c:1439


Previous Comments:
------------------------------------------------------------------------
[2011-01-14 17:22:42] 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.

what options are you using to compile PHP? - It works for me without
segfault:



int(1)

int(2)

array(1) {

  [1]=>

  int(2)

}

------------------------------------------------------------------------
[2011-01-14 16:55:46] contact at chdemko dot com

Description:
------------
The test script (Singleton pattern) leads to a Segmentation error



$ php test-trait.php

int(1)

int(2)

array(1) {

  [1]=>

  int(2)

}

Segmentation error



Test script:
---------------
See http://www.pastie.org/1460398

Expected result:
----------------
int(1)

int(2)

array(1) {

  [1]=>

  int(2)

}



Actual result:
--------------
int(1)

int(2)

array(1) {

  [1]=>

  int(2)

}

Segmentation error




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



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

Reply via email to