[Bug 828751] New: lcms2 ver. 2.5 in same process with ghostscript leads to segfault
https://bugzilla.novell.com/show_bug.cgi?id=828751 https://bugzilla.novell.com/show_bug.cgi?id=828751#c0 Summary: lcms2 ver. 2.5 in same process with ghostscript leads to segfault Classification: openSUSE Product: openSUSE Factory Version: 13.1 Milestone 2 Platform: All OS/Version: SUSE Other Status: NEW Severity: Major Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dap@open.by QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Opera/9.80 (X11; Linux x86_64; openSUSE 12.2 Mantis) Presto/2.12.388 Version/12.15 Applications that have ghostscript and lcms2 ver. 2.5 (pulled via poppler) in the same process and call poppler API after issuing at least one call to ghostscript library experience a crash seemingly caused by an lcms2 bug. The crash appears to be avoided on some PDFs lacking images, apparently allowing poppler to skip lcms initialization and thus avoiding the crash. Examples of such apps are Evince and LeechCraft Monocle. Some relevant info and considerations could be found in this bugreports: https://bugzilla.redhat.com/show_bug.cgi?id=977528 https://bugzilla.redhat.com/show_bug.cgi?id=977528 Downgrading to lcms2 ver. 2.4 fixes the issue keeping ghostscript, libspectre and poppler versions (thus the issue is in lcms). Reproducible: Always Steps to Reproduce: 1. Install leechcraft-monocle-pdf and leechcraft-monocle-postrus making sure lcms2's version is 2.5. 2. Run the following in a terminal: leechcraft -P /usr/lib/leechcraft/plugins/libleechcraft_monocle.so -P /usr/lib/leechcraft/plugins/libleechcraft_monocle_pdf.so -P /usr/lib/leechcraft/plugins/libleechcraft_monocle_postrus.so (NB! lib64 for x64 versions of distro) (note that omitting the last plugin, `/usr/lib/leechcraft/plugins/libleechcraft_monocle_postrus.so`, avoids the crash, proving the suggestion in the bugreport) 3. Open a new tab by pressing Ctrl+T and choose a PDF file, preferably rich with images and similar stuff. Actual Results: A crash. Expected Results: A PDF file happily opened. Reproducible also at openSUSE 12.2 х64 with lcms2 ver. 2.5 from OBS. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c1
--- Comment #1 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c2
--- Comment #2 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c3
Johannes Meixner
From what there is in your attachment#547477
(gdb) run Starting program: /usr/bin/leechcraft [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7fffef96d700 (LWP 27865)] [New Thread 0x7fffe4f10700 (LWP 27902)] undefined -21 undefined -21 [New Thread 0x7fffc563e700 (LWP 27970)] Program received signal SIGSEGV, Segmentation fault. gs_lcms2_malloc (id=0x0, size=3744) at base/gsicc_lcms2.c:48 --------------------------------------------------------------------------- my guess is the following: It seems /usr/bin/leechcraft starts some threads but it seems LCMS2 needs multi-threading fixes according to https://bugs.launchpad.net/ubuntu/+source/lcms2/+bug/1126427 "LCMS2 needs multi-threading fixes to work with the new Ghostscript 9.07" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c4
--- Comment #4 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c5
--- Comment #5 from Johannes Meixner
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c
FeiXiang Zhang
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c6
--- Comment #6 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c7
--- Comment #7 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c8
Johannes Meixner
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c9
Johannes Meixner
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c10
--- Comment #10 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c11
Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c12
--- Comment #12 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c13
--- Comment #13 from Bernhard Wiedemann
From my non-expert point of view the fact that downgrading
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c14
--- Comment #14 from Johannes Meixner
From my non-expert point of view the actual bug lies deeper.
I think it is perfectly valid when one free software project incorporates source code from another free software project. For example see Gnulib http://www.gnu.org/software/gnulib/ ----------------------------------------------------------------- Its components are intended to be shared at the source level, rather than being a library that gets built, installed, and linked against. ----------------------------------------------------------------- Therefore I think it is o.k. when Ghostscript incorporates lcms2 at the source level. Furthermore I think it is o.k. when a library is not thread-safe provided it is sufficiently documented so that developers know that they cannot "just use" it in multi-threaded programs. Finally I think it belongs to the developers of a program to ensure that their program runs correctly. In the end this means (from my non-expert point of view): - Ghostscript is o.k. to incorporate lcms2 at the source level. - liblcms2.so is o.k. to be not thread-safe. - Any multi-threaded program that likes to run Ghostscript and liblcms2.so in several threads, must ensure that it runs correctly. Therefore I think that such multi-threaded programs like Evince and LeechCraft Monocle would need to be fixed. For example a multi-threaded program may no longer run Ghostscript and liblcms2.so in several threads simultaneously but only one after the other to get the different lcms2 usages strictly separated. Alternatively a multi-threaded program could get the different lcms2 usages strictly separated by running Ghostscript and liblcms2.so in separated processes via fork() or it may use the clone() system call in a more appropriate way to get the threads better separated. But again: I am really neither an expert in lcms2 nor in linking nor in multi-threading environments so that all I can do here is basically only guesswork. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c15
--- Comment #15 from Johannes Meixner
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c16
Johannes Meixner
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c17
Johannes Meixner
From my corrent point of view this is the best what can be done from openSUSE to avoid the issue for now.
I close the issue as "upstream", see https://bugzilla.novell.com/page.cgi?id=fields.html#status -------------------------------------------------------------------- UPSTREAM The bug exists upstream. "Responsibility for a bug is said to lie upstream when it is not caused through the distribution's porting efforts." -------------------------------------------------------------------- This does neither mean one cannot add further comments here nor does it mean that I stop working on it. FYI: Currently I do some experimental work regarding the "libgs.so provides too many dynamic symbols" issue. Perhaps this leads to another way how to avoid the segfault... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c18
--- Comment #18 from Dmitriy Perlow
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c19
--- Comment #19 from Johannes Meixner
https://bugzilla.novell.com/show_bug.cgi?id=828751
https://bugzilla.novell.com/show_bug.cgi?id=828751#c20
--- Comment #20 from Dmitriy Perlow
Usually Ghostscript would initiate its built-in liblcms2 with its gs_lcms2_malloc plugin to tell it to use certain Ghostscript specific callbacks for memory allocation.
Currently I do not understand how the memory allocator plugin from Ghostscript was set in the liblcms2 which is called by Poppler.
Sure, but if Ghostscript hasn't changed naming of lcms2 symbols, then built-in lcms2 symbols would clash with system-wide lcms' ones, thus system-wide lcms2 would also use that same memory allocator.
could you check if after downgrading to lcms2 ver. 2.4 Poppler still calls gs_lcms2_malloc?
Should I just search for "malloc" in gdb output with lcms2.4? If no explain please what should I do? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com