pyvips icon indicating copy to clipboard operation
pyvips copied to clipboard

Segfault on conda package

Open godardt opened this issue 6 years ago • 13 comments

Hello, When I try to install on my arch linux with:

conda install --channel conda-forge pyvips

And as soon as I import pyvips I get:

$ python
Python 3.7.5 (default, Oct 25 2019, 15:51:11) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips
Segmentation fault (core dumped)

Any idea what I can do to fix this? Thanks!

UPDATE: It seems libMagickCore-7.Q16HDRI.so.6 => not found is missing from the dynamic dependencies. Shouldn't it be included in the anaconda package?

godardt avatar Nov 13 '19 09:11 godardt

Thanks for reporting this @EKami. I see this too on Ubuntu:

$ conda create --name test python=3 pyvips
...
$ conda activate test
(test) $ which python
/home/john/miniconda3/envs/test/bin/python
(test) $ gdb /home/john/miniconda3/envs/test/bin/python
Reading symbols from /home/john/miniconda3/envs/test/bin/python...
(gdb) run 
Starting program: /home/john/miniconda3/envs/test/bin/python 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Python 3.7.3 | packaged by conda-forge | (default, Jul  1 2019, 21:52:21) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips

Program received signal SIGSEGV, Segmentation fault.
do_lookup_x (
    undef_name=undef_name@entry=0x7ffff70277a4 "_ITM_deregisterTMCloneTable", 
    new_hash=new_hash@entry=2247416213, 
    old_hash=old_hash@entry=0x7fffffffb8e0, ref=0x7ffff70274b8, 
    result=result@entry=0x7fffffffb8f0, scope=<optimised out>, i=0, 
    version=0x0, flags=1, skip=<optimised out>, type_class=4, 
    undef_map=0x555555a41040) at dl-lookup.c:350
...
#7  0x00007ffff7fe49ba in _dl_open (file=0x7ffff7fbf5b8 "libgobject-2.0.so.0", 
    mode=-2147483646, caller_dlopen=<optimised out>, nsid=-2, argc=1, 
    argv=0x7fffffffd9f8, env=0x7fffffffda08) at dl-open.c:603
603	dl-open.c: No such file or directory.
(gdb) 

Though libgobject is present in lib:

$ ls ~/miniconda3/envs/test/lib/libgobject-2.0.so*
/home/john/miniconda3/envs/test/lib/libgobject-2.0.so
/home/john/miniconda3/envs/test/lib/libgobject-2.0.so.0
/home/john/miniconda3/envs/test/lib/libgobject-2.0.so.0.5800.3

Sebastian is trying to update the conda package now, but something seems to be broken there too:

https://github.com/conda-forge/libvips-feedstock/pull/4

jcupitt avatar Nov 13 '19 09:11 jcupitt

I ended up doing: ln -s /home/ekami/Programs/anaconda3/envs/dl/lib/libMagick++-7.Q16HDRI.so /home/ekami/Programs/anaconda3/envs/dl/lib/libMagickCore-7.Q16HDRI.so.6

And it kinda worked, not sure if that's a sustainable solution tho.

godardt avatar Nov 13 '19 09:11 godardt

I have just reproduced the error.

Could you please let me know which one is the offending package in: https://github.com/conda-forge/libvips-feedstock/blob/master/recipe/meta.yaml

Since we haven't pinned any dependency in the recipe, one of those will have been updated and it's causing the issue. What I normally do is to find out the offending dependency in the recipe and pin it to a previously working version in a new package release.

sebastian-luna-valero avatar Nov 13 '19 10:11 sebastian-luna-valero

@sebastian-luna-valero I'd say imagemagick since that's the one missing from the dynamic dependencies

godardt avatar Nov 13 '19 10:11 godardt

If you do:

conda create -n test -c conda-forge -c bioconda -c defaults pyvips 'imagemagick<7.0.9'

It should work. Please try and let me know.

sebastian-luna-valero avatar Nov 13 '19 11:11 sebastian-luna-valero

@sebastian-luna-valero It works indeed!

godardt avatar Nov 13 '19 11:11 godardt

Thanks!

xref: https://github.com/conda-forge/libvips-feedstock/pull/5

sebastian-luna-valero avatar Nov 13 '19 11:11 sebastian-luna-valero

Hello, Please also ensure the conda package uses the pixman=0.36.0 dependency and not the 0.38.0, the reason is because the version 0.38.0 create corrupted images with various levels of zoom. I lost 2 weeks of converting WSIs because of this :(

godardt avatar Dec 17 '19 16:12 godardt

As far as I can see in the conda-forge recipes pixman is not a direct dependency for either libvips or pyvips, did we miss it? I see how pixman is installed with libvips since it must be a dependency of a dependency. Is this the intended behaviour?

sebastian-luna-valero avatar Jan 07 '20 18:01 sebastian-luna-valero

i'm still getting this segfault on ubuntu 18. even with the imagemagick bound it doesn't work. EKami's solution of softlinking works

makslevental avatar Apr 06 '20 17:04 makslevental

Hi,

On Ubuntu 18.04, I have just tried:

conda create -n test1 --override-channels -c conda-forge -c defaults pyvips
conda activate test1
python -c "import pyvips"

and it works for me. FYI:

conda list imagemagick
# packages in environment at /tmp/tmp.UxcuggEH4h/conda-install/envs/test1:
#
# Name                    Version                   Build  Channel
imagemagick               7.0.8_68        pl526h51306e4_0    conda-forge

I am not able to check the issue with pixman 0.38 though.

Best regards, Sebastian

sebastian-luna-valero avatar Apr 16 '20 11:04 sebastian-luna-valero

The pixman issue (https://github.com/libvips/libvips/issues/1401) will be resolved with https://github.com/conda-forge/pixman-feedstock/pull/16.

I had a quick scan through the libvips-feedstock and noticed:

  • The libvips version is still on 8.8.3 whereas 8.9.2 is available.
  • gstreamer-orc is pinned to <0.4.30 but not necessary after https://github.com/conda-forge/gstreamer-orc-feedstock/pull/4.
  • Perhaps we could try to build the libvips recipe for Windows. The gdk-pixbuf issue is now resolved with: https://github.com/conda-forge/gdk-pixbuf-feedstock/pull/19.

I could help to resolve these things, if you want. Note that I don't use Conda on a daily basis.

(The Windows build can be tricky to fix, as it usually involves a lot of patches see for e.g. https://github.com/libvips/build-win64-mxe/tree/master/8.9/patches)

kleisauke avatar May 04 '20 12:05 kleisauke

Many thanks @kleisauke

Please have a go and I would be happy to assist.

sebastian-luna-valero avatar May 10 '20 10:05 sebastian-luna-valero