[sane-devel] Fujitsu M3091DCd scanner: scanadf: invalid argument

Dave Webb dave.webb8211 at googlemail.com
Tue Nov 1 10:59:38 UTC 2011


I tried to compile the Debian packages from Wheezy (on my freshly
installed Squeeze distribution, with your patch) which seems to solve
this issue. You can find my steps in what-i-did-sane.txt and is for my
own reference.

I'm now able to scan simplex (source ADF Front). Thank you very much!

But ... now scanadf crashes when scanning duplex:

user at alpha:~$ SANE_DEBUG_FUJITSU=128 scanadf -d fujitsu --source 'ADF
Duplex' --mode Gray --resolution 300 -x 210 -y 297 -o scan-%04d.pnm 2>
dbg
*** glibc detected *** scanadf: munmap_chunk(): invalid pointer:
0x0000000000fd49a0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x71ad6)[0x7f53cb031ad6]
/usr/lib/x86_64-linux-gnu/sane/libsane-fujitsu.so.1(sane_fujitsu_read+0x6d4)[0x7f53caba83c4]
scanadf[0x402708]
scanadf[0x4042f3]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f53cafdec4d]
scanadf[0x401469]

# What's installed:
root at alpha:/home/user# dpkg -l | grep sane
ii  libsane                              1.0.22-6
   API library for scanners
ii  libsane-common                       1.0.22-6
   API library for scanners -- documentation and support files
ii  libsane-dev                          1.0.22-6
   API development library for scanners [development files]
ii  libsane-extras                       1.0.22.2
   API library for scanners -- extra backends
ii  libsane-extras-common                1.0.22.2
   API library for scanners -- documentation and support files
rc  libsane-hpaio                        3.10.6-2
   HP SANE backend for multi-function peripherals
ii  sane                                 1.0.14-9
   scanner graphical frontends
ii  sane-utils                           1.0.22-6
   API library for scanners -- utilities
rc  xsane                                0.997-2+b1
   featureful graphical frontend for SANE (Scanner Access Now Easy)

root at alpha:/home/user# dpkg -l | grep libc6
ii  libc6                                2.11.2-10
   Embedded GNU C Library: Shared libraries
ii  libc6-dev                            2.11.2-10
   Embedded GNU C Library: Development Libraries and Header Files
ii  libc6-i386                           2.11.2-10
   Embedded GNU C Library: 32-bit shared libraries for AMD64

I'm not able to attache the full backtrace at debug level 128 because
its too big. The largest debug level which produces a filesize <
100KiB when gzipped is 28.

If you need more debugging information I'm willing to help.

Kind regards

Dave Webb
-------------- next part --------------
# Add source files of wheezy in /etc/apt/sources and
apt-get update

# remove old stuff
apt-get remove libsane* sane*

# satisfy build dependencies
apt-get -t wheezy install debhelper
apt-get           install multiarch-support acl

# build the version from Debian Wheezy to check that compiling works and the patch does not introduce new errors. 
apt-get -t wheezy -b source libsane-dev    
apt-get -t wheezy -b source libsane-extras 

# apply patch from mail
cd sane-backends-1.0.22/
nano backend/fujitsu.c

# compile again using dpkg-buildpackage
dpkg-buildpackage -j8 -b -uc

# and install (the _freshly_ generated package)
cd ..
ls -lsha *.deb 
dpkg -i libsane_1.0.22-6_amd64.deb libsane-common_1.0.22-6_amd64.deb libsane-extras_1.0.22.2_amd64.deb libsane-extras-common_1.0.22.2_amd64.deb sane-utils_1.0.22-6_amd64.deb libsane-dev_1.0.22-6_amd64.deb

# build and install sane from source
apt-get -t wheezy -b source sane
dpkg -i sane_1.0.14-9_amd64.deb 

# test
sane-find-scanner

### works
user at alpha:~$ scanadf -d fujitsu --source 'ADF Front' --mode Gray --resolution 300 -x 210 -y 297 -o scan-%04d.pnm
scanadf: rounded value of br-x from 210 to 210.01
scanadf: rounded value of br-y from 297 to 279.364
Scanned document scan-0001.pnm
Scanned 1 pages

### crashes, dbg is attached separately

user at alpha:~$ SANE_DEBUG_FUJITSU=128 scanadf -d fujitsu --source 'ADF Duplex' --mode Gray --resolution 300 -x 210 -y 297 -o scan-%04d.pnm 2> dbg
*** glibc detected *** scanadf: munmap_chunk(): invalid pointer: 0x0000000000fd49a0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x71ad6)[0x7f53cb031ad6]
/usr/lib/x86_64-linux-gnu/sane/libsane-fujitsu.so.1(sane_fujitsu_read+0x6d4)[0x7f53caba83c4]
scanadf[0x402708]
scanadf[0x4042f3]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f53cafdec4d]
scanadf[0x401469]
======= Memory map: ========
00400000-00406000 r-xp 00000000 08:01 450986                             /usr/bin/scanadf
00606000-00607000 rw-p 00006000 08:01 450986                             /usr/bin/scanadf
00607000-00615000 rw-p 00000000 00:00 0 
00f9f000-00ff5000 rw-p 00000000 00:00 0                                  [heap]
7f53c9fa3000-7f53c9fb9000 r-xp 00000000 08:01 408841                     /lib/libgcc_s.so.1
7f53c9fb9000-7f53ca1b8000 ---p 00016000 08:01 408841                     /lib/libgcc_s.so.1
7f53ca1b8000-7f53ca1b9000 rw-p 00015000 08:01 408841                     /lib/libgcc_s.so.1
7f53ca1b9000-7f53ca988000 rw-p 00000000 00:00 0 
7f53ca988000-7f53ca98f000 r-xp 00000000 08:01 409089                     /lib/libusb-0.1.so.4.4.4
7f53ca98f000-7f53cab8e000 ---p 00007000 08:01 409089                     /lib/libusb-0.1.so.4.4.4
7f53cab8e000-7f53cab90000 rw-p 00006000 08:01 409089                     /lib/libusb-0.1.so.4.4.4
7f53cab90000-7f53cabb9000 r-xp 00000000 08:01 902697                     /usr/lib/x86_64-linux-gnu/sane/libsane-fujitsu.so.1.0.22
7f53cabb9000-7f53cadb9000 ---p 00029000 08:01 902697                     /usr/lib/x86_64-linux-gnu/sane/libsane-fujitsu.so.1.0.22
7f53cadb9000-7f53cadba000 rw-p 00029000 08:01 902697                     /usr/lib/x86_64-linux-gnu/sane/libsane-fujitsu.so.1.0.22
7f53cadba000-7f53cadbc000 rw-p 00000000 00:00 0 
7f53cadbc000-7f53cadbe000 r-xp 00000000 08:01 408824                     /lib/libdl-2.11.2.so
7f53cadbe000-7f53cafbe000 ---p 00002000 08:01 408824                     /lib/libdl-2.11.2.so
7f53cafbe000-7f53cafbf000 r--p 00002000 08:01 408824                     /lib/libdl-2.11.2.so
7f53cafbf000-7f53cafc0000 rw-p 00003000 08:01 408824                     /lib/libdl-2.11.2.so
7f53cafc0000-7f53cb118000 r-xp 00000000 08:01 408825                     /lib/libc-2.11.2.so
7f53cb118000-7f53cb317000 ---p 00158000 08:01 408825                     /lib/libc-2.11.2.so
7f53cb317000-7f53cb31b000 r--p 00157000 08:01 408825                     /lib/libc-2.11.2.so
7f53cb31b000-7f53cb31c000 rw-p 0015b000 08:01 408825                     /lib/libc-2.11.2.so
7f53cb31c000-7f53cb321000 rw-p 00000000 00:00 0 
7f53cb321000-7f53cb328000 r-xp 00000000 08:01 885981                     /usr/lib/x86_64-linux-gnu/libsane.so.1.0.22
7f53cb328000-7f53cb527000 ---p 00007000 08:01 885981                     /usr/lib/x86_64-linux-gnu/libsane.so.1.0.22
7f53cb527000-7f53cb528000 rw-p 00006000 08:01 885981                     /usr/lib/x86_64-linux-gnu/libsane.so.1.0.22
7f53cb528000-7f53cb5a8000 r-xp 00000000 08:01 408834                     /lib/libm-2.11.2.so
7f53cb5a8000-7f53cb7a8000 ---p 00080000 08:01 408834                     /lib/libm-2.11.2.so
7f53cb7a8000-7f53cb7a9000 r--p 00080000 08:01 408834                     /lib/libm-2.11.2.so
7f53cb7a9000-7f53cb7aa000 rw-p 00081000 08:01 408834                     /lib/libm-2.11.2.so
7f53cb7aa000-7f53cb7c8000 r-xp 00000000 08:01 408837                     /lib/ld-2.11.2.so
7f53cb9b1000-7f53cb9b5000 rw-p 00000000 00:00 0 
7f53cb9c4000-7f53cb9c7000 rw-p 00000000 00:00 0 
7f53cb9c7000-7f53cb9c8000 r--p 0001d000 08:01 408837                     /lib/ld-2.11.2.so
7f53cb9c8000-7f53cb9c9000 rw-p 0001e000 08:01 408837                     /lib/ld-2.11.2.so
7f53cb9c9000-7f53cb9ca000 rw-p 00000000 00:00 0 
7fffbbc96000-7fffbbcab000 rw-p 00000000 00:00 0                          [stack]
7fffbbd90000-7fffbbd91000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted


# What's installed:
root at alpha:/home/user# dpkg -l | grep sane
ii  libsane                              1.0.22-6                          API library for scanners
ii  libsane-common                       1.0.22-6                          API library for scanners -- documentation and support files
ii  libsane-dev                          1.0.22-6                          API development library for scanners [development files]
ii  libsane-extras                       1.0.22.2                          API library for scanners -- extra backends
ii  libsane-extras-common                1.0.22.2                          API library for scanners -- documentation and support files
rc  libsane-hpaio                        3.10.6-2                          HP SANE backend for multi-function peripherals
ii  sane                                 1.0.14-9                          scanner graphical frontends
ii  sane-utils                           1.0.22-6                          API library for scanners -- utilities
rc  xsane                                0.997-2+b1                        featureful graphical frontend for SANE (Scanner Access Now Easy)

root at alpha:/home/user# dpkg -l | grep libc6
ii  libc6                                2.11.2-10                         Embedded GNU C Library: Shared libraries
ii  libc6-dev                            2.11.2-10                         Embedded GNU C Library: Development Libraries and Header Files
ii  libc6-i386                           2.11.2-10                         Embedded GNU C Library: 32-bit shared libraries for AMD64
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbg28.gz
Type: application/x-gzip
Size: 3126 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20111101/c8b8033f/attachment.bin>


More information about the sane-devel mailing list