Error on Canon CanoScanLiDE20

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error on Canon CanoScanLiDE20

N9YTY

sane-find-scanner lists:

found USB scanner (vendor=0x04a9 [Canon], product=0x220d [CanoScan],  
chip=LM9832/3) at libusb:003:002-04a9-220d-ff-00

scanimage -L lists:

device `plustek:libusb:003:002-04a9-220d-ff-00' is a Canon N670U/
N676U/LiDE20 USB flatbed scanner
scanimage(12019) malloc: *** error for object 0x303fe0: double free
scanimage(12019) malloc: *** set a breakpoint in szone_error to debug

And if I attempt to scan a picture like so:

scanimage --format=tiff >test.tiff

I get this error, and the resulting file is a small portion of the  
picture:

scanimage(12020,0xa000ef98) malloc: *** error for object 0x304760:  
double free
scanimage(12020,0xa000ef98) malloc: *** set a breakpoint in  
szone_error to debug


Is this a known issue, or something unique perhaps to MacOS X ?

scanimage (sane-backends) 1.0.15-cvs; backend version 1.0.15
MacOS X 10.4.1

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Error on Canon CanoScanLiDE20

Gerhard Jäger
Hi,

On Wednesday 08 June 2005 18:35, Steven Palm wrote:

> sane-find-scanner lists:
>
> found USB scanner (vendor=0x04a9 [Canon], product=0x220d [CanoScan],
> chip=LM9832/3) at libusb:003:002-04a9-220d-ff-00
>
> scanimage -L lists:
>
> device `plustek:libusb:003:002-04a9-220d-ff-00' is a Canon N670U/
> N676U/LiDE20 USB flatbed scanner
> scanimage(12019) malloc: *** error for object 0x303fe0: double free
> scanimage(12019) malloc: *** set a breakpoint in szone_error to debug
>
> And if I attempt to scan a picture like so:
>
> scanimage --format=tiff >test.tiff
>
> I get this error, and the resulting file is a small portion of the
> picture:
>
> scanimage(12020,0xa000ef98) malloc: *** error for object 0x304760:
> double free
> scanimage(12020,0xa000ef98) malloc: *** set a breakpoint in
> szone_error to debug
>
> Is this a known issue, or something unique perhaps to MacOS X ?

In the meantime, it is ;)
Mattias Ellert already informed me about that issue, although it's
currently not clear, where it comes from.

> scanimage (sane-backends) 1.0.15-cvs; backend version 1.0.15
> MacOS X 10.4.1

Ciao,
Gerhard

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Error on Canon CanoScanLiDE20

N9YTY

On Jun 8, 2005, at 1:30 PM, Gerhard Jaeger wrote:
> On Wednesday 08 June 2005 18:35, Steven Palm wrote:
>
>> scanimage(12019) malloc: *** error for object 0x303fe0: double free
>> scanimage(12019) malloc: *** set a breakpoint in szone_error to debug

>>
>> Is this a known issue, or something unique perhaps to MacOS X ?
>>
>
> In the meantime, it is ;)
> Mattias Ellert already informed me about that issue, although it's
> currently not clear, where it comes from.

  Well, if I change the cleanup code for usbDevs in sane_exit() from:

     for( tmp = usbDevs;  tmp; tmp = usbDevs->next ) {
         free( usbDevs );
         usbDevs = tmp;
     }

  to:

     for( tmp = usbDevs;  tmp; ) {
         tmp = usbDevs->next;
         free( usbDevs );
         usbDevs = tmp;
     }

  It eliminates the double-free malloc error, so the backend runs  
cleanly without the error.

  However, instead of scanning the whole page I get just a small  
corner. I wonder if endian issues are at play here with the image  
size the scanner is told to scan?

  Steve

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Error on Canon CanoScanLiDE20

Steve Welsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>     for( tmp = usbDevs;  tmp; ) {
>         tmp = usbDevs->next;
>         free( usbDevs );
>         usbDevs = tmp;
>     }

should that not be
        tmp = usbDevs;
        while(tmp)  {
                ...
        }

??

Why use a for loop without an increment/decrement condition??

- --
Steve Welsh

/********************************************
You know, nostalgia is not what it used to be
********************************************/

Public Key http://www.stevew.net/public.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCp4Ff1teYsA+RuzIRAi1BAKCFlDt48T/oFBcqiHS6Hcu48Q2GLwCfeCKg
NCZBxzPx+h0TpsAXPjDzgmE=
=bbNm
-----END PGP SIGNATURE-----

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Error on Canon CanoScanLiDE20

Gerhard Jäger
In reply to this post by N9YTY
Hi,

On Wednesday 08 June 2005 21:46, Steven Palm wrote:

>
> On Jun 8, 2005, at 1:30 PM, Gerhard Jaeger wrote:
> > On Wednesday 08 June 2005 18:35, Steven Palm wrote:
> >
> >> scanimage(12019) malloc: *** error for object 0x303fe0: double free
> >> scanimage(12019) malloc: *** set a breakpoint in szone_error to debug
>
> >>
> >> Is this a known issue, or something unique perhaps to MacOS X ?
> >>
> >
> > In the meantime, it is ;)
> > Mattias Ellert already informed me about that issue, although it's
> > currently not clear, where it comes from.
>
>   Well, if I change the cleanup code for usbDevs in sane_exit() from:
>
>      for( tmp = usbDevs;  tmp; tmp = usbDevs->next ) {
>          free( usbDevs );
>          usbDevs = tmp;
>      }
>
>   to:
>
>      for( tmp = usbDevs;  tmp; ) {
>          tmp = usbDevs->next;
>          free( usbDevs );
>          usbDevs = tmp;
>      }
>
>   It eliminates the double-free malloc error, so the backend runs  
> cleanly without the error.

Hmmm, guess you are correct, as in my code, the address of usbDevs is
dereferenced after being freed :( That's done in the for() loop.
I also guess, that this is the cause of a long searched memory leak AND
highly system dependent, as here on my Linux box I couldn't trigger that.

The better code should be:
while( usbDevs ) {
        tmp = usbDevs->next;
        free(usbDevs);
        usbDevs = tmp;
}

I'll change that - thanks for investigating...

>
>   However, instead of scanning the whole page I get just a small  
> corner. I wonder if endian issues are at play here with the image  
> size the scanner is told to scan?

If you simply call scanimage to scan, the default vals will
be used and these are only some mm of the whole area...

Ciao,
Gerhard



--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]