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

Segmentation fault on GMagick Image destruction #347

Open
ptrofimov opened this issue Jul 29, 2014 · 1 comment
Open

Segmentation fault on GMagick Image destruction #347

ptrofimov opened this issue Jul 29, 2014 · 1 comment

Comments

@ptrofimov
Copy link

Here is the code:

$imagine = new \Imagine\Gmagick\Imagine;

$image = $imagine->open('image.jpg');
$image = $imagine->open('image.jpg');

gc_collect_cycles();

Trying to run garbage collection, script fails with the error "Segmentation fault (core dumped)". As I learned, to prevent this, we need to remove destructor from Imagine\GMagick\Image class and clear resources manually.

PHP 5.5.14 (cli) (built: Jun 27 2014 15:36:26), gmagick version => 1.1.7RC2

As I see, this bug is quite old: https://bugs.php.net/bug.php?id=63677

@ptrofimov
Copy link
Author

If you handle more than one image with Imagine GMagick, in order to prevent segmentation fault, you need to call $image->__destruct() (with this fix #349) manually after using. Before GC makes it for you!

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

No branches or pull requests

1 participant