RE: [PHP-DEV] Impact of CFLAGS on GOTO and SWITCH executers
| From: | Dmitry Stogov | Date: | Mon, 16 Oct 2006 16:46:05 +0000 |
| Subject: | RE: [PHP-DEV] Impact of CFLAGS on GOTO and SWITCH executers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26068@lists.php.net to get a copy of this message | ||
The reason of the crash is just a stack overflow.
You use -O0 and unoptimized execute() function require a lot of stack space,
because space for local variables is not reused.
During execution of "ackermann" benchmark execute() is called recursively
many times and eats all stack space...
Dmitry.
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Sebastian Bergmann
> Sent: Sunday, October 15, 2006 5:21 PM
> To: internals@lists.php.net
> Subject: Re: [PHP-DEV] Impact of CFLAGS on GOTO and SWITCH executers
>
>
> Sebastian Bergmann wrote:
> > What strikes me as odd are the segmentation faults when PHP
> is built
> > with -O0 (no optimizations).
>
> Some more information of the segfaults: It looks as if the
> ackermann test is responsible for the segfaults.
>
> I uploaded a backtrace from GDB and a logfile from valgrind
> to
> http://static.phpunit.de/gdb-php_5_2-goto-gcc-4.1.1-O0.txt
> and
> http://static.phpunit.de/valgrind-php_5_2-goto-gcc-4.1.1-O0.txt,
> respectively.
>
> --
> Sebastian Bergmann
> http://sebastian-bergmann.de/
> GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867
> C514 B85B 5D69
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>