[sane-devel] SEGFAULT in sanei_scsi_close()

abel deuring a.deuring@satzbau-gmbh.de
Tue, 25 Dec 2001 12:30:15 +0100

Karl Heinz Kremer wrote:
> I am trying to debug a problem with the EPSN backend. Whenever
> the backend is running in batch mode to scan via the ADF, the
> frontend will crash with a segmentation fault in sanei_scsi_close().
> The reason seems to be that one for the free list elements is not
> valid, and when the next pointer is referenced, the software goes
> down:
>       req = ((fdparms*) fd_info[fd].pdata)->sane_free_list;
>       while (req)
>         {
> ->        next_req = req->next;
>           free(req);
>           req = next_req;
>         }
> Has anybody seen this before? Is this something that could be
> cause by how I am using the sanei_scsi functions?


I don't believe that it's possible to "misuse" the sanei_scsi functions.
Either you discovered a really nasty bug, or... could it be that backend
calls sanei_scsi_close twice for the same file?