[sane-devel] avision: Out of memory (was: scanimage: sane_start: Out of memory)

abel deuring a.deuring@satzbau-gmbh.de
Tue, 04 Feb 2003 21:52:59 +0100


Henning Meier-Geinitz wrote:
> Hi,
> 
> On Mon, Feb 03, 2003 at 11:29:04AM +0100, Patrick Begou wrote:
> 
>>$ sane-find-scanner
>>found SCSI scanner "HP ScanJet 5370C 6.00" at /dev/scanner
>>found SCSI scanner "HP ScanJet 5370C 6.00" at /dev/sg2
>>found SCSI scanner "HP ScanJet 5370C 6.00" at /dev/sgc
[...]
>>I did this also. All seems to work fine  until get_calib_format wich
>>returns Out of Memory (see attached file).
>>I have 256 MBytes RAM and 128 Mbytes of (unused) swap but I dont't think
>>the problem is here. Something that the driver could not understand with
>>my software configuration ?
> 
> 
>>[avision] get_calib_data: type 62, size 167076, line_size: 167076
>>[avision] get_calib_data: read data failed (Out of memory)
> 
> 
> The backend tries to get 167076 bytes of data at once. Tht doesn't
> seem to work with the hp5300 driver (or your kernel). I think the
> default buffer size is 128k. 

Right. As I understand it, the 5370C uses some sort of USB/SCSI 
translation. sanei_scsi_req_enter2 (more precisely, the SG driver of the 
Linux kernel) can return "out of memory" errors. If a Sane frontend is 
run with SANE_DEBUG_SANEI_SCSI=255, a debug message like 
"sanei_scsi.issue: SG_BIG_BUF inconsistency?" should be printed. (which 
we should update, BTW. SG_BIG_BUF does not caused problems since quite 
some time.)

Anyway, the backend really should not try to send more data than 
suggested by sanei_scsi_max_request_size.

Abel