ImageMagick (6 and 7) compiled with LCMS2 and with GSLIB coredumps during converting PDF to PNG. ImageMagick compiled without LCMS2 and with GSLIB work fine. ImageMagick compiled with LCMS2 and without GSLIB work fine. gs binary from ghostscript 9.52 convert PDF to PNG without errors too. Probably this is a conflict between installed lcms2 amd embedded lcms2mt: ImageMagick linked with liblcms2 and with libgs, but libgs have embedded binary incompatible lcms2 (functions with same names). All information, include gdb's backtraces, are here: https://github.com/ImageMagick/ImageMagick/discussions/1908 More related bug reports: https://github.com/mm2/Little-CMS/issues/207 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245782 FreeBSD 12.1 amd64.
What other information I have to show?
Yes, as you say, that's quite possibly a conflict between lcms2mt and lcms2. BUT... it's not a gs bug. It's an Imagemagick one, you should report it to them. It's a problem with their integration. Or at least, it's down to the person that tried to link libraries built in conflicting ways.
> It's an Imagemagick one, you should report it to them. Already did. Read, plz, links above. > Or at least, it's down to the person that tried to link libraries built in conflicting ways. What is the correct way? ImageMagick using lcms2 and libgs.
Apologies, I handled this badly. My point was intended to be that you should report the issue to the maintainers of IM, and they should contact us to work together to solve the problem. BUT, one of my colleagues may have a workaround.
*if* the segfault is being caused by a symbol clash between lcms2mt (in gs) and lcms2 (in ImageMagick), then I *think* this should resolve it: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=f210e4c009f7 I'm closing this as resolved/fixed. If that turns out not to be the problem (or the above solution doesn't work), could you re-open and point the Imagemagick devs at this bug, or #ghostscript (on freenode) or the gs-devel mailing list (links on ghostcript.com), we can work with them to find a solution? Thanks.
Created attachment 19181 [details] visibility of lcms2mt Thanks. This patch work for me. Look at configure changes - without it I got error.
Created attachment 19182 [details] Visibility of lcms2mt. This one is correct.
Oh, wait.
Created attachment 19183 [details] Visibility of lcms2mt. This one work. 2nd doesn't work.
Created attachment 19184 [details] Doesn't work. This patch doesn't work with hard coded CFLAGS_VISIBILITY="-fvisibility=hidden" in configure.ac. But if it hard coded in Makefile.in - work fine.
(In reply to VVD from comment #10) > Created attachment 19184 [details] > Doesn't work. > > This patch doesn't work with hard coded > CFLAGS_VISIBILITY="-fvisibility=hidden" in configure.ac. > But if it hard coded in Makefile.in - work fine. Well, hard coding in Makefile.in is unacceptable - we have to support more compilers than just gcc and clang. I can't see any reason why the tests in configure.ac would not work (they certainly do on Linux), and I don't have a FreeBSD install to test on.
(In reply to Chris Liddell (chrisl) from comment #11) > Well, hard coding in Makefile.in is unacceptable - we have to support more > compilers than just gcc and clang. Agree, ofc you are right. > I can't see any reason why the tests in configure.ac would not work (they > certainly do on Linux), and I don't have a FreeBSD install to test on. He is not transferred from configure.ac to this Makefile.in. Without this one: --- configure.orig +++ configure @@ -868,6 +868,7 @@ ECHO_N ECHO_C DEFS +CFLAGS_VISIBILITY mandir localedir libdir I got error: cc: error: no such file or directory: '@CFLAGS_VISIBILITY@' gmake[4]: *** [base/lcms2mt.mak:101: soobj/cmscam02.o] Error 1
You need to run autogen.sh to regenerate configure from configure.ac.
(In reply to Chris Liddell (chrisl) from comment #13) > You need to run autogen.sh to regenerate configure from configure.ac. FreeBSD port print/ghostscript9-agpl-base doesn't use autogen.sh during build process. It patch configure and run it: https://svnweb.freebsd.org/ports/head/print/ghostscript9-agpl-base/files/ I made patch for port print/ghostscript9-agpl-base: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=213868&action=diff https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245782 Thanks a lot for fix it!