Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18163 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99767 invoked by uid 1010); 16 Aug 2005 10:37:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99752 invoked from network); 16 Aug 2005 10:37:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2005 10:37:07 -0000 X-Host-Fingerprint: 80.91.229.2 main.gmane.org Linux 2.5 (sometimes 2.4) (4) Received: from ([80.91.229.2:44529] helo=ciao.gmane.org) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 96/3E-33075-1D1C1034 for ; Tue, 16 Aug 2005 06:37:05 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1E4yn0-0003ed-Uw for internals@lists.php.net; Tue, 16 Aug 2005 12:35:26 +0200 Received: from p508866bb.dip.t-dialin.net ([80.136.102.187]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Aug 2005 12:35:26 +0200 Received: from sb by p508866bb.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Aug 2005 12:35:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Tue, 16 Aug 2005 12:33:53 +0200 Lines: 62 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: p508866bb.dip.t-dialin.net User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: de-DE, de, en-us, en Sender: news Subject: Segfault with spl_autoload From: sb@sebastian-bergmann.de (Sebastian Bergmann) I am experiencing a segfault with spl_autoload in the PHP_5_1 branch with the upcoming PHPUnit 2.3.0. The nature of PHPUnit's complexity makes it almost impossible for me to come up with a simple, reproducing script (I already invested hours into this, to no avail so far). It is weird that the segfault only occurs in one out of two common code paths of PHPUnit's TextUI test runner. Furthermore, small code changes (see below) seem to make the problem go away: Segfault: function PHPUnit2_Util_Classloader($className) { print "Loading $className.\n"; if (strpos($className, 'PHPUnit2_') !== FALSE) { @include(str_replace('_', '/', $className) . '.php'); } } spl_autoload_register('PHPUnit2_Util_Classloader'); Segfault: function PHPUnit2_Util_Classloader($className) { $bt = debug_backtrace(); print "Loading $className.\n"; if (strpos($className, 'PHPUnit2_') !== FALSE) { @include(str_replace('_', '/', $className) . '.php'); } } spl_autoload_register('PHPUnit2_Util_Classloader'); No Segfault: function PHPUnit2_Util_Classloader($className) { $bt = debug_backtrace(); print_r($bt[1]); print "Loading $className.\n"; if (strpos($className, 'PHPUnit2_') !== FALSE) { @include(str_replace('_', '/', $className) . '.php'); } } spl_autoload_register('PHPUnit2_Util_Classloader'); Below are the links to the results of GDB and Valgrind. Interestingly, when run through GDB it segfaults, when run through Valgrind it does not segfault. GDB: http://www.sebastian-bergmann.de/stuff/phpunit2-gdb.txt Valgrind: http://www.sebastian-bergmann.de/stuff/phpunit2-valgrind.txt -- Sebastian Bergmann http://www.sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69