Problems with Prisa 620S [snapscan] + BUG in xsane 0.76

From: Ben Stanley (bds02@uow.edu.au)
Date: Mon May 21 2001 - 21:53:24 PDT

  • Next message: Pete Rossi: "Re: error compiling sane-backends-1.0.4"

    Hi,

    I've just got an Acer Prisa 620s, but I'm having trouble doing previews.

    xsane does a seg fault.

    My kernel is 2.4.4, SCSI card is Adaptec aha152x. using xsane 0.76.

    I've tried sane-backends-1.0.4 and the most recent cvs snapshot
    sane-cvs-2001-05-20.tar.gz. Both give quite similar results.

    I read the sane.ps API documentation, and by running xsane under a
    debugger it appears that the scanner is sending too much data. I added a
    check into xsane-preview.c, preview_increment_image_y, which checks if
    p->image_y >= p->image_height. If this is true, the buffer will be
    overrun. Perhaps this is legal on the last iteration in the read, but I
    think that a check of this kind needs to be made. Perhaps there is
    another place in the code where it would be more appropriate. At least
    my xsane reports an error now instead of seg faulting :-).

    BTW, a BUG in xsane in increment_image_y: if there is an error, and
    xsane_back_gtk_error is called, then preview_read_image_data will be
    called (by gtk io scheduler), resulting in a seg fault. It seems that
    calling preview_scan_done before calling xsane_back_gtk_error fixes this
    problem, although the value of errno must be saved before calling
    preview_scan_done() for use in generating the error message.

    Surprisingly, scanimage -L (or whatever the check program is) performed
    scan reads of different sizes and reported the correct amounts (for
    1.0.4 - didn't test the cvs version).

    I tried running saned with

    SANE_DEBUG_SNAPSCAN=255 ./saned -d255

    and redirecting the output. I checked the size inquiry before the scan
    data was read, and from the get_parameters call which occurs just after
    the scan started. It seems that these two are not returning the same
    number of lines. should they be? I can post log output if you want.

    I would probably get further with this if I could figure out how to get
    into snapscan.c with a debugger, but the shared library architecture has
    been conspiring against me in this respect. I have the idea of the
    source chain alright, but I want to poke about in it while it's in action.

    I'm a C++ programmer, and I find the C way of doing this stuff to be a
    bit 'messy' by comparison, but them's the breaks when you use other
    people's software.

    Any help appreciated.
    Ben.

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Mon May 21 2001 - 21:54:07 PDT