Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#5145 closed enhancement (fixed)

cups-filters-1.0.54

Reported by: Fernando de Oliveira Owned by: Fernando de Oliveira
Priority: normal Milestone: 7.6
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

Attachments (2)

cups-filters-1.0.54-pdftoraster_regression-1.patch (4.9 KB ) - added by Fernando de Oliveira 10 years ago.
converts pdftoraster.cxx to previous version
cups-filters-1.0.54-pdftoraster-1.patch (1.2 KB ) - added by Fernando de Oliveira 10 years ago.
Upstream fix to pdftoraster segfault

Download all attachments as: .zip

Change History (17)

comment:1 by Fernando de Oliveira, 10 years ago

Owner: changed from blfs-book@… to Fernando de Oliveira
Status: newassigned

comment:2 by Fernando de Oliveira, 10 years ago

I am having problem with this package. Build and install are apparentley OK.

However, pdftoraster is segfaulting. I have found old refernces to similar problem.

Current version on the book works fine.

I will spend some time searching for a fix, but cannot remember how to investigate a segfault error.

Any help would be much appreciated.

Log:

$ /usr/lib/cups/filter/pdftoraster 1 me '' 1 ''<pdftopdf.pdf >out.ras
DEBUG: mediaBox = [ 0.000000 0.000000 595.000000 842.000000 ]; rotate = 0
DEBUG: size = A4
Falha de segmentação [segmentation fault]

Log output from good version is the same, except for the segfault message.

comment:3 by Fernando de Oliveira, 10 years ago

I've got some output from gdb:

(gdb) run 1 me '' 1 ''<pdftopdf.pdf >out.ras
Starting program: /usr/lib/cups/filter/pdftoraster 1 me '' 1 ''<pdftopdf.pdf >out.ras
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
DEBUG: mediaBox = [ 0.000000 0.000000 595.000000 842.000000 ]; rotate = 0
DEBUG: size = A4

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0804b06b in writePageImage (pageNo=1, bitmap=0x8087f50, raster=0x8088cf0)
    at filter/pdftoraster.cxx:1556
#2  outPage (raster=<optimized out>, out=<optimized out>, 
    pageNo=<optimized out>, catalog=<optimized out>, doc=<optimized out>)
    at filter/pdftoraster.cxx:1735
#3  main (argc=6, argv=0xbffff2f4) at filter/pdftoraster.cxx:2005

comment:4 by Fernando de Oliveira, 10 years ago

Couldn't find anything in the net.

Desperate attempt: using pdftoraster.cxx from previous version worked.

This is equivalent to applying the attached patch.

Either wait for next version, use this patch, or:

can anyone analyze the patch to find what is the relevant part causing the regression?

by Fernando de Oliveira, 10 years ago

converts pdftoraster.cxx to previous version

comment:5 by Fernando de Oliveira, 10 years ago

I have just update my ArchLinux vm and now this same 1.0.54 version is installed. Indeed, pdftoraster is also segfaulting there. They apparently didn't notice.

I still cannot make up my mind to either waiting for next version or applying the patch reversing only pdftoraster to version 1.0.53. If applying the patch, the worst thing would be something in cups-filters not compatible with previous version, but chances are this would not happen, and anything needing it would fail, if upgrading but not using the patch.

comment:6 by Armin K, 10 years ago

I just tried to reproduce your problem and wasn't able. I used one of my pdf's and it completed just fine.

tarting program: /home/armin/src/cups-filters-1.0.54/.libs/pdftoraster 1 me '' 1 '' < /home/armin/Seminarski.pdf > out.ras
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
DEBUG: PPD file is not specified.
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
DEBUG: mediaBox = [ 0.000000 0.000000 595.276000 841.890000 ]; rotate = 0
[Inferior 1 (process 10694) exited normally]

Maybe there's something wrong with the pdf file you are trying to use? Try with some other and see if the error persists.

comment:7 by Fernando de Oliveira, 10 years ago

Thanks, Armin.

Following is with Arch (will test my dev system later).

We have progress, now.

First, let me tel that you are right, now I see not all pdf files triggers the problem.

However, all files I am using are from cups. cups-filters, gutenprint and ( I may be wrong in this last one) ghostscript, none is mine, which means either I am using a wrong command, or still there is a problem somewhere.

Now, let me describe how I can reproduce the error and then how to make it kind of work, thing that I only tried after your comment, where I noticed you did not use a PPD.

How to get the error:

export PPD=/etc/cups/ppd/Epson-Stylus-CX7300.ppd
/usr/lib/cups/filter/bannertopdf 1 me '' 1 '' </usr/share/cups/data/testprint >bannertopdf2.pdf
/usr/lib/cups/filter/pdftopdf 1 me '' 1 '' <bannertopdf2.pdf >pdftopdf.pdf
/usr/lib/cups/filter/pdftoraster 1 me '' 1 ''<pdftopdf.pdf >out.ras
Here, I get the segfault.

If I run

/usr/lib/cups/filter/rastertopdf 1 me '' 1 ''<out.ras >out.pdf

the resulting pdf is a black blank page.

Now, I do need a PPD for bannertopdf. Instead of exporting, I do the following:

PPD=/etc/cups/ppd/Epson-Stylus-CX7300.ppd \
/usr/lib/cups/filter/bannertopdf 1 me '' 1 '' </usr/share/cups/data/testprint >bannertopdf2.pdf
/usr/lib/cups/filter/pdftopdf 1 me '' 1 '' <bannertopdf2.pdf >pdftopdf.pdf
/usr/lib/cups/filter/pdftoraster 1 me '' 1 ''<pdftopdf.pdf >out.ras
Here, no segfault.

If I run

/usr/lib/cups/filter/rastertopdf 1 me '' 1 ''<out.ras >out.pdf

the resulting pdf is a BW page.
This is wrong, because bannertopdf2.pdf is RGB (I mean in color), not BW.

Now, it is happening to a ppd in ArchLinux, where I needed to upgrade the ppd, using cups-genppdupdate. But in (B)LFS it has just been generated from scratch, with latest or before the latest gutenprint.

Now it can also be a problem with the ppd for this printer only or for some Epsons, only, I don't know.

comment:8 by Fernando de Oliveira, 10 years ago

BTW, problems with thiese printing packages generating black blank pages and related to pdftoraster is known in older versions (IIRC, years 2012,2010). One of them was in launchpad (Ubuntu), and the dev told that it is not so bad, just convert to ps, and them do the other thingss after that...

If you can confirm that it is just in my case, I will be happy to update the package.

comment:9 by Fernando de Oliveira, 10 years ago

Armin, waht I meant is: if you confirm that it works for a different ppd, the I assume it is a particular problem, and will be happy (very happy, indeed) to update the page, I really want to close this ticket.

So, please, can you confirm?

comment:10 by Armin K, 10 years ago

I don't have any ppd's installed. I just ran the command from the cups-filters build tree (not even installed). I had previously built it with CFLAGS="-g -Og" CXXFLAGS="-g -Og". You can try that too, maybe the backtrace will get more helpful.

comment:11 by Fernando de Oliveira, 10 years ago

Three tests done, no success:

First reproduced tests I did with ArchLinux, yesterday, now with (B)LFS dev machine:

no improvement.

Second, added the flags suggest by Armin:

no improvement with gdb.

Third, after discussing with Armin, had the idea of adding a fake printer, just to create new PPD's. Used two, one from HP, one Generic:

no improvement.

Now I am going to search a bit more for this problem in the web.

Meanwhile, is it reasonable to update usong the patch I did that is equivalent to using new cups-filters with ol pdftoraster?

It is printing correctly, so I imagine "better with an older working pdftoraster than with a broken one", but would like to share with someone else the responsibility.

comment:12 by Armin K, 10 years ago

It's up to you to judge if you will revert the file to previous version or not. I would however report a bug too so it gets a proper fix.

comment:13 by Fernando de Oliveira, 10 years ago

Thanks, Armin,

I filed a bug report. Will wait a little further.

comment:14 by Fernando de Oliveira, 10 years ago

Resolution: fixed
Status: assignedclosed

Thank you very much again, Armin.

Bug was accepted and fixed, upstream, I include their fix.

Fixed at r13221.

by Fernando de Oliveira, 10 years ago

Upstream fix to pdftoraster segfault

comment:15 by Fernando de Oliveira, 10 years ago

I have attached the new patch with upstream fix, so if someone reaches this page, will have the solution here.

Note: See TracTickets for help on using tickets.