Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHC SIGSEGV received when magic method __sleep used #142

Open
pbiggar opened this issue Jun 3, 2015 · 4 comments
Open

PHC SIGSEGV received when magic method __sleep used #142

pbiggar opened this issue Jun 3, 2015 · 4 comments

Comments

@pbiggar
Copy link
Owner

pbiggar commented Jun 3, 2015

What steps will reproduce the problem?
1. See attached example
2. phc -c dns-class.php -o test
3. ./test

What is the expected output? What do you see instead?

phc -O3 -c dns-class.php -o test
Warning: The optimizer has failed for the following reason:
src/optimize/Class_info.cpp:104:
Magic method '__sleep is not supported

[securegateway-devel]~# ./test
SIGSEGV received!
This could be a bug in phc. If you suspect it is, please email
a bug report to [email protected].


What version of the product are you using? On what operating system?
Latest PHC SVN version.
Running on Slackware Linux 13.1 buildroot 2.6.33.4-smp #1 SMP Wed May 12 21:39:37 CDT
2010 i686 QEMU Virtual CPU version 0.12.5 AuthenticAMD GNU/Linux

Please provide any additional information below.

Original issue reported on code.google.com by cassiano%[email protected] on 2011-01-24 11:31:57


- _Attachment: [dns-class.php](https://storage.googleapis.com/google-code-attachments/phc/issue-133/comment-0/dns-class.php)_
@pbiggar
Copy link
Owner Author

pbiggar commented Jun 3, 2015

Just a note, it only crashes when optimization flag is set.

-O0 works fine
-O1 crashes
-O2 crashes
-O3 crashes

Original issue reported on code.google.com by cassiano%[email protected] on 2011-01-24 11:34:38

@pbiggar
Copy link
Owner Author

pbiggar commented Jun 3, 2015

We don't support any magic methods at the moment.

Actually, I'm surprised this works in the -O0 case.

Original issue reported on code.google.com by paul.biggar on 2011-01-24 20:33:12

@pbiggar
Copy link
Owner Author

pbiggar commented Jun 3, 2015

I also tested with a simple class, like this:

class x
{
   private $y;
}

$z = new x();

It also segfaults when using -O3

Original issue reported on code.google.com by cassiano%[email protected] on 2011-01-24 22:49:43

@pbiggar
Copy link
Owner Author

pbiggar commented Jun 3, 2015

I think we don't support variable modifiers ('private'). It should work without that.

Original issue reported on code.google.com by paul.biggar on 2011-01-24 23:06:16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant