emerge -av =media-libs/netpbm-10.36.0 [ebuild U ] media-libs/netpbm-10.36.0 [10.34] USE="jpeg png xml zlib -svga -tiff" djpeg test.jpg | gocr -i - Segmentation fault emerge -av =media-libs/netpbm-10.34 [ebuild UD] media-libs/netpbm-10.34 [10.36.0] USE="jpeg png xml zlib -svga -tiff" djpeg test.jpg | gocr -i - ok Tried 0.39, 0.40-r2 and 0.41. Portage 2.1.2_pre2-r7 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.4-r4, 2.6.16 i686) ================================================================= System uname: 2.6.16 i686 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.12.5 Last Sync: Fri, 27 Oct 2006 17:50:01 +0000 ccache version 2.4 [disabled] app-admin/eselect-compiler: [Not Present] dev-java/java-config: [Not Present] dev-lang/python: 2.3.5-r3, 2.4.3-r4 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r4 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r1 ACCEPT_KEYWORDS="x86 ~x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CXXFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" USE="x86 3dnow 3dnowext X aac acl acpi alsa apache2 berkdb bitmap-fonts bzip2 caps cli cracklib crypt cscope devmap dlloader dts dvb dvd eds elibc_glibc emboss evms2 ffmpeg fftw flac fortran gd gdbm gif imap input_devices_keyboard input_devices_mouse isdnlog jpeg jpeg2k kde kernel_linux libg++ libwww lirc lirc_devices_mceusb2 lm_sensors mad mbox mmx mmxext mp3 mysql mythtv nagios-dns nagios-ntp nagios-ping nagios-ssh ncurses nls no-old-linux nptl nptlonly nvidia offensive ogg opengl pam pcre perl png pppd python readline reflection rtc samba sasl sdl sensord session slang spl sse sse2 ssl tcpd truetype-fonts type1-fonts udev userland_GNU video_cards_nvidia vorbis x264 xinerama xinetd xml xorg xv xvmc zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
Don't restrict bugs without any reason. Just leave the checkboxes alone.
Reopen with a backtrace: http://www.gentoo.org/proj/en/qa/backtraces.xml
Created attachment 100630 [details] backtrace # gdb /usr/bin/gocr GNU gdb 6.5 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) set args -i /usr/kde/3.5/share/wallpapers/blue-bend.jpg (gdb) run Starting program: /usr/bin/gocr -i /usr/kde/3.5/share/wallpapers/blue-bend.jpg Program received signal SIGSEGV, Segmentation fault. 0xb7f1c865 in pnm_readpaminit (file=0x80a2050, pamP=0xbff84688, size=304) at libpam.c:783 783 libpam.c: No such file or directory. in libpam.c (gdb) bt full #0 0xb7f1c865 in pnm_readpaminit (file=0x80a2050, pamP=0xbff84688, size=304) at libpam.c:783 No locals. #1 0x0809a8fe in readpgm (name=0xbff8bb53 "/usr/kde/3.5/share/wallpapers/blue-bend.jpg", p=0xbff84828, vvv=0) at pnm.c:139 fp = (FILE *) 0x80a2050 pip = 0x809f799 "djpeg -gray -pnm" magic1 = <value optimized out> magic2 = <value optimized out> i = <value optimized out> j = <value optimized out> sample = <value optimized out> minv = <value optimized out> maxv = <value optimized out> inpam = {size = 304, len = 304, file = 0x80a2050, format = 20533, plainformat = 0, height = 1024, width = 1280, depth = 1, maxval = 255, bytes_per_sample = 3086313584, tuple_type = "GRAYSCALE\000
Created attachment 100630 [details] backtrace # gdb /usr/bin/gocr GNU gdb 6.5 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) set args -i /usr/kde/3.5/share/wallpapers/blue-bend.jpg (gdb) run Starting program: /usr/bin/gocr -i /usr/kde/3.5/share/wallpapers/blue-bend.jpg Program received signal SIGSEGV, Segmentation fault. 0xb7f1c865 in pnm_readpaminit (file=0x80a2050, pamP=0xbff84688, size=304) at libpam.c:783 783 libpam.c: No such file or directory. in libpam.c (gdb) bt full #0 0xb7f1c865 in pnm_readpaminit (file=0x80a2050, pamP=0xbff84688, size=304) at libpam.c:783 No locals. #1 0x0809a8fe in readpgm (name=0xbff8bb53 "/usr/kde/3.5/share/wallpapers/blue-bend.jpg", p=0xbff84828, vvv=0) at pnm.c:139 fp = (FILE *) 0x80a2050 pip = 0x809f799 "djpeg -gray -pnm" magic1 = <value optimized out> magic2 = <value optimized out> i = <value optimized out> j = <value optimized out> sample = <value optimized out> minv = <value optimized out> maxv = <value optimized out> inpam = {size = 304, len = 304, file = 0x80a2050, format = 20533, plainformat = 0, height = 1024, width = 1280, depth = 1, maxval = 255, bytes_per_sample = 3086313584, tuple_type = "GRAYSCALE\000ô·`Gø¿ hõ·\002\000\000\000\b¬ó·\001\000\000\000\000\000\000\000\001", '\0' <repeats 39 times>, " Gø¿Àfõ·¡\207\004\b\000\000\000\001²\232«\a", '\0' <repeats 56 times>, "\204sä·\000\000\000\000Ä\231ä·\000\000\000\000\000\000\000\000ô\037ð·lúÞ·p¦ó·¼_õ·Àfõ·\001\000\000\000°Gø¿\031\203ô·phõ·\b¬ó·\001\000\000\000\001\000\000\000\000\000\000\000¡\207\004\b\032\000\000\000\000\000\000\000H\021\n\bp\000\000\000S»ø¿S»ø¿\000\000\000", allocation_depth = 0, comment_p = 0xb7f4d800} tuplerow = <value optimized out> __PRETTY_FUNCTION__ = "readpgm" #2 0x0809bd47 in main (argn=3, argv=0xbff8a994) at gocr.c:284 job = {src = {fname = 0xbff8bb53 "/usr/kde/3.5/share/wallpapers/blue-bend.jpg", p = {p = 0x0, x = 0, y = 0, bpp = 0}}, tmp = {init_time = { tv_sec = 0, tv_usec = 0}, ppo = {p = 0x0, x = 0, y = 0, bpp = 0}, n_run = 0, dblist = {header = 0x0, tail = 0x0, fix = 0x0, current = 0x0, n = 0, level = -1}}, res = {boxlist = {header = 0x0, tail = 0x0, fix = 0x0, current = 0x0, n = 0, level = -1}, linelist = {header = 0x0, tail = 0x0, fix = 0x0, current = 0x0, n = 0, level = -1}, lines = {num = 0, dy = 0, m1 = {0 <repeats 1024 times>}, m2 = {0 <repeats 1024 times>}, m3 = { 0 <repeats 1024 times>}, m4 = {0 <repeats 1024 times>}, x0 = {0 <repeats 1024 times>}, x1 = {0 <repeats 347 times>, -1210306560, -1074225544, -1208655940, -1210159044, -1208739426, -1210159044, 0, 68, 2066, 6, 139264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143360, 140976, 140976, 0, 5, 143360, 151552, 147516, 147584, 139264, 3, -1074225416, -1208685823, -1074224932, -1208739872, -1208655940, 0, -1208769568, -1074225472, -1208655940, -1208768288, 4, -1074225456, -1208685499, 8, 15, -1208655940, -1074225380, -1208724828, -1208767664, -1208768288, 15, 1, -1208964723, -1208768288, -1208708855, -1210294714, -1208768320, -1208655940, -1208768912, -1208973000, -1074224748, -1208733842, -1210294714, -1208964679, -1208769568, -1074225080, -1208737757, 6, -1210294714, 0, 0, -1208655872, 0, -1208654144, 0, -1208768272, -1208768928, 4, -1074225308, -1208685499, -1208964679, -1074225520, 10, -1208655872, -1074225568, -1074224968, 6, -1208964723, 3, -1074225372, -1208768272, -1074224964, -1074224912, -1208708855, -1210084384, -1208764888, -1208655940, -1208655104, -1074223796, -1074224592, -1208733842, -1208964719, -1210158976, 771, 0, -1208730161, -1074225544, -1210084384, 147584, 771, -1208655872, 0, 426081, 0, -1208768912, 0, 0, 0, 0, 0, 154476, 0, 4096, 312, 0, 1159808015, 0, -1208708855, -1208964713, -1208768320, -1208655940, -1208768912, -1208973000, -1074224456, -1208733842, -1208964713, -1208964679, -1208655940, 7, -1208769568, -1074224428, -1208964713, -1208768288, -1208769568, -1208655872, 0, -1074224452, 0, -1208769568, 426076, -1208675231, -1208655872, 0, -1208964679, 0, -1208769568, -1208653744, 17974396, 0, 6, -1210084370, 0, 10, -1208786815, 1154618950, 0, 6, -1208653744, 512, 1179403647, 65793, 0, 0, 196611, 1, 13296, 52, 153236, 0, 2097204, 2621450, 1966111, 6, 52, 52, 52, 320, 320...}}, avX = 5, avY = 8, sumX = 24641422, sumY = 0, numC = 0}, cfg = { cs = 0, spc = 0, mode = 0, dust_size = -1, only_numbers = 0, verbose = 0, out_format = ISO8859_1, lc = 0x809dc3e "_", db_path = 0x0, cfilter = 0x0}} (gdb)
Backtrace posted
Which test image did you use, so I can try to reproduce it?
(In reply to comment #5) > Which test image did you use, so I can try to reproduce it? It didn't seem to matter, I just chose a few at random from locate .jpg. As you can see in the backtrace I used /usr/kde/3.5/share/wallpapers/blue-bend.jpg for one of them. I was able to reproduce this on 3 different Gentoo installs.
I haven't been able to reproduce it with the same image file. netpbm: 10.36.0[14:08:12 10/08/06][-svga jpeg tiff png xml zlib] gocr: 0.41[20:01:43 09/07/06][gtk -doc] In your first comment, the emerge command says 'U', which means that you do not have netpbm-10.36.0 yet, are you sure that it is this version that you are having problems with?
(In reply to comment #7) > I haven't been able to reproduce it with the same image file. > netpbm: 10.36.0[14:08:12 10/08/06][-svga jpeg tiff png xml zlib] > gocr: 0.41[20:01:43 09/07/06][gtk -doc] > In your first comment, the emerge command says 'U', which means that you do not > have netpbm-10.36.0 yet, are you sure that it is this version that you are > having problems with? Yes, definitely. The following is all I did on a system without it installed to reproduce the error: ~ # echo "media-libs/netpbm ~x86" >> /etc/portage/package.keywords ~ # emerge -pv netpbm gocr [ebuild N ] media-libs/urt-3.1b-r1 USE="gif -X -gs -tiff" 0 kB [ebuild N ] media-libs/jbigkit-1.6-r1 0 kB [ebuild N ] media-libs/jasper-1.701.0 USE="jpeg -opengl" 0 kB [ebuild N ] media-libs/netpbm-10.36.0 USE="jpeg png xml zlib -svga -tiff" 0 kB [ebuild N ] app-text/gocr-0.40-r2 USE="-doc -gtk" 0 kB ~ # emerge netpbm gocr ~ # gocr -i /var/www/mail/themes/horde/graphics/mobile/display.jpg Segmentation fault
Then I can definitely not reproduce it, I'm afraid. I'll ask someone to try on an amd64 system. Can you provide a full log of emerging both netpbm and gocr and a fresh system, please?
(In reply to comment #9) > Then I can definitely not reproduce it, I'm afraid. I'll ask someone to try on > an amd64 system. > Can you provide a full log of emerging both netpbm and gocr and a fresh system, > please? None of my systems are running amd64, they're all i686. One is running stable with CFLAGS="-mtune=athlon-xp -O3 -pipe -fomit-frame-pointer". Another is running stable with CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer", and the last is running unstable also with CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
Created attachment 100766 [details] full log of netpbm and gocr emerge
Created attachment 100767 [details] full log of netpbm-10.36.0 and gocr emerge I just realized I had installed netpbm-10.34 for the previous log, so here's one with netpbm-10.36.0.
The bug is in gocr's readpgm function. It passes a not cleaned struct pam to netpbm. I'll attach a patch to gocr-0.41 (please see bug 145624 for another necessary patch if you want to bump the version).
Created attachment 102438 [details, diff] Fixes calls to pbpamread in netpbm with dangling pointers
Patch for 0.41 has been submitted to & confirmed accepted by upstream.
Part the patch to api/src/image.c doesn't appear to have been applied to gogr 0.42. Unfortunately CVS commits for gogr appear to be being done in chunks prior to each release so not sure whether it is applied or not. Might also be dead code too.
Can you still reproduce this w/ 0.43?
(In reply to comment #18) > Can you still reproduce this w/ 0.43? No, I just tried and it appears to be fixed. I reproduced the original problem first (with gocr-0.40-r2) and then upgraded to gocr-0.43 which then ran successfully without segfaulting.
(In reply to comment #19) > > Can you still reproduce this w/ 0.43? > No, I just tried and it appears to be fixed. Fixed then, just needs to be stabilized.
*** Bug 183553 has been marked as a duplicate of this bug. ***
Doesn't go anywhere, CCing arches.
AMD64: already tested (bug 183553), feel free to commit
amd64 done, thanks Simon
x86 stable
ppc was already stable.
Everyone but alpha has this stable; can we close this bug? trying to clear my bug list ;)