-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Tests segfault when run manually, but not when run via run-tests.php #138
Comments
|
Also for reference, if I remove the calls to separateImageChannel() and textureImage() from the relevant testscases, they do not segfault. |
......................O-kaaaaay. Do you happen to have a link to where that decision was made, or justified? Adding an extra piece of software to the mix, just seems to make it harder for people to report issues - like this.
If the extension can't be loaded, all of the tests would fail. If the extension is loaded all of them should pass. There are no subtle environment settings.
If you have valgrind installed running the tests with the -m flag for memory checks will use valgrind - which just so happens to also give better information about segfaults.
Or just to use it directly: If valgrind doesn't show anything, running the a test script through gdb almost certainly should: Those will almost certainly show exactly where the problem is occurring. |
|
btw - I normally test using Centos, in particular the very stable 6.4. I have seen errors when running all the tests in Ubuntu, apparently due to problems in underlying libraries. |
|
On Tue, Mar 1, 2016 at 1:31 PM, Danack notifications@github.com wrote:
was the commit where it was done. It wasn't very well thought out, I think the reasoning is that Debian/Ubuntu don't have the
Ok, well, the extension is installed at this point, in /usr/share/php.
I will try that. I believe when I did the valgrind runs before, it |
Feel free to post that info here. Sometimes the meaning of the output is not as clear as one might hope for. In particular, if you have OpenMP on the system and ImageMagick has decided to use more than one thread, errors can occur in things like the shut down function. |
btw - the switching tests will almost certainly make no difference. The errors are incredibly likely to be due to invalid memory accesses in ImageMagick, which "just happen" to work when the tests are run in one environment, but "just happen" to fail in another. |
|
|
Use the Force, Luke. So. That doesn't tell us what is the cause but it tells us:
You could try editing the Or recompiling ImageMagick with Also, are you testing against a PHP version that has ZTS (aka ZendThreadSafe aka support for threads) enabled? If that doesn't provide any information....I apparently have a test program at https://github.com/Danack/imagemagicktest/blob/master/channel.c I'm not sure the makefile for that is going to work on anyone elses system, but it might! doing |
|
On Wed, Mar 2, 2016 at 3:21 PM, Danack notifications@github.com wrote:
Yeah, but I set/export MAGICK_THREAD_LIMIT=1 (without that, most of
Yep, has no impact on these three failing cases.
Yep, that's where I learned about policy.xml originally and then the
7.0.3-9 but not ZTS (I don't believe it has been built yet for Debian/Ubuntu).
Ok, I'll try that too. Thanks for all your help! -Nish |
|
Just as an FYI -- I found that upstream ImageMagick (ImageMagick-6 branch) didn't segfault, so I'm now bisecting from roughly the point where Debian has forked to see if a single commit fixed the issue. I know it's not ideal to backport it given the version string dependence, but would like to narrow it down. |
|
ImageMagick/ImageMagick@a54fe0e was the missing commit in Ubuntu's imagemagick (and Debian's). Test pass now. Thanks for your help & patience! |
|
No problem. FYI since I took over maintaining Imagick, a significant portion of my time on it is just chasing memory issues down and persuading the ImageMagick guys to fix them... |
Feel free to ignore this report, but I would appreciate any insight you can provide.
Running
make testfrom the php-imagick git tree (HEAD @ 15527aa), all tests pass:For context, the Debian packaging of php-imagick is trying to move to using phpunit to run the tests, though, and I have it mostly working (using the phpt testrunner). But I see a few segfaults, specifically with tests 116, 154 and 161.
I went back to the git tree, and did the following:
which gave
But when I run the command as provided, I get:
As I believe this is basically what phpunit runs (if I add all the ini modifications to the invocation) I think the root cause of this segfault and the segfaults under phpunit are the same. Am I missing some environment variable that needs to be set when running php directly? I've read through run-tests.php but nothing stood out immediately.
The text was updated successfully, but these errors were encountered: