LCMS2 needs multi-threading fixes to work with the new Ghostscript 9.07

Bug #1126427 reported by Till Kamppeter
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lcms2 (Ubuntu)
Won't Fix
High
Chris Halse Rogers

Bug Description

Ghostscript 9.07 which was released this week uses LCMS2 and does not work with the stocl LCMS2 as it comes with Ubuntu. It needs multi-threading fixes in LCMS2.

The Ghostscript developers have created patches and applied them to the LCMS2 copy which comes with Ghostscript and also made them available to the upstream LCMS2 project:

https://github.com/robinwatts/Little-CMS/commits/threading_fixes

The patches are not yet included by upstream.

To update Ghostscript to 9.07 in Raring I would like to have the patches applied to Raring's package of LCMS2.

The patches, relative to the upstream GIT trunk are attached.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :
Changed in lcms2 (Ubuntu):
importance: Undecided → High
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

The Ghostscript developers did also some optimizations of LCMS2 for Ghostscript. These optimizations were also made available for upstream, see:

https://github.com/robinwatts/Little-CMS/commits/artifex

The attached patch contains the fixes from above and the optimizations. So you can choose whether you apply only the fixes (first patch) or the fixes and the optimizations (this patch) to the Ubuntu package of LCMS2.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

No the fix is in the official upstream repo of LCMS2:

https://github.com/mm2/Little-CMS/commit/df3194a9

Please backport it to the Ubuntu package so that I can update Ghostscript.

Revision history for this message
Chris Halse Rogers (raof) wrote : Re: [Bug 1126427] [NEW] LCMS2 needs multi-threading fixes to work with the new Ghostscript 9.07

 assign me

Changed in lcms2 (Ubuntu):
assignee: nobody → Chris Halse Rogers (raof)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lcms2 - 2.4-0ubuntu2

---------------
lcms2 (2.4-0ubuntu2) raring; urgency=low

  * debian/patches/fix-threading-issue-in-plugin-registration.patch:
    - Provide a thread-safe way for plugins to register; needed for new
      ghostscript 9.07 (LP: #1126427)
 -- Christopher James Halse Rogers <email address hidden> Wed, 13 Mar 2013 12:13:21 +1100

Changed in lcms2 (Ubuntu):
status: New → Fix Released
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :
Download full text (6.6 KiB)

Thank you very much for applying the changes, unfortunately, something went wrong in your application of the patch. I have built Ghostscript 9.07 against the patched library and it segfaults on most PDF files. Here is the gdb backtrace:

till@till-raring:~/ubuntu/ghostscript/ghostscript-9.07~dfsg$ gdb -c core /usr/bin/gs
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/gs...Reading symbols from /usr/lib/debug/usr/bin/gs...done.
done.
[New LWP 22412]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff714b7000
Core was generated by `gs -sDEVICE=cups -r600 -dcupsColorSpace=1 -sOutputFile=../z /home/till/altona_t'.
Program terminated with signal 11, Segmentation fault.
#0 gs_lcms2_malloc (id=0x0, size=3744) at ./base/gsicc_lcms2.c:48
48 ptr = gs_alloc_bytes(mem, size, "lcms");
(gdb) bt
#0 gs_lcms2_malloc (id=0x0, size=3744) at ./base/gsicc_lcms2.c:48
#1 0x00007fbaf3fda4a5 in ?? () from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#2 0x00007fbaf3fe09b2 in cmsCreateProfilePlaceholder ()
   from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#3 0x00007fbaf3ff5a9e in cmsCreateRGBProfileTHR ()
   from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#4 0x00007fbaf3ff630c in cmsCreateLab4ProfileTHR ()
   from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#5 0x00007fbaf3ff11e8 in ?? () from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#6 0x00007fbaf3ff15df in cmsDetectBlackPoint ()
   from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#7 0x00007fbaf3fd8cef in ?? () from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#8 0x00007fbaf3fd99a2 in ?? () from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#9 0x00007fbaf3ff09a2 in cmsCreateExtendedTransform ()
   from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#10 0x00007fbaf3ff0d81 in cmsCreateMultiprofileTransformTHR ()
   from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#11 0x00007fbaf3ff0e8c in cmsCreateTransformTHR ()
   from /usr/lib/x86_64-linux-gnu/liblcms2.so.2
#12 0x00007fbaf47e7245 in gscms_get_link (
    lcms_srchandle=lcms_srchandle@entry=0x1afc340,
    lcms_deshandle=lcms_deshandle@entry=0x19965d0,
    rendering_params=rendering_params@entry=0x7fff714980c0, memory=0x17f7040)
---Type <return> to continue, or q <return> to quit---
    at ./base/gsicc_lcms2.c:419
#13 0x00007fbaf47e5db9 in gsicc_get_link_profile (pis=pis@entry=0x182dc28,
    dev=dev@entry=0x7fbaf5253068,
    gs_input_profile=gs_input_profile@entry=0x1997690,
    gs_output_profile=0x19cb3c0,
    rendering_params=rendering_params@entry=0x7fff714980c0, memory=0x17f7938,
    devicegraytok=1) at ./base/gsicc_cache.c:933
#14 0...

Read more...

Changed in lcms2 (Ubuntu):
status: Fix Released → New
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Here is the original GS command line which lead to the stack trace above

gs -sDEVICE=cups -r600 -dcupsColorSpace=1 -sOutputFile=../z ~/altona_technical_1v2_x3.pdf

The input PDF file is attached.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have sent the ghostscript 9.07 package to my PPA for testing:

https://launchpad.net/~till-kamppeter/+archive/ppa

Package: ghostscript 9.07~dfsg-0ubuntu1~ppa1

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I succeeded to fix the patch for lcms2, comparing the lcms2 which comes with upstream Ghostscript and the upstream source tarball of the Ubuntu lcms2 package. The debdiff with the resulting patch is attached. With this version Ghostscript 9.07 is absolutely stable (tested ~20 PDF files).

Please upload this package to Raring.

Changed in lcms2 (Ubuntu):
status: New → Triaged
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

I have also sent the new patch to the upstream developers of Ghostscript and they are contacting Marti Maria from LCMS now to make sure that the upstream version of the changes works correctly.

Revision history for this message
Chris Halse Rogers (raof) wrote :

As decided on in #ubuntu-desktop just now, we'll not ship this until ghostscript runs on an upstream snapshot of lcms2. We won't take ghostscript's forkish of lcms2 as our lcms2 package.

Changed in lcms2 (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.