Bug 26668 - undefined symbol in ghostscript with pdf-images compressed via JBIG2
Summary: undefined symbol in ghostscript with pdf-images compressed via JBIG2
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard: MGA7-32-OK MGA7-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2020-05-22 13:30 CEST by Marc Krämer
Modified: 2020-06-11 00:58 CEST (History)
5 users (show)

See Also:
Source RPM: jbig2dec-0.18-1.mga7.src.rpm
CVE:
Status comment:


Attachments
PDF file showing the problem (56.00 KB, application/pdf)
2020-05-23 21:07 CEST, Lewis Smith
Details

Description Marc Krämer 2020-05-22 13:30:23 CEST
on converting a pdf in PDF 1.5 format I get:
/usr/bin/gs: symbol lookup error: /lib64/libgs.so.9: undefined symbol: jbig2_ctx_new

which looks like a compilation issue
Comment 1 Lewis Smith 2020-05-22 21:14:20 CEST
To re-create this fault, can you please clarify "converting a pdf in PDF 1.5 format": from, to, what?
If 'from', perhaps attach a small example of such a PDF. (I cannot find quickly how to specify the 1.5 for a PDF output).

CC: (none) => lewyssmith

Comment 2 Marc Krämer 2020-05-23 10:16:52 CEST
I use

/usr/bin/gs -dCompatibilityLevel=1.4 -q -sDEVICE=pdfwrite -dMaxSubsetPct=100 -sOutputFile="/tmp/out.pdf" -dNOPAUSE -dBATCH -dOptimize=true -dPrinted=false  57014#greyLow#PDF_21965.pdf

/usr/bin/gs: symbol lookup error: /lib64/libgs.so.9: undefined symbol: jbig2_ctx_new

this converts any pdf file to pdf 1.4 level and reduces some pictures in size, ..

this works for many pdfs but the attached one produces a symbol lookup failure.
Comment 3 Marc Krämer 2020-05-23 10:20:44 CEST
since upload is limited to 1M, you can find the pdf (1.1M) here
http://devel.mokraemer.de/test.pdf
(renamed)
Comment 4 Marc Krämer 2020-05-23 12:56:56 CEST
btw. /usr/bin/ps2pdf14 produces the same error
Comment 5 Lewis Smith 2020-05-23 21:07:33 CEST
Created attachment 11655 [details]
PDF file showing the problem

This is the first page only of Marc's example, which shows the error.
You do not have to use 'gs' directly on it as in his example command, but any 'ps2pdf' variant (straight, 12, 13, 14, they all use 'gs') throws it:
 $ ps2pdf ./test.pdf ./testy.pdf
/usr/bin/gs: symbol lookup error: /lib64/libgs.so.9: undefined symbol: jbig2_ctx_new
Comment 6 Lewis Smith 2020-05-23 21:35:50 CEST
[continued]
Thanks Marc for the sample problem file; and the ps2pdf.. pointer.

The 'ps2pdf|12|13|14' commands imply *PS* input, and when given such a file, work without the error.
Also, the commands work OK with other PDF input files. The command variant makes no difference. Confirmed in comment 2: "this works for many pdfs"

This suggests that there is something 'difficult' about Marc's example PDF file. Maybe it is because it is "in PDF 1.5 format", which I do not know that I have to try with.
------------------------------------------------------------------------
Stop press: found the RedHat bug in the URL field, which itself mentions
 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=940605

Ghostscript has no registered maintainer, so assigning this globally; CC'ing Stig as having done recent new versions.

Summary: undefined symbol in ghostscript => undefined symbol in ghostscript with some (?PDF 1.5?) input files
CC: lewyssmith => smelror
Assignee: bugsquad => pkg-bugs
URL: (none) => https://bugzilla.redhat.com/show_bug.cgi?id=1770160

Comment 7 Marc Krämer 2020-05-24 12:50:31 CEST
@Lewis: ps2pdf1[2-4] uses ps2pdfwr which uses gs and all of the can have pdf as input ;)

according to the bug report on debian this has to be fixed in jbig2dec which is maintained by neoclust; adding him to this bug.

CC: (none) => mageia

Comment 8 Marc Krämer 2020-05-24 12:51:44 CEST
@neoclust: can you check if this is a bug in the lib jbig2dec you maintain?
Comment 9 David GEIGER 2020-05-24 13:16:46 CEST
I just added a debian patch to restore ABI compatibility in jbig2dec, please test it!

If ok we have to fix mga7 too as it was updated to the same 0.18 release.

CC: (none) => geiger.david68210

Comment 10 Marc Krämer 2020-05-27 22:30:20 CEST
@David: what is it to test? Do we need to rebuild gs?
Are these packages in 7/updates_testing? Or in cauldron?
Comment 11 David GEIGER 2020-05-28 06:29:48 CEST
Not yet for mga7, I fixed jbig2dec with an upstream patch on Cauldron.
Comment 12 David GEIGER 2020-05-28 07:10:59 CEST
And now a patched jbig2dec in 7/Core/Updates_testing repo!
Comment 13 Marc Krämer 2020-05-28 12:21:55 CEST
Since the problem occurs in libgs.so.9, I assume we need a rebuild of ghostscript?

I pushed a new version in 7/updates too, so I can check it
Marc Krämer 2020-05-28 12:24:03 CEST

Summary: undefined symbol in ghostscript with some (?PDF 1.5?) input files => undefined symbol in ghostscript with pdf-images compressed via JBIG2

Comment 14 David Walser 2020-05-28 16:55:43 CEST
No, the fix David did for jbig2dec was supposed to make rebuilding Ghostscript unnecessary.
Comment 15 David Walser 2020-05-28 17:04:12 CEST
Advisory:
----------------------------------------

The jbig2dec package has been patched to fix an ABI breakage in the previous
update which caused ghostscript to crash.

References:
https://advisories.mageia.org/MGASA-2020-0213.html
----------------------------------------

Updated packages in core/updates_testing:
----------------------------------------
jbig2dec-0.18-1.1.mga7
libjbig2dec0-0.18-1.1.mga7
libjbig2dec-devel-0.18-1.1.mga7

from jbig2dec-0.18-1.1.mga7.src.rpm

Source RPM: ghostscript-9.27-1.4.mga7.src.rpm => jbig2dec-0.18-1.mga7.src.rpm
Assignee: pkg-bugs => qa-bugs

Comment 16 Marc Krämer 2020-05-28 19:04:41 CEST
sorry, missed updating libjbig2dec0. Updating jbig2dec did not require libjbig2dec0 to have the same version.
With libjbig2dec0 it works as expected.
David Walser 2020-05-29 22:43:43 CEST

Whiteboard: (none) => MGA7-32-OK

Comment 17 Thomas Andrews 2020-05-30 22:24:04 CEST
Tested with a 64-bit Plasma system, using the pdf attachment from above.

Before the update, the command ps2pdf14 produced the error message. Mageia Update only updated lib64jbig2dec0-0.18-1.1.mga7 and it updated cleanly. After the update, no error message.

OK for 64-bits. Validating. Advisory in Comment 15.

Whiteboard: MGA7-32-OK => MGA7-32-OK MGA7-64-OK
Keywords: (none) => validated_update
CC: (none) => andrewsfarm, sysadmin-bugs

Nicolas Lécureuil 2020-06-11 00:07:53 CEST

Keywords: (none) => advisory

Comment 18 Mageia Robot 2020-06-11 00:58:17 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2020-0142.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.