FS#18201 - [swftools] segmentation fault in pdf2swf

Attached to Project: Community Packages
Opened by Christian Mager (cm) - Saturday, 06 February 2010, 22:37 GMT
Last edited by Evangelos Foutras (foutrelis) - Saturday, 06 March 2010, 23:22 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jaroslav Lichtblau (Dragonlord)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I get segmentation fault when running the latest version of pdf2swf:

$ pdf2swf Test.pdf
NOTICE Output filename not given. Writing to Test.swf
NOTICE processing PDF page 1 (595x841:0:0) (move:0:0)
NOTICE File contains jpeg pictures
segmentation fault

$ pdf2swf --version
pdf2swf - part of swftools 0.9.0

i tried it with several options, but all segfaulted. I only see this problem on archlinux, other distros with self compiled version 0.9.0 are fine, so i dont think it's an upstream bug. if you need further information, let me know.
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Saturday, 06 March 2010, 23:22 GMT
Reason for closing:  None
Additional comments about closing:  Resolved with latest libjpeg (8a).
Comment by Christian Mager (cm) - Saturday, 06 February 2010, 22:46 GMT
dmesg gives me:
pdf2swf[5055]: segfault at 0 ip 00007f9cf704a700 sp 00007fff98c44df0 error 4 in libjpeg.so.8.0.0[7f9cf703e000+38000]
Comment by Thomas Dziedzic (tomd123) - Thursday, 11 February 2010, 23:28 GMT
Works for me. Using x86_64.

I used http://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/bibleref/sample.pdf

pdf2swf sample.pdf
NOTICE Output filename not given. Writing to sample.swf
NOTICE processing PDF page 1 (595x841:0:0) (move:0:0)
NOTICE processing PDF page 2 (595x841:0:0) (move:0:0)
NOTICE processing PDF page 3 (595x841:0:0) (move:0:0)
NOTICE processing PDF page 4 (595x841:0:0) (move:0:0)
NOTICE processing PDF page 5 (595x841:0:0) (move:0:0)
NOTICE Writing SWF file sample.swf

Please provide the Test.pdf file that you tried.
Comment by Rod Yager (yendor) - Sunday, 28 February 2010, 08:31 GMT
I also encountered this problem with libjpeg version 8. Downgrading to libjpeg version 7 resolved the issue for me. A source for version 7 is
http://www.ctan.org/tex-archive/support/ghostscript/3rdparty/
Comment by Thomas Dziedzic (tomd123) - Sunday, 28 February 2010, 16:43 GMT
If it doesn't work, please post the pdf that doesn't work for you. I can't reproduce the problems you're describing.
Comment by Rod Yager (yendor) - Sunday, 28 February 2010, 20:25 GMT
It segfaults on any file that contains a jpeg picture. I've attached an example.

The segmentation fault occurs at line 158 in the emit_dqt function in jcmarker.c in the source for libjpeg version 8. At this point qtbl->quantval is null.

This train of events is set in motion when pdf2swf calls jpeg_write_tables in the function swf_SetJPEGBitsStart at line 243 in swfbits.c It appears that the cinfo structure passed there contains an incomplete quant_tbl_ptrs structure.

As mentioned in my previous comment, this problem ONLY occurs with the latest version of libjpeg compiled from jpegsrc.v8.tar.gz
Comment by Ray Rashif (schivmeister) - Saturday, 06 March 2010, 18:55 GMT
Which very likely means it's an upstream jpeg issue, unless it hasn't been rebuilt since the major revisions.
Comment by Evangelos Foutras (foutrelis) - Saturday, 06 March 2010, 22:57 GMT
Can you confirm that this issue doesn't occur with the latest libjpeg (version 8a, package version 8.0.1)?
Comment by Rod Yager (yendor) - Saturday, 06 March 2010, 23:18 GMT
Yes. I can confirm that the issue doesn't occur with libjpeg versrion 8a.

Loading...