Skip to content

PHP crashes when extension was compiled using -O option #145

Description

@pbiggar

What steps will reproduce the problem?
1. use helloworld example, compile with
phc --extension=helloworld -O2 --generate-c helloworld.php  >ext/helloworld.c

2. create the .m4 file as in phc documention and start
phpize5 --with-php-config=/usr/bin/php-config5

(note: phpize5 and php-config5 are the ones from the distribution, not the ones from
the php installation used to compile phc)

3. ./configure --enable-helloworld

4. make then copy the helloworld.so to the correct extension directory

5. enable in php.ini with extension="helloworld.so"

6. start with __MAIN__ (); in a php script

==> segmentation fault, php crashes, webserver offering php script for download

if the -O switch is not used in step 1 everything works fine. I tested -O0 -O1 -O2
-O3, allways crashing php.


environment used:
Debian Lenny latest patch level (2011-08-04): Apache2, php 5.2.3
phc was installed as in your documention using the latest php download, 5.2.17. phc
is from svn download


the reason why i am trying the -O option is the hope for improved speed.



many thanks to the PHC team for this great tool, please keep maintaining and improving
it!!


Original issue reported on code.google.com by ulrich.j.meier on 2011-08-06 13:07:54

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions