Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 135753 - Firefox 1.5.0.4 and Thunderbird 1.5.0.4 try to print Letter though A4 is configured
Summary: Firefox 1.5.0.4 and Thunderbird 1.5.0.4 try to print Letter though A4 is conf...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mozilla Gentoo Team
URL: http://bonsai.mozilla.org/cvsview2.cg...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-06 04:32 UTC by Stefan Schwarzer
Modified: 2013-04-11 23:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patched file (fixed PostScript header) (nsPostScriptObj.cpp,83.18 KB, text/x-c++src)
2006-06-17 13:53 UTC, Stefan Schwarzer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Schwarzer 2006-06-06 04:32:51 UTC
After upgrading from Firefox/Thunderbird 1.0.8 to 1.5.0.4, both programs try to print on Letter, though A4 is configured in CUPS, Firefox and Thunderbird. Printing from Adobe Reader or Epiphany (Gnome webbrowser) works without problems.

The upstream bug seems to be this one:
https://bugzilla.mozilla.org/show_bug.cgi?id=324635 .

It was fixed here:
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsPostScriptObj.cpp&branch=&root=/cvsroot&subdir=mozilla/gfx/src/ps&command=DIFF_FRAMESET&rev1=1.127&rev2=1.128
That change also removes my printing problem.

Though the patch is from 2006-04-29, it isn't included in the upstream source code of Firefox 1.5.0.4 and Thunderbird 1.5.0.4 which were released only a few days ago. The ebuilds for Firefox 1.0.8 and Thunderbird 1.0.8 are _not_ affected by this bug.

It would be nice if Gentoo could add a patch to the Firefox/Thunderbird 1.5.x ebuilds until the bug is actually fixed in the upstream releases. Note that other Mozilla products may also be affected by this bug but I only tested with Firefox and Thunderbird.

----------
Probably it doesn't matter for this report, but here's the emerge --info output:

Portage 2.0.54-r2 (default-linux/x86/2006.0, gcc-3.3.6, glibc-2.3.6-r3, 2.6.16-gentoo-r7 i686)
=================================================================
System uname: 2.6.16-gentoo-r7 i686 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.6.14
ccache version 2.3 [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/ghostscript/*/lib /usr/share/ghostscript/7.07/lib /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.uni-erlangen.de/pub/mirrors/gentooftp:// ftp.tu-clausthal.de/pub/linux/gentoo/"
LINGUAS="en de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage_overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X a52 aalib acl acpi alsa apache2 apm arts audiofile avi berkdb bitmap-fonts bonobo bzip2 cdr cli crypt cscope cups curl dbm dri dts dvd dvdr eds emboss encode esd evo exif expat fam ffmpeg flac foomaticdb fortran gd gdbm gif glut gnome gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hbci idn imagemagick imap imlib innodb ipv6 isdnlog java jpeg kde lcms ldap libcaca libg++ libwww mad maildir mailwrapper mcal mikmod mime mmap mmx mng motif mozilla mp3 mpeg mysql ncurses nls nptl ofx ogg opengl oss pam pcre pda pdflib perl png ppds pppd python qt quicktime readline recode reflection sasl scanner sdl session sharedmem slang spell spl sqlite sse sse2 ssl svg svga sysvipc tcltk tcpd tetex tidy tiff truetype truetype-fonts type1-fonts udev unicode usb vhosts vorbis win32codecs xine xinerama xml xml2 xmms xorg xpm xv xvid zlib video_cards_radeon linguas_en linguas_de userland_GNU kernel_linux elibc_glibc"
Unset:  CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS
Comment 1 Erol Kutay 2006-06-17 08:48:30 UTC
Stefan, how have you applied the patch? Didn't work for me, when editing nsPostScriptObj.cpp manually.
Comment 2 Stefan Schwarzer 2006-06-17 09:25:37 UTC
Hello Erol, what means "didn't work for me"? What have you done in which order? :-)

Indeed, getting Firefox emerged with the patch was somewhat of a hassle because I didn't get emerge to apply the patch (as usual from a diff) together with the other patches; my patch wasn't used at all. Eventually, I used the ebuild(1) command to unpack and patch the Firefox sources, patched manually and then continued to merge Firefox with the ebuild command.

For some reason I don't know, the same approach didn't work with Thunderbird. ebuild always unpacked the source anew after I had applied my patch. :-/ - I finally "persuaded" Thunderbird by copying /usr/lib/mozilla-firefox/components/libgfxps.so over /usr/lib/mozilla-thunderbird/components/libgfxps.so . That's probably not the cleanest way to do it, but so far it has worked. ;-)

If you are brave, you may instead edit the libgfxps.so file installed by "emerge thunderbird" with an "hex editor". That could work, because the fixed PostScript code is shorter than the former code. Just fill up with spaces until the buggy code is overwritten. (However, I don't know if there's a checksum or something like that will stop you from "patching" in this way.)

You see, all this funny stuff lets me looking forward to see this bug being fixed. :-)
Comment 3 Stefan Schwarzer 2006-06-17 09:29:29 UTC
Erol, another, maybe easier way, may be to build Firefox from source with ./configure and make (_not_ make install) and copying the resulting libgfxps.so into the library directory I noted in my previous comment. Ditto for Thunderbird.
Comment 4 Erol Kutay 2006-06-17 10:58:21 UTC
This is what I did: unpack source, edit nsPostScriptObj.cpp, packed again, rebuild digest and emerged again. But I haven't wrote the line 
"%%%%BeginFeature: *PageSize %s\n"
I recompile now. Btw. the patch doesn't work because it is for another file, I think.
Comment 5 Erol Kutay 2006-06-17 13:19:52 UTC
All didn't help. This is not my problem. Also found on another machine with a similar setup a 1.5.0.3 installation, with same problems but this source:

  // Tell the printer what size paper it should use
  fprintf(f,
    "/setpagedevice where\n"			// Test for the feature
    "{ pop 1 dict\n"				// Set up a dictionary
    "  dup /PageSize [ %s %s ] put\n"		// Paper dimensions
    "  setpagedevice\n"				// Install settings
    "} if\n", 
    fpCString(NSTwipsToFloatPoints(paper_width)).get(),
    fpCString(NSTwipsToFloatPoints(paper_height)).get());

I think this is your solution and unfortunately not mine.
Comment 6 Stefan Schwarzer 2006-06-17 13:51:17 UTC
(In reply to comment #5)
> All didn't help. This is not my problem. Also found on another machine with a
> similar setup a 1.5.0.3 installation, with same problems but this source:
> 
>   // Tell the printer what size paper it should use
>   fprintf(f,
>     "/setpagedevice where\n"                    // Test for the feature
>     "{ pop 1 dict\n"                            // Set up a dictionary
>     "  dup /PageSize [ %s %s ] put\n"           // Paper dimensions
>     "  setpagedevice\n"                         // Install settings
>     "} if\n", 
>     fpCString(NSTwipsToFloatPoints(paper_width)).get(),
>     fpCString(NSTwipsToFloatPoints(paper_height)).get());
> 
> I think this is your solution and unfortunately not mine.

I don't know if I understand you correctly. Are you sure that the actually running Firefox actually uses the source code you have listed? You can use strings(1) to peek into the library file /usr/lib/mozilla-firefox/components/libgfxps.so and see which PostScript header is used there. Anyway, I'll attach the _already patched_ file nsPostScriptObj.cpp which was indeed the fixed file upstream (see http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsPostScriptObj.cpp&branch=&root=/cvsroot&subdir=mozilla/gfx/src/ps&command=DIFF_FRAMESET&rev1=1.127&rev2=1.128 ).
Comment 7 Stefan Schwarzer 2006-06-17 13:53:11 UTC
Created attachment 89411 [details]
Patched file (fixed PostScript header)
Comment 8 Erol Kutay 2006-06-18 01:48:00 UTC
Yes, it does. Patched recompiled and so and so forth. The A4 problem disappeared, but not my problem. Nevertheless, I've fixed my problem too.
If you're interested, I've had a section in my $HOME/.fonts.conf, rejecting scalable fonts, causing a ghostscript exception. Thanks.
Comment 9 Erol Kutay 2006-06-21 09:55:25 UTC
I can meanwhile confirm, that on at least three machines the patch from firefox upstream has fixed the Letter vs A4 problem.

Forget about my /didn't work/ comments as I've run into another unrelated problem there.
Comment 10 Christian Marie (RETIRED) gentoo-dev 2006-12-25 06:09:18 UTC
Is this still a problem with 1.5.0.9?
Comment 11 Stefan Schwarzer 2006-12-28 07:28:52 UTC
The bug is still present for
www-client/mozilla-firefox/mozilla-firefox-1.5.0.9-r1.ebuild .

The fix I mentioned/attached seems to work.
Comment 12 Christian Marie (RETIRED) gentoo-dev 2007-01-10 16:14:09 UTC
Could you please reopen if it's still an issue with 2.0.0.1?
Comment 13 Stefan Schwarzer 2007-01-19 02:17:31 UTC
Yes, the bug is still in Firefox 2.0.0.1.
Comment 14 Raúl Porcel (RETIRED) gentoo-dev 2007-02-27 15:16:56 UTC
(In reply to comment #13)
> Yes, the bug is still in Firefox 2.0.0.1.
> 

Please report this upstream.
Comment 15 Juergen Rose 2013-04-11 15:52:55 UTC
Six years later I still suffer from these bug. Is there any chance that this bug will be solved?
Comment 16 Juergen Rose 2013-04-11 15:53:44 UTC
BTW. I am using now firefox-20.0.
Comment 17 Jory A. Pratt gentoo-dev 2013-04-11 23:06:12 UTC
(In reply to comment #16)
> BTW. I am using now firefox-20.0.

If you are still having issues with this, you need to open a bug for cairo, we use system cairo so that is where the bug will lie.