|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2011-01-14 16:55 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Sun Oct 26 17:00:01 2025 UTC | 
I have the same problem. I don't have a test case, cause the bug happens randomly across application. I also get some corrupted variables filled with some random data. Here's the backtrace: #0 0x013795d8 in zval_mark_grey (pz=0x9c5c230) at /root/php-build/php-5.3.4/Zend/zend_gc.c:372 p = 0x1850005 #1 0x01379ebd in gc_mark_roots () at /root/php-build/php-5.3.4/Zend/zend_gc.c:435 No locals. #2 gc_collect_cycles () at /root/php-build/php-5.3.4/Zend/zend_gc.c:664 p = <value optimized out> q = <value optimized out> orig_free_list = <value optimized out> orig_next_to_free = <value optimized out> count = <value optimized out> #3 0x0135c115 in zend_deactivate () at /root/php-build/php-5.3.4/Zend/zend.c:900 No locals. #4 0x01303a8a in php_request_shutdown (dummy=0x0) at /root/php-build/php-5.3.4/main/main.c:1633 report_memleaks = 1 '\001' #5 0x013e7eff in php_apache_request_dtor (r=0x94be720) at /root/php-build/php-5.3.4/sapi/apache2handler/sapi_apache2.c:509 No locals. #6 php_handler (r=0x94be720) at /root/php-build/php-5.3.4/sapi/apache2handler/sapi_apache2.c:681 ctx = 0x94c4168 conf = 0x92b4e18 brigade = 0x94c9968 bucket = <value optimized out> rv = <value optimized out> parent_req = 0x0 ---Type <return> to continue, or q <return> to quit--- #7 0x003d2a4d in ap_run_handler () No symbol table info available. #8 0x003d63f8 in ap_invoke_handler () No symbol table info available. #9 0x003e253e in ap_process_request () No symbol table info available. #10 0x003df2df in ?? () No symbol table info available. #11 0x003da92d in ap_run_process_connection () No symbol table info available. #12 0x003daa2c in ap_process_connection () No symbol table info available. #13 0x003e6e24 in ?? () No symbol table info available. #14 0x003e7131 in ?? () No symbol table info available. #15 0x003e720a in ?? () No symbol table info available. #16 0x003e7d6b in ap_mpm_run () No symbol table info available. #17 0x003be157 in main () No symbol table info available. (gdb) Here's the configure script ./configure \ --build=i386-redhat-linux \ --host=i386-redhat-linux \ --target=i386-redhat-linux-gnu \ --program-prefix= \ --prefix=/usr \ --exec-prefix=/usr \ --bindir=/usr/bin \ --sbindir=/usr/sbin \ --sysconfdir=/etc \ --datadir=/usr/share \ --includedir=/usr/include \ --libdir=/usr/lib \ --libexecdir=/usr/libexec \ --localstatedir=/var \ --sharedstatedir=/usr/com \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-libdir=lib \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --disable-debug \ --with-pic \ --disable-rpath \ --with-pear \ --with-curl \ --with-exec-dir=/usr/bin \ --with-freetype-dir=/usr \ --without-gdbm \ --with-gettext \ --with-iconv \ --with-zlib \ --with-layout=GNU \ --enable-exif \ --enable-ftp \ --enable-magic-quotes \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-sysvmsg \ --enable-wddx \ --with-kerberos \ --enable-ucd-snmp-hack \ --without-unixODBC \ --enable-shmop \ --enable-calendar \ --with-apxs2=/usr/sbin/apxs \ --without-sqlite \ --enable-dom \ --disable-dba \ --enable-pdo \ --enable-xmlreader \ --enable-xmlwriter \ --with-xmlrpc \ --with-gd \ --with-openssl \ --with-libxml-dir=/usr \ --disable-cgi \ --enable-mbstring \ --enable-bcmath