-
Notifications
You must be signed in to change notification settings - Fork 5
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
Possible problems with pre-built v8.1.0 binaries #11
Comments
Oh dear! I updated all the dependencies I could to the latest versions, but I don't think anything in the packaging itself has changed. I'll have a look as well tomorrow. |
It looks like libvips was compiled without libjpeg (and possibly libpng/libtiff) support. libmagick is being used to load JPEGs ( |
I switched to libjpeg-turbo, I guess vips didn't link to it correctly. I'll investigate. |
.. nope, we've been on -turbo for a while, I just updated the version from 1.4.0 to 1.4.2. I'll keep looking. |
I've uploaded a new zip: http://www.vips.ecs.soton.ac.uk/supported/current/win32/vips-dev-8.1.0-1.zip I'm not sure why it wasn't linking in the jpg support, I've not changed much :-( I did reorder the deps for vips, perhaps that helped. I now see:
so I think that means it should work. I've also added webp support, I think I forgot to add it to the list of supported libraries. |
Cheers John, I'll test the new binaries this evening. Thanks for adding WebP support too! |
The 8.1.0-1 rebuild appears to segfault on the colourspace conversion tests when run in Appveyor CI :( https://ci.appveyor.com/project/lovell/sharp/build/job/xenanmm3st6vgtgh Remote debugging CI environments is far from my idea of fun so I'll try running this on a local Windows machine over the weekend to get some better debug information. |
Looks like it's CMYK to sRGB that's falling over. Do you know the exact sequence of operations that are being run? Could it be lcms? |
The number in front of The segfault is most likely to be occurring during the next test, namely "From CMYK to sRGB with white background, not yellow" which also uses vips_icc_transform as well as a vips_embed. It could well be lcms, yes, and I should be able to get a lot more info when running it locally. |
There were some changes to the thing to get ICC profiles from JPEG images, that might be worth checking. The PNG and TIFF profile extractors are unchanged. |
I've been able to reproduce this locally and it seems to relate to filesystem-based loaders. All the relevant format libraries are present at compile, link and run time, but reading from any file always falls back to libmagick as the loader. (Reading from a buffer works as expected.) A common function all the file loaders hit is vips__get_bytes. The only thing I can see that could be remotely problematic are the two stack allocations of I noticed the use of |
How bizarre! You could try
You could prove it's going via Magick. I'll test in Wine here. |
Could the WebP DLL have been compiled on a machine with AVX2 intrinsics? I'm seeing the following segfault/output from WinDbg on a machine without AVX2:
https://chromium.googlesource.com/webm/libwebp/+/master/src/dsp/enc.c#778 suggests there's a compile-time check around the inclusion of the |
I spotted there's a runtime check around |
Thanks John, everything seems to works as expected via Windows has a 1MB stack by default, which is small compared with Linux/Mac OS's 8MB, so my next step will be to attempt to increase this via something like StackReserveSize. If you have the time, a win32 build of libvips v8.1.0 without the |
The linux stack is only 2mb with threading enabled, but you're right, it sounds a bit like a stack crash. I'll make one without webp for you. vips has been using O3 for a while, I'd think that would be OK. Probably? |
I've had some strange errors in Wine as well, which could also be a stack overflow. I'll dig some more. |
Yes, you're quite right, sorry John - I've just seen https://github.com/jcupitt/build-win32/blob/master/8.0/vips.modules#L361 in the 8.x build config.
Great, thank you. I'm happy to help test the re-addition of WebP after this file loader thing is solved. |
Here's a build without webp: http://www.vips.ecs.soton.ac.uk/development/vips-dev-8.1.0.zip |
Gotcha! Commit jcupitt/libvips@ec0e74e means a Windows path containing a drive letter such as |
Temporarily changing paths to be relative also seems to have fixed the WebP segfault, at least for the previously failing test that converts from TIFF input > WebP output. I guess this is because libtiff was used rather than libmagick, which was able to play more nicely with icc_transform. Of course there might still be a WebP thread safety thing to watch out for. |
Oh well done! Argh, stupid filename parsing, what a terrible idea. I'll fix it and add some tests. |
helps windows, see libvips/build-win32#11 also add some tests
I've changed it a bit, and added some tests: it passes for me on linux. Do your paths that broke pass now as well? I'm not sure if I changed the splitter enough. |
Thanks John. If you're able to create and publish a win32 build for 8.1.0 + this patch then I'll update sharp's Windows CI env to use it. |
Here's a test build of 8.1.1: http://www.vips.ecs.soton.ac.uk/development/ it includes the filename parsing change and -O3, but not webp. If it doesn't work, could you paste the exact filename that it fails on? |
No joy :( https://ci.appveyor.com/project/lovell/sharp/build/191/job/lq131okib271i7lp I suspect the scenario where there's only one colon in the filename needs adding to these tests. By way of example, |
oh argh, we were mangling windows paths see libvips/build-win32#11
Oh argh :-( it passes now, I'll make another win32 test build. |
I've put up 8.1.1-1, including this fix and webp support. |
The previously failing tests now pass, thanks John! It looks like the Windows CI environment is still suffering from a WebP-related segfault. I'll need to debug this on a local Windows machine to confirm - possibly this evening. |
Attempting to save in the WebP format generates the same AVX2-related segfault as before, as well as a previously-unseen SSE2-related segfault when attempting to save RGBA WebP images:
The machine I'm using does have SSE2 (and SSE4.2) support so my best guess is that the intrinsics code generated by the version of gcc in mingw could be borked a la http://www.virtualdub.org/blog/pivot/entry.php?id=363 libwebp has a recent commit to allow the disabling of runtime intrinsic detection but sadly this arrived after the most recent 0.4.3 release - see webmproject/libwebp@46305ca If the jhbuild tool allows you to build WebP from its git repo rather than the 0.4.3 published release then the new |
I think my instinct would be against building from git: it would mean we'd get slightly different code every time we made a binary and could make reproducing problems even harder. Let's just remove Windows webp support for now. I'll make another 8.1.1 build. |
Also, great detective work on this annoying issue, thank you Lovell! |
Thanks John, totally agree with removing libwebp for now, at least until the next published release. An alternative solution, should anyone need WebP on Windows in the near future, could be to attempt to apply the single .patch to 0.4.3. |
I've put up a new test zip: http://www.vips.ecs.soton.ac.uk/development/vips-dev-8.1.1-2.zip You can get jhbuild to build from a particular point in git, so we could also get the patch that way, but let's not bother. I'm sure there will be a 0.4.4 pretty soon with this all resolved. |
All tests now passing, thank you. https://ci.appveyor.com/project/lovell/sharp/build/198 |
All the vips tests pass too, so let's bless this as 8.1.1. I've put a copy of the same zip in the Thanks again for nailing this bug, and sorry for the mess up with |
Hi John, I'm still investigating this one, but here's an advanced warning that the Windows-based CI environment for sharp seems to be having a minor meltdown with the pre-built v8.1.0 from http://www.vips.ecs.soton.ac.uk/supported/8.1/win32/
v8.1.0 - fails - https://ci.appveyor.com/project/lovell/sharp/build/183/job/26eemal068fwc9ar
v8.0.2 - passes - https://ci.appveyor.com/project/lovell/sharp/build/184/job/chya6eyurgxhd0pq
sharp's GYP binding file lists the library files expected in the
lib
directory of the.zip
file. A quick check suggests everything is there with the correct filenames.Has anything changed in the win32 packaging between 8.0.x and 8.1.x?
The text was updated successfully, but these errors were encountered: