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

darktable crash with gmic library #4067

Closed
jpverrue opened this issue Jan 8, 2020 · 35 comments
Closed

darktable crash with gmic library #4067

jpverrue opened this issue Jan 8, 2020 · 35 comments
Assignees
Labels
bug: wip someone is currently working on that, check with them before taking over no-issue-activity priority: high core features are broken and not usable at all, software crashes reproduce: random the bug appears more than 30% of times but the causes are still unclear understood: clear devs have a complete bug report with all the relevant info to start fixing

Comments

@jpverrue
Copy link
Contributor

jpverrue commented Jan 8, 2020

@phweyland
Describe the bug
I just installed the gmic library needed for the new 3D lut module, then I recompiled it without any problem. But since then, darktable crashes whenever I try to do anything. More precisely, I can launch darktable without any problem, the LT interface is displayed, I can open and close modules, scroll in my pictures, but as soon as I try to go to DR, zoom an image (W), launch an export and "à priori" any action (I haven't tested everything), darktable crashes with the following error message :

/opt/darktable/bin/darktable: symbol lookup error: /opt/darktable/lib64/darktable/plugins/liblut3d.so: undefined symbol: _ZN12cimg_library8CImgListIfE6assignEj

Platform (please complete the following information):

  • Darktable Version: 3.1.0+320~g218dd5d8c
  • OS: opensuse tumbleweed 20200105

Additional context
Packages loaded

i+ | libgmic-devel       | package | 2.8.1-1.1 | x86_64 | Dépôt principal (OSS) (20190718)
i  | libgmic1            | package | 2.8.1-1.1 | x86_64 | Dépôt principal (OSS) (20190718)

I removed the packages and recompiled. darktable is working again without any problem.

@kikoucalou
Copy link

Probably somethink similar, DT crash when lauding image with " ... took 0,236 secs (0,422 CPU) to load the image.
terminate called after throwing an instance of 'gmic_exception' ..."

Platform :

  • darktable version 3.1.0+323~gaae21bfd5
  • compiled on Linux Mint 19.3 Tricia

Libgmic1 1.7.9+zart-4build3
libgmic-devel 1.7.9+zart-4build3

@kikoucalou
Copy link

When reverting to darktable version 3.1.0+308~g2f82a6e43, DT run nicely

@phweyland
Copy link
Contributor

phweyland commented Jan 8, 2020

@kikoucalou, There two issues there:
One your side. GMIC library must be >= 2.7.0.
One on dt side, because if the version is less than 2.7.0 it should not try to use GMIC.

@phweyland
Copy link
Contributor

@jpverrue, your gmic version seems to be the last one.
There are probably some missing dependencies, but the undefined symbol: _ZN12cimg_library8CImgListIfE6assignEj doesn't help me for the moment.
I'll try to find the list of gmic dependencies and I'll post it here.

@phweyland
Copy link
Contributor

@jpverrue, did you open the lut3d module and select a compressed lut ?

@phweyland
Copy link
Contributor

phweyland commented Jan 8, 2020

@jpverrue from the GMIC site the dependencies of the gmic library are the followings:

$ sudo apt-get install git build-essential libgimp2.0-dev libcv-dev libopencv-dev libhighgui-dev libcurl4-openssl-dev libfftw3-dev qt5-default qtbase5-dev

Could you check you have all of those (the run time ones) ?

@kikoucalou
Copy link

Updated to libgmic1 & libgmic-dev version 1:2.7.4+om-ubu18.04.1.1 and make a new build :

Darktable 3.1.0+323~gaae21bfd5 is runing fine again

@phweyland
Copy link
Contributor

Darktable 3.1.0+323~gaae21bfd5 is runing fine again

👍

Other important point, when updating gmic library: do not forget to reset cmake (delete file CMakeCache.txt in build folder). If not it can keep the old library.

@phweyland
Copy link
Contributor

I've found an issue. GMIC version is expressed with 3 or 4 numbers. And obviously 1.6.6.1 is above 2.7.0 ... I can fix that.

@parafin
Copy link
Member

parafin commented Jan 9, 2020

You mean below/less/older, not above.

@phweyland
Copy link
Contributor

You mean below/less/older, not above.

Yes :)

@jpverrue
Copy link
Contributor Author

jpverrue commented Jan 9, 2020

@phweyland

@jpverrue from the GMIC site the dependencies of the gmic library are the followings:
$ sudo apt-get install git build-essential libgimp2.0-dev libcv-dev libopencv-dev libhighgui-dev libcurl4-openssl-dev libfftw3-dev qt5-default qtbase5-dev
Could you check you have all of those (the run time ones) ?

I use opensuse tumbleweed in the latest version (20200107). The installation tool is not apt-get, but zypper. The package names are also slightly different. So I can't easily check if the right packages are installed, but I trust zypper which handles dependencies very well. However, an error is always possible. How can I detect a possible missing dependency?

@phweyland
Copy link
Contributor

@jpverrue before spending time looking at dependencies, I would like to check you have reset cmake after installing gmic 8.2 (deleting file CMakeCache.txt in build folder should be enough). When I run the test the first time, I've forgotten that and cmake still used the previous installed library, preventing dt to work.
Can you confirm ?

@phweyland
Copy link
Contributor

deleting file CMakeCache.txt in build folder should be enough

hmmm ... it seems that deleting the full content of build is safer. Playing some tests again I've seen that removing CMakeCache.txt were not always enough.

@jpverrue
Copy link
Contributor Author

jpverrue commented Jan 9, 2020

I mainly compile Git versions. In order not to take any risk, I almost systematically remove the build directory before starting the compilation. Similarly, before installing, I remove the /opt/darktable directory. It's a bit heavy, but it's very secure. I have a script that does all this simply.

It's only when I do tests in the code that I don't take these precautions.

@phweyland
Copy link
Contributor

I almost systematically remove the build directory before starting the compilation

This means that cmake should consider your last installed version. But the crash message you get shows that either dt doesn't find the library, or it sees a library which is not the good one.

With this commit there are 3 possibilities

  1. cmake doesn't find any gmic library. lut3d should behave as before (no compressed lut)
    2.1. cmake finds a gmic library but the version is < 2.7.0. dt is linked with the gmic library but doesn't use it. lut3d should behave as before (no compressed lut)
    2.2. cmake finds a gmic library and the version is >= 2.7.0. lut3d should offer the compressed luts (cmz).

In case 2.1 and 2.2, dt will crash if it doesn't find the library.
I'm a newbie on linux and I'm using debian. So I have no direction to give ...

I would (if you have time :-))

  1. uninstall gmic (and check it is really uninstalled if you can), build and see if 1 works.
  2. install again gmic 2.8, check it is properly installed, build and see if 2.2 works

I've the impression dt doesn't see the (right) run time library ... but I don't know how to check this on linux.

@jpverrue
Copy link
Contributor Author

jpverrue commented Jan 9, 2020

When I uninstall libgmic1 and libgmic-devel and then recompile darktable it no longer crashes. In the log of build.sh I have this message:

WARNING: MISSING PACKAGE
  We could not find development headers for GMIC.  Do you have the necessary
  dev package installed? This package is NOT REQUIRED and you may ignore this
  warning but by doing so you may miss some functionality of darktable.

When I install libgmic1 and libgmic-devel and then recompile, darktable crashes, but now without even displaying the light table. In the log of build.sh I have this message :
Found GMIC

When the library is uninstalled a system-wide search does not find any files matching the gmic pattern (except of course the files /home/jpv/dev-c/darktable/cmake/modules/FindGMIC.cmake and /home/jpv/dev-c/darktable/src/iop/lut3dgmic.cpp)
When the library is installed, in addition to the darktable files I find the following files:

/usr/include/gmic.h
/usr/lib64/cmake/gmic
/usr/lib64/cmake/gmic/GmicConfig.cmake
/usr/lib64/cmake/gmic/GmicTargets-relwithdebinfo.cmake
/usr/lib64/cmake/gmic/GmicTargets.cmake
/usr/lib64/libgmic.so.1
/usr/lib64/libgmic.so
/usr/share/licenses/libgmic1

zypper confirms me that the installed version is 2.8.1-1.1

@phweyland
Copy link
Contributor

Same crash message on the console as at the beginning ?
Could you uninstall again libgmic and launch dt (build with gmic 2.8.1) ?
Does it still crash ? What does happen ?

When I uninstall gmic after having built dt, I have no libgmic.so file anymore. If I launch dt it doesn't crash, but the lut3d module doesn't show up.
I have this message on the console

[iop_load_module] failed to open operation `lut3d': libgmic.so.2: cannot open shared object file: No such file or directory

If reinstall gmic (2.8.1) dt works with lut3d and I've this on system:
image

@jpverrue
Copy link
Contributor Author

I reinstalled libgmic1 and libgmic-devel and recompiled darktable.
In the log of build.sh I have this message : Found GMIC.
When I launch dartkable, it crashes with always the same error message:

/opt/darktable/bin/darktable: symbol lookup error: /opt/darktable/lib64/darktable/plugins/liblut3d.so: undefined symbol: _ZN12cimg_library8CImgListIfE6assignEj

I uninstalled libgmic1 and libgmic-devel then restarted darktable. darktable doesn't crash anymore and I get the following error messages:

[iop_load_module] failed to open operation `lut3d': libgmic.so.1: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type
[dev_read_history] the module `lut3d' requested by image `JPV_042165.RAF' is not installed on this computer!
[dev_read_history] the module `lut3d' requested by image `JPV_042165.RAF' is not installed on this computer!
[dev_read_history] the module `lut3d' requested by image `JPV_042165.RAF' is not installed on this computer!

The same one you have on your system.

@phweyland
Copy link
Contributor

So dt finds your library but doesn't like it. Remains to find why.
Thanks for your tests !

@phweyland
Copy link
Contributor

Do you know where your gmic library comes from ? Who has built it ?

@johnny-bit
Copy link
Member

@jpverrue - run gmic version on the console and post full results. On my system it says:

    [gmic]-0./ Start G'MIC interpreter.
      gmic: GREYC's Magic for Image Computing. 
            (https://gmic.eu) 

            Version 2.7.2  
            Copyright (c) 2008-2019, David Tschumperle / GREYC Lab / CNRS. 
            (https://www.greyc.fr)

    [gmic]-0./ End G'MIC interpreter.

and it works just fine.

@phweyland
Copy link
Contributor

phweyland commented Jan 10, 2020

And your library libgmic.so is 2.8.1 ?

EDIT , sorry I thought answering to @jpverrue ....

@phweyland
Copy link
Contributor

phweyland commented Jan 10, 2020

On my side i uninstall the libgmic and libgmic-dev from standard debian and install the last GMIC application (this gives the full app + library, including libgmic library). I don't (and I can't) let both.

@ptilopteri
Copy link

@jpverrue you have the wrong version of libgmic1 installed, 2.7.1-5.1,probably from http://download.opensuse.org/repositories/graphics/openSUSE_Tumbleweed/

the version you need, 2.8.1-1.1, is at http://download.opensuse.org/tumbleweed/repo/oss/

@jpverrue
Copy link
Contributor Author

@phweyland : I reinstalled libgmic1 and libgmic-devel. I also installed the gmic interpreter. Here is the package information:

jpv@geeko:~> zypper if -s gmic
Chargement des données du dépôt...
Lecture des paquets installés...

Informations sur paquet gmic :
------------------------------
Dépôt                     : Dépôt principal (OSS) (20190718)                       
Nom                       : gmic                                                   
Version                   : 2.8.1-1.1                                              
Architecture              : x86_64                                                 
Fabricant                 : openSUSE                                               
Taille une fois installé  : 2,9 MiB                                                
Installé                  : Oui                                                    
État                      : à jour                                                 
Paquet source             : gmic-2.8.1-1.1.src                                     
Résumé                    : GREYC's Magick for Image Computing (denoise and others)
Description               :                                                        
    G'MIC is a framework for image processing, providing
    several different user interfaces to convert/manipulate/filter/visualize
    generic image datasets, from 1d scalar signals to 3d+t sequences of
    multi-spectral volumetric images.

Informations sur paquet libgmic-devel :
---------------------------------------
Dépôt                     : Dépôt principal (OSS) (20190718)                          
Nom                       : libgmic-devel                                             
Version                   : 2.8.1-1.1                                                 
Architecture              : x86_64                                                    
Fabricant                 : openSUSE                                                  
Taille une fois installé  : 24,0 KiB                                                  
Installé                  : Oui                                                       
État                      : à jour                                                    
Paquet source             : gmic-2.8.1-1.1.src                                        
Résumé                    : Header and library from gmic for use in other C++ projects
Description               :                                                           
    Header and library from gmic to needed to develop C++ code that
    uses the gmic functionality provided by the gmic library.

Informations sur paquet libgmic1 :
----------------------------------
Dépôt                     : Dépôt principal (OSS) (20190718)   
Nom                       : libgmic1                           
Version                   : 2.8.1-1.1                          
Architecture              : x86_64                             
Fabricant                 : openSUSE                           
Taille une fois installé  : 6,4 MiB                            
Installé                  : Oui                                
État                      : à jour                             
Paquet source             : gmic-2.8.1-1.1.src                 
Résumé                    : Shared library that belongs to gmic
Description               :                                    
    Shared library allows you to use gmic functionality from other
    programs.

I then ran gmic version and I got this:

jpv@geeko:~> gmic version
[gmic]-0./ Start G'MIC interpreter.

  gmic: GREYC's Magic for Image Computing: command-line interface 
        (https://gmic.eu) 
        Version 2.8.1 
 
        Copyright (c) 2008-2020, David Tschumperle / GREYC / CNRS. 
        (https://www.greyc.fr)

[gmic]-0./ End G'MIC interpreter.

@ptilopteri : No, I got the right version as you can see. I don't have the graphics repository. Here is the list of repositories configured on my computer :

jpv@geeko:~> zypper lr
Priorités de dépôt en vigueur :                                                                     (Consultez 'zypper lr -P' pour plus de détails)
      90 (priorité relevée)    :  1 dépôt 
      99 (priorité par défaut) :  3 dépôts

# | Alias                            | Nom                                  | Activé | Vérification GPG | Rafraichir
--+----------------------------------+--------------------------------------+--------+------------------+-----------
1 | download.nvidia.com-tumbleweed   | nVidia Graphics Drivers              | Non    | ----             | ----      
2 | download.opensuse.org-non-oss    | Dépôt principal (NON-OSS) (20190718) | Oui    | (r ) Oui         | Oui       
3 | download.opensuse.org-oss        | Dépôt principal (OSS) (20190718)     | Oui    | (r ) Oui         | Oui       
4 | download.opensuse.org-tumbleweed | Dépôt principal de mise à jour       | Oui    | (r ) Oui         | Oui       
5 | openSUSE-20190708-0              | openSUSE-20190708-0                  | Non    | ----             | ----      
6 | packman                          | packman                              | Oui    | (r ) Oui         | Oui       
7 | repo-debug                       | openSUSE-Tumbleweed-Debug            | Non    | ----             | ----      
8 | repo-source                      | openSUSE-Tumbleweed-Source           | Non    | ----             | ----      

@cryptomilk
Copy link
Contributor

Please run the following commands:

rpm -q darktable
rpm -q libgmic1

and

LD_DEBUG=symbols darktable 2>&1 | tee dt-symbols.log

Attach the dt-symbols.log here

@jpverrue
Copy link
Contributor Author

Here's the result:

jpv@geeko:~> rpm -q darktable
le paquet darktable n'est pas installé
jpv@geeko:~> rpm -q libgmic1
libgmic1-2.8.1-1.1.x86_64

There is no result for darktable because I compile it myself.
dt-symbols.zip
This is a very large file ! 20.9 Mo zipped, 542.5 Mo unzipped !

@aurelienpierre aurelienpierre added the bug: wip someone is currently working on that, check with them before taking over label Jan 13, 2020
@aurelienpierre aurelienpierre added reproduce: random the bug appears more than 30% of times but the causes are still unclear understood: clear devs have a complete bug report with all the relevant info to start fixing priority: high core features are broken and not usable at all, software crashes labels Jan 13, 2020
@phweyland
Copy link
Contributor

phweyland commented Jan 13, 2020

symbol lookup error: /opt/darktable/lib64/darktable/plugins/liblut3d.so: undefined symbol: _ZN12cimg_library8CImgListIfE6assignEj

This symbol is not in dt-symbols.zip. The closest one I've found is: _ZN12cimg_library8CImgListIfED1Ev

EDIT: I've run LD_DEBUG=symbols darktable 2>&1 | tee dt-symbols.log on my machine and I don't find this missing symbol either (while libgmic works).

@cryptomilk
Copy link
Contributor

Yep, it is a bug in libgmic ...

@phweyland
Copy link
Contributor

Yep, it is a bug in libgmic ...

Could you share more detail about this ?
Is it time to call David Tschumperlé for help ?

@cryptomilk
Copy link
Contributor

https://discuss.pixls.us/t/gmic-lookup-symbol-err-on-opensuse-darktable-master-build/15827/8

@jpverrue
Copy link
Contributor Author

After reading https://discuss.pixls.us/t/gmic-lookup-symbol-err-on-opensuse-darktable-master-build/15827/8, I feel like I made quite a mess, don't you?

@github-actions
Copy link

This issue did not get any activity in the past 30 days and will be closed in 7 days if no update occurs. Please check if the master branch has fixed it since then.

@johnny-bit
Copy link
Member

It seems like this issue got resolved in both GMIC library and darktable. On darktable's side it was fixed with #4120, #4121 and #4124. And in case of OS libs it's also fixed so it should generally work :)

If this is still an issue on new release (or current master) please open new issue! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: wip someone is currently working on that, check with them before taking over no-issue-activity priority: high core features are broken and not usable at all, software crashes reproduce: random the bug appears more than 30% of times but the causes are still unclear understood: clear devs have a complete bug report with all the relevant info to start fixing
Projects
None yet
Development

No branches or pull requests

8 participants