Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 73618 - xsane dies with a glibc error when saving a captured image
Summary: xsane dies with a glibc error when saving a captured image
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Patrick Kursawe (RETIRED)
Depends on:
Reported: 2004-12-06 20:30 UTC by Alexander Hsia
Modified: 2004-12-13 00:07 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Hsia 2004-12-06 20:30:25 UTC
When I try to save an image captured by xsane, it exits immediately. When run from the command line, it leaves this cryptic message behind
*** glibc detected *** double free or corruption (!prev): 0x082fa880 *** 

Reproducible: Always
Steps to Reproduce:
1. Start xsane
2. Scan something (The only setting I have different than default is the resolution set to 300dpi)
3. After the image appears in a new window, save it using the menu system or the button. Give it filename and hit OK.

Actual Results:  
Xsane immediately exits (dies) as soon as the image is saved. The image is fine;
I can open it up in a viewer or gimp and it is in no way corrupted. If run from
the command line, it leaves this error message behind:
*** glibc detected *** double free or corruption (!prev): 0x082fa880 ***

Expected Results:  
Saved the image and remained resident for further input. 

#emerge info
Portage 2.0.51-r8 (default-linux/x86/2004.3, gcc-3.4.3, glibc-,
2.6.9-gentoo-r9 i686)
System uname: 2.6.9-gentoo-r9 i686 AMD Athlon(tm) processor
Gentoo Base System version 1.6.7
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Nov 11 2004, 03:23:16)]
distcc 2.18.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.3
sys-devel/libtool:   1.5.2-r7
CFLAGS="-march=athlon -O3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /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="-march=athlon -O3"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
USE="3dnow 3dnowex X a52 acl acpi acpi4linux aim alsa apm atlas avi
bash-completion berkdb bitmap-fonts blas bonobo c++ cairo cddb cdparanoia cdr
cdrom chroot clisp crypt cscope cups dio directfb divx4linux djbfft dnd dts dv
dvd dvdr dvdread eds encode erandom evms2 evo exif f77 faac faad fam fastcgi
fbcon ffmpeg fftw flac foomaticdb fortran freetype ftp gb gd gdbm gif gimp
gimpprint ginac gnome gnomedb gnuplot gphoto2 gpm gsl gstreamer gtk gtk2 gtkhtml
guile hal hbci hdf5 icq ieee1394 imagemagick imap imlib ipv6 irda jabber java
javascript jikes joystick jpeg junit kde lcms libg++ libwww lirc lufsusermount
mad maildir matroska mcal mikmod mime mmap mmx mmx2 mng motif mozilla mozsvg mp3
mpeg mpeg4 mpi mplayer mysql ncurses nls nptl nvidia odbc ofx oggvorbis openal
opengl opie oss pam pcre pda pdf pdflib perl pic plotutils png posix postgres
ppds python qt quicktime quotes readline rtc samba scanner sdl shared sharedmem
slang sndfile snortsam spamassassin spell sse ssl stroke svg svga tcltk tcpd
tetex theora tiff transcode truetype truetype-fonts usb v4l v4l2 vnc wmf x86 xfs
xine xinerama xml xml2 xmms xosd xrandr xsl xv xvid xvmc zlib"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-06 21:42:19 UTC
lu_zero/phosphan: please consider filling out your metadata.xml for this package with at least one of your details.
Comment 2 Patrick Kursawe (RETIRED) gentoo-dev 2004-12-06 23:02:19 UTC
Entered my data, but I would be happy if someone else took this.

Alexander: It would be nice to know which xsane version you tried to run.

The message indicates an error in xsane that should be fixed. As a workaround, you can make glibc ignore this error.


By default, the program that generated this error will also be killed;          
however, this (and whether or not an error message is generated) can be         
controlled via the MALLOC_CHECK_ environment variable. The following            
settings are supported:                                                         
    * 0 = Do not generate an error message, and do not kill the program         
    * 1 = Generate an error message, but do not kill the program                
    * 2 = Do not generate an error message, but kill the program                
    * 3 = Generate an error message and kill the program                      

Comment 3 Alexander Hsia 2004-12-07 00:41:50 UTC
Sure thing Patrick, 

I was trying to run xsane-0.96
I just tried setting the MALLOC_CHECK_ environment var to 0 and it worked! Nice to have a workaround. I guess my question now is, who do I send this upstream to? glibc people or Oliver, the maintainer of xsane. Or should I just wait and let it get pushed upstream after some more vetting in gentoo's bugzilla?

Thanks a million, (I really really hated having to restart xsane after every scan)
Comment 4 Patrick Kursawe (RETIRED) gentoo-dev 2004-12-07 02:27:19 UTC
This is no glibc but an xsane problem. I'll give the author a hint to check this bug. He can contact your for details, then if this is not a known problem.
Comment 5 Patrick Kursawe (RETIRED) gentoo-dev 2004-12-07 02:56:03 UTC
Alexander, please contact the author directly ( and don't forget to tell him in which file format you were trying to save.

Closing this as UPSTREAM.
Comment 6 Patrick Kursawe (RETIRED) gentoo-dev 2004-12-10 01:30:20 UTC
Could you perhaps try 0.96-r1 when it has hit your mirror and tell me if it solves the problem?
Comment 7 Patrick Kursawe (RETIRED) gentoo-dev 2004-12-10 01:31:16 UTC
Changing resolution to test-request
Comment 8 Alexander Hsia 2004-12-10 06:51:03 UTC
I've been in contact with Oliver. He thinks he has found the bug, and will send me a patch/diff to check it out. As it turns out, it was only the pnm file format that evoked this bug; but since that is the default save format, a lot of people would probably run into this.

I will try 0.96-r1 when I sync up today. And when Oliver sends me the patch, I'll test it too and forward here if it works.
Comment 9 Patrick Kursawe (RETIRED) gentoo-dev 2004-12-10 17:18:00 UTC
He told me to move two fclose() calls to another function. -r1 does exactly this.
Comment 10 Alexander Hsia 2004-12-12 22:22:22 UTC
Tried xsane-0.96-r1 and it works like a charm. No more crashing out with a glibc error
Comment 11 Patrick Kursawe (RETIRED) gentoo-dev 2004-12-13 00:07:21 UTC
Thanks for testing.