ESP Ghostscript 7.07.1-r8 +X +cups emerged on an AMD64 crashes on execution. Downgrading to version 7.05.6-r2 fixes the problem. The problem showed up as an inability to print, and cups didn't report any errors which would suggest that there was a problem with ghostscript. Cups said that it had printed just fine, but nothing came out. The cause (after a bit of futzing around) was the ghostscript executable. Reproducible: Always Steps to Reproduce: 1. Emerge ghostscript v 7.07.1-r8 2. Run gs in console Actual Results: gs returned the version information then a Segmentation Fault error. Expected Results: Opened up text based gs prompt. Running kernel 2.6.11-gentoo-r6 hardened.
Hi, the same problem has bitten me lately. It seems like it can be workaround'd by remerging using vanilla gcc profile. # gcc-config x86_64-pc-linux-gnu-3.4.3-vanilla # source /etc/profile # emerge -v ghostscript # gcc-config x86_64-pc-linux-gnu-3.4.3 BTW, I suspect the implicit PIE is the culprit as simply filtering -fstack-protector and -fstack-protector-all didn't work...
I'm sorry to forget to include information about my environment. Here is my 'emerge --info'. Please note that the SYNC variable here is pointing the local rsync mirror on our organization. It runs 'emerge --sync' once per day. Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3, glibc-2.3.4.20041102-r1, 2.6.11-hardened-r1 x86_64) ================================================================= System uname: 2.6.11-hardened-r1 x86_64 AMD Athlon(tm) 64 Processor 3200+ Gentoo Base System version 1.4.16 Python: dev-lang/python-2.3.4-r1 [2.3.4 (#1, May 13 2005, 22:43:30)] distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] dev-lang/python: 2.3.4-r1 sys-apps/sandbox: [Not Present] sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.5, 1.8.5-r3, 1.7.9-r1, 1.6.3, 1.4_p6, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r8 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.8.1-r4 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CFLAGS="-O2 -pipe -march=k8" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /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/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -pipe -march=k8" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox strict" GENTOO_MIRRORS="http://mirror.gentoo.gr.jp http://gentoo.gg3.net/ ftp://gg3.net/pub/linux/gentoo/ ftp://ftp.ecc.u-tokyo.ac.jp/GENTOO ftp://ftp.jaist.ac.jp/pub/os/Linux/Gentoo/ http://gentoo.channelx.biz/" LANG="ja_JP.UTF-8" LINGUAS="ja" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://stonewall.monolithworks.co.jp/gentoo-portage" USE="amd64 X accessibility acl acpi alsa berkdb bitmap-fonts cdr cjk crypt cups curl dvdr eds esd fam font-server fortran gdbm gif gnome gstreamer gtk gtk2 hal hardened hardenedphp imap imlib ipv6 jp2 jpeg justify lesstif libwww lzw lzw-tiff mad mbox memlimit mmap mng mozilla mp3 mysql ncurses nls nptl nptlonly ogg oggvorbis opengl oss pam perl pic png python readline samba sox ssl svg tcpd threads tiff truetype truetype-fonts type1-fonts unicode usb userlocales vorbis xml2 xmms xpm xprint xrandr xv zlib linguas_ja userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CBUILD, CTARGET, LC_ALL, LDFLAGS
OK, this happens on the Alpha architecture too. Using gdb shows a crash at igcref.c line 727. Here's the relevant stuff from gdb: (gdb) list 722 byte *pfree_u = (byte *)dest + sizeof(ref); 723 byte *pfree_a = ptr_align_round(pfree_u); 724 obj_header_t *pfree = (obj_header_t *)pfree_a; 725 int align = pfree_a - pfree_u; 726 727 pfree->o_alone = 0; 728 pfree->o_size = size - new_size - sizeof(obj_header_t) - align; 729 pfree->o_type = &st_bytes; 730 } 731 /* Re-create the final ref. */ (gdb) p *pfree Cannot access memory at address 0x20c9bd28 (gdb) p pfree_a $2 = (byte *) 0x20c9bd28 <Address 0x20c9bd28 out of bounds> (gdb) p pfree_u $3 = (byte *) 0x120c9bd28 "" Hey, wait a second! pfree_u is 0x120c9bd28 pfree_a is 0x20c9bd28 What happened to that leading digit? Hmmmm.... The culprit is in gxobj.h, starting at line 119: #define obj_align_round(siz)\ (uint)(((siz) + obj_align_mask) & -obj_align_mod) #define obj_size_round(siz)\ obj_align_round((siz) + sizeof(obj_header_t)) #define ptr_align_round(p)\ ((byte *)obj_align_round((size_t)(p))) obj_align_round assumes that a pointer can fit into a "uint", which certainly isn't the case on many 64-bit machines. Simply changing the "uint" to a "size_t" in line 120 fixes the problem. Patch on the way... Can someone with an AMD64 machine confirm that this patch fixes the problem? Can someone with an IA32 machine confirm that this patch still works for them?
Created attachment 60009 [details, diff] Patch to fix bug 89089 The code assumed that a pointer would fit into a 32-bit int. This isn't always the case, especially with 64-bit machines.
modify the patch to be to src/gxobj copy patch to files/ghostscripe-7.07.1-bug89089.patch add the following lines to the src_unpack() function in the ebuild # bug #89089 epatch ${FILESDIR}/ghostscript-${PV}-bug89089.patch ebuild ... digest and then emerge
Thanks a lot. This works for me on my amd64 with the app-text/ghostscript-7.07.1-r9.ebuild. # emerge info Portage 2.0.51.22-r1 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 2.6.11-gentoo-r6 x86_64) ================================================================= System uname: 2.6.11-gentoo-r6 x86_64 AMD Athlon(tm) 64 Processor 3200+ Gentoo Base System version 1.6.12 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.2.3-r5, 2.3.5, 2.4.1-r1 sys-apps/sandbox: 1.2.1-r3 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.18 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -O3 -ffast-math -funroll-all-loops -funit-at-a-time -fpeel-loops -ftracer -funswitch-loops" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-march=athlon64 -O3 -ffast-math -funroll-all-loops -funit-at-a-time -fpeel-loops -ftracer -funswitch-loops" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo" LINGUAS="de" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="amd64 X a52 acpi acpi4linux alsa apache2 arts artswrappersuid audiofile berkdb bitmap-fonts cdparanoia cdr crypt cups curl dga directfb doc dts dvb dvd dvdr dvdread faad fam fb fbcon ffmpeg flac font-server fortran freetype gd gdbm gif gimp gimpprint gpm gtk guile imagemagick imlib innodb ipv6 java jp2 jpeg junit kdeenablefinal libwww lzw lzw-tiff mad md5sum mikmod mime mp3 mssql mysql mysqli nas ncurses nls nvidia odbc offensive ogg opengl opie pam pda perl png python qt readline scanner sdl slang smime speex ssl tcltk tcpd tetex tiff transcode truetype truetype-fonts type1-fonts unicode usb userlocales vorbis wmf xine xml xml2 xmms xpm xrandr xv zeo zlib video_cards_nvidia linguas_de userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS
ghostscript-7.07.1-r9 fix this problems ? I don't have any of these problems in ghostcript-7.07.1-r8
7.07.1-r9 solves the problem on ~AMD64 ty!
I am experiencing this issue on my work system now, tried upgrading to ghostscript-7.07.1-r9 but I am still experiencing the same issues here. I can print the test page in cups but everything else fails as does previewing in the KDE print dialog - gs dies. Similar entries about gs aborting in the cups log. cryos ~ # emerge --info Portage 2.0.51.22-r2 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r1, 2.6.13-gentoo x86_64) ================================================================= System uname: 2.6.13-gentoo x86_64 AMD Athlon(tm) 64 Processor 3200+ Gentoo Base System version 1.12.0_pre6 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.12 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 sys-devel/binutils: 2.15.92.0.2-r2, 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=k8 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-march=k8 -O2 -pipe" DISTDIR="/mnt/gentoo/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig buildpkg ccache collision-protect cvs digest distlocks mutlilib-strict sandbox sfperms sign strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" LINGUAS="en_GB" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/mnt/gentoo/var/tmp/portage" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X aalib aim alsa apache2 arts audiofile avi bash-completion berkdb bitmap-fonts blas bonobo bootsplash bzlib cdparanoia cdr crypt cscope cups curl dbus directfb doc dvd dvdr dvdread eds encode esd ethereal evo fam fbcon fftw flac flash foomaticdb fortran gb gd gdbm ggi gif gimpprint ginac gmp gnome gphoto2 gpm graphviz gstreamer gtk gtk2 gtkhtml guile hal icq imagemagick imap imlib innodb ipv6 jabber java jikes joystick jpeg jpeg2k junit kde kdeenablefinal kerberos lcms ldap libg++ libwww lm_sensors lzw lzw-tiff mad mcal motif mp3 mpeg mpi msn mysql ncurses netcdf nls nptl nvidia octave odbc offensive ogg oggvorbis openexr opengl oscar pam pcre pdflib perl plotutils png postgres povray ppds python qt quicktime readline rtc ruby samba sasl scanner sdl snmp spell sqlite ssl svg tcltk tcpd tetex theora tiff truetype-fonts type1-fonts unicode usb vhosts videos vorbis wmf wxwindows xine xinerama xml xml2 xmms xpm xscreensaver xv xvid yahoo zeroconf zlib linguas_en_GB userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS
Emerging ghostscript-gnu-8.16 fixed this for me.
(In reply to comment #9) > I am experiencing this issue on my work system now, tried upgrading to > ghostscript-7.07.1-r9 but I am still experiencing the same issues here. I can > print the test page in cups but everything else fails as does previewing in > the KDE print dialog - gs dies. Similar entries about gs aborting in the cups > log. hum ... here's my emerge --info then Portage 2.0.51.22-r2 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r1, 2.6.12-gentoo-r4 x86_64) ================================================================= System uname: 2.6.12-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.6.13 dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -O3 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /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/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /usr/X11R6/bin/startx /etc/env.d" CXXFLAGS="-march=athlon64 -O3 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig candy distlocks sandbox severe sfperms strict test" GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://ftp.gentoo.mesh-solutions.com/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/" LANG="de_DE@euro" LC_ALL="de_DE@euro" LINGUAS="de" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="X a52 aac acpi alsa amd64 audiofile avi berkdb bitmap-fonts bzlib cdr crypt cups curl dbus dga directfb dlloader dmalloc dpms dts dvd dvdr dvdread eds emacs encode esd exif fam fame fat fbcon ffmpeg firefox flac foomaticdb fortran gdbm gif gimpprint gnome gpm gstreamer gtk gtk2 hal hardened howl imagemagick imlib ipv6 ithreads javascript jpeg jpeg2k kde lcms libsamplerate libwww lzo lzw lzw-tiff mad matroska memlimit mikmod mjpeg mmap mng mozcalendar mozdevelop mozsvg mp3 mpeg mpi ncurses nls nptl nptlonly ntfs nvidia ogg oggvorbis on-the-fly-crypt openal openexr opengl pam pda pdflib perl png ppds python qt quicktime readline real reiserfs sdl slang sndfile spell ssl svg symlink tcltk tcpd test tetex tga theora threads tidy tiff toolbar truetype truetype-fonts type1-fonts unicode usb userlocales videos vorbis wmf xine xml2 xmms xpm xprint xtermtoolbar xv xvid xvmc yv12 zlib linguas_de userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LDFLAGS, PORTDIR_OVERLAY
(In reply to comment #9) > 2.6.13-gentoo x86_64) > ================================================================= > System uname: 2.6.13-gentoo x86_64 AMD Athlon(tm) 64 Processor 3200+ You use kernel 2.6.13 ... atm thats not marked stable, right?!
(In reply to comment #12) > (In reply to comment #9) > > > 2.6.13-gentoo x86_64) > > ================================================================= > > System uname: 2.6.13-gentoo x86_64 AMD Athlon(tm) 64 Processor 3200+ > > You use kernel 2.6.13 ... atm thats not marked stable, right?! That is correct - I marked it ~amd64 yesterday I believe. Seems to be working just great aside from ghostscript breaking although I believe it was broken before upgrading kernels too. Will check if I get chance tomorrow - anyone else found that the new kernel causes this?
I'm running ghostscript-7.07.1-r9 fine on amd64 on 2.6.13, so that's likely not the issue. Marcus: Can you get a backtrace? Any particular steps you can run to reliably reproduce this, so I can try them?
I don't know how to get a backtrace of the gv process kicked off by cups, and at present have removed it in favour of ghostscript-gnu which is working perfectly. Also it works perfectly on my work system which has app-text/ghostscript-7.07.1-r8 and the new 2.6.13 gentoo-sources. All I had to do to reproduce it was print a web page from either firefox or konqueror. Either one would cause this issue. Tried upgrading, removing and then emerging and then gave up and tried ghostscript-gnu. Can emerge it again if there are any tests you want me to run - possibly some lib it is linking to that is messed up?
I seem to remember fixing the problem by getting rid of hardened (which is a PITA process). That fixed this problem as well as a problem with mplayer and a few others failing to compile. From memory you have to set USE=-hardened, then emerge -e system, and emerge -e world. You have to recompile gcc and glibc a couple of times to do it properly (I'm no expert in this).
I assume this is fixed with gs-esp-8.16 Stable users can try gs-gnu which is known working as bper comment #10
ghostscript-esp-8.15.1 is the most recent version - at least in packes.gentoo.org and: it seems to be fixed w/ 8.15.1 already atti@magic ~/.mplayer $ gs ESP Ghostscript 815.01 (2005-09-22) Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. GS> atti@magic ~/.mplayer $