[sane-devel] Out of memory in sanei_scsi_cmd [was: Annoying Out of MEmory Error...]
Hi Abel, As far as I can tell I'm issuing a sanei_scsi_cmd with a send buffer of ten bytes and a receive buffer of 130176 bytes. Both should fit into the SCSI buffer of 131072 bytes easily. is 130176 a typo, or does the backend really wants to read 4 bytes more than reserved? (or do I misunderstand something?) I could not find the the number 130176 anywhere else. No, it's not a typo, it's just a bit tricky to read :-) The buffer size is 131072 bytes, not 130172 bytes, so it's bigger than the requested 130176 bytes. I fell into the same trap when I first looked at the numbers :-) The 130176 bytes are taken from the snapscan source code and some part of the log which was missing in my mail, it's the effective buffer size rounded up to the next 128 bytes boundary: [snapscan] inquiry: effective buffer size = 130101 bytes, 37 lines This point aside, I don't have a really good hint, except that I have the impression that the Linux atp870u driver is not the best piece of code in the kernel. Maintainance of the driver was, at least some time ago, a bit unclear. Moreover, another user recently reported problems with this driver on the list; he could use his scanner fine after replacing the adapter with a properly supported one. Ok, I didn't know that. I'll try on linux-scsi and recommend another SCSI controller to the user reporting the bug. Thanks a lot for your input, Oliver
[sane-devel] Out of memory in sanei_scsi_cmd [was: Annoying Out of MEmory Error...]
Oliver, a user reported a problem with an Acer 620ST plugged into a Artop Electronic Corp AEC6712D SCSI controller (atp870u driver). The system causing problems is running linux-2.6.17-gentoo-r8, gcc 4.1.1 and glibc-2.4, sane-backends-1.0.18. On this system the following error occurs: ... [snapscan] open_scanner [sanei_debug] Setting debug level of sanei_scsi to 255. [sanei_scsi] sanei_scsi_open: SG driver version: 30533 [sanei_scsi] sanei_scsi_open_extended: using 131072 bytes as SCSI buffer [sanei_scsi] trying to enable low level command queueing [sanei_scsi] sanei_scsi_open: Host adapter queue depth: 1 [sanei_scsi] sanei_scsi_open: SG driver can change buffer size at run time [sanei_scsi] sanei_scsi_open: using new SG header structure [snapscan] sane_snapscan_open: waiting for scanner to warm up. [snapscan] wait_scanner_ready ... [snapscan] send [snapscan] snapscan_cmd [sanei_scsi] scsi_req_enter: entered 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 dev_max(currently)=32 max_active_device=1 (origin 1) def_reserved_size=32768 device=sg0 scsi1 chan=0 id=2 lun=0 em=0 sg_tablesize=128 excl=1 FD(1): timeout=12ms bufflen=131072 (res)sgat=4 low_dma=0 cmd_q=1 f_packid=0 k_orphan=0 closed=0 rb act: id=9 blen=1024 t_o/elap=12/8ms sgat=1 op=0x2a [sanei_scsi] scsi_req_enter: queue_used: 1, queue_max: 1 [sanei_scsi] sanei_scsi_req_wait: waiting for 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 dev_max(currently)=32 max_active_device=1 (origin 1) def_reserved_size=32768 device=sg0 scsi1 chan=0 id=2 lun=0 em=0 sg_tablesize=128 excl=1 FD(1): timeout=12ms bufflen=131072 (res)sgat=4 low_dma=0 cmd_q=1 f_packid=0 k_orphan=0 closed=0 rb rcv: id=9 blen=1024 dur=108ms sgat=1 op=0x2a [sanei_scsi] sanei_scsi_req_wait: read 64 bytes [snapscan] measure_transfer_rate: have ring buffer [snapscan] scsi_read [snapscan] snapscan_cmd [sanei_scsi] scsi_req_enter: entered 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 dev_max(currently)=32 max_active_device=1 (origin 1) def_reserved_size=32768 device=sg0 scsi1 chan=0 id=2 lun=0 em=0 sg_tablesize=128 excl=1 FD(1): timeout=12ms bufflen=131072 (res)sgat=4 low_dma=0 cmd_q=1 f_packid=0 k_orphan=0 closed=0 No requests active [sanei_scsi] sanei_scsi.issue: bad write (errno=12) Cannot allocate memory -1 [sanei_scsi] sanei_scsi.issue: SG_BIG_BUF inconsistency? Check file PROBLEMS. [sanei_scsi] scsi_req_enter: queue_used: 0, queue_max: 1 [sanei_scsi] sanei_scsi_req_wait: waiting for 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 [snapscan] scsi_read: snapscan_cmd command failed: Out of memory [snapscan] measure_transfer_rate: scsi_read command failed: Out of memory [snapscan] sane_snapscan_start: measure_transfer_rate command failed: Out of memory scanimage: sane_start: Out of memory ... As far as I can tell I'm issuing a sanei_scsi_cmd with a send buffer of ten bytes and a receive buffer of 130176 bytes. Both should fit into the SCSI buffer of 131072 bytes easily. is 130176 a typo, or does the backend really wants to read 4 bytes more than reserved? (or do I misunderstand something?) I could not find the the number 130176 anywhere else. This point aside, I don't have a really good hint, except that I have the impression that the Linux atp870u driver is not the best piece of code in the kernel. Maintainance of the driver was, at least some time ago, a bit unclear. Moreover, another user recently reported problems with this driver on the list; he could use his scanner fine after replacing the adapter with a properly supported one. To make matters even stranger, the same SCSI card and scanner works fine on Ubuntu 6.06 LTS, kernel: 2.6.15-23-386 gcc: GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5) glibc:2.3.6 sane-backends: 1.0.17 Does anybody of the experts have any idea what's going on? not really -- but I believe that it would be best to ask on the linux-scsi mailing list for help: To me, it looks like a problem of the driver or perhaps the kernel. But it might be easier for the user to simply replace the adapter with one supported by the aic7xxx driver or the sym83c5xx driver. They are available for a few Euro/Dollar on Ebay. Abel
[sane-devel] Out of memory in sanei_scsi_cmd [was: Annoying Out of MEmory Error...]
Hi SCSI experts, a user reported a problem with an Acer 620ST plugged into a Artop Electronic Corp AEC6712D SCSI controller (atp870u driver). The system causing problems is running linux-2.6.17-gentoo-r8, gcc 4.1.1 and glibc-2.4, sane-backends-1.0.18. On this system the following error occurs: ... [snapscan] open_scanner [sanei_debug] Setting debug level of sanei_scsi to 255. [sanei_scsi] sanei_scsi_open: SG driver version: 30533 [sanei_scsi] sanei_scsi_open_extended: using 131072 bytes as SCSI buffer [sanei_scsi] trying to enable low level command queueing [sanei_scsi] sanei_scsi_open: Host adapter queue depth: 1 [sanei_scsi] sanei_scsi_open: SG driver can change buffer size at run time [sanei_scsi] sanei_scsi_open: using new SG header structure [snapscan] sane_snapscan_open: waiting for scanner to warm up. [snapscan] wait_scanner_ready ... [snapscan] send [snapscan] snapscan_cmd [sanei_scsi] scsi_req_enter: entered 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 dev_max(currently)=32 max_active_device=1 (origin 1) def_reserved_size=32768 device=sg0 scsi1 chan=0 id=2 lun=0 em=0 sg_tablesize=128 excl=1 FD(1): timeout=12ms bufflen=131072 (res)sgat=4 low_dma=0 cmd_q=1 f_packid=0 k_orphan=0 closed=0 rb act: id=9 blen=1024 t_o/elap=12/8ms sgat=1 op=0x2a [sanei_scsi] scsi_req_enter: queue_used: 1, queue_max: 1 [sanei_scsi] sanei_scsi_req_wait: waiting for 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 dev_max(currently)=32 max_active_device=1 (origin 1) def_reserved_size=32768 device=sg0 scsi1 chan=0 id=2 lun=0 em=0 sg_tablesize=128 excl=1 FD(1): timeout=12ms bufflen=131072 (res)sgat=4 low_dma=0 cmd_q=1 f_packid=0 k_orphan=0 closed=0 rb rcv: id=9 blen=1024 dur=108ms sgat=1 op=0x2a [sanei_scsi] sanei_scsi_req_wait: read 64 bytes [snapscan] measure_transfer_rate: have ring buffer [snapscan] scsi_read [snapscan] snapscan_cmd [sanei_scsi] scsi_req_enter: entered 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 dev_max(currently)=32 max_active_device=1 (origin 1) def_reserved_size=32768 device=sg0 scsi1 chan=0 id=2 lun=0 em=0 sg_tablesize=128 excl=1 FD(1): timeout=12ms bufflen=131072 (res)sgat=4 low_dma=0 cmd_q=1 f_packid=0 k_orphan=0 closed=0 No requests active [sanei_scsi] sanei_scsi.issue: bad write (errno=12) Cannot allocate memory -1 [sanei_scsi] sanei_scsi.issue: SG_BIG_BUF inconsistency? Check file PROBLEMS. [sanei_scsi] scsi_req_enter: queue_used: 0, queue_max: 1 [sanei_scsi] sanei_scsi_req_wait: waiting for 0xb7c5e008 [sanei_scsi] sanei_scsi.issue: 0xb7c5e008 [snapscan] scsi_read: snapscan_cmd command failed: Out of memory [snapscan] measure_transfer_rate: scsi_read command failed: Out of memory [snapscan] sane_snapscan_start: measure_transfer_rate command failed: Out of memory scanimage: sane_start: Out of memory ... As far as I can tell I'm issuing a sanei_scsi_cmd with a send buffer of ten bytes and a receive buffer of 130176 bytes. Both should fit into the SCSI buffer of 131072 bytes easily. To make matters even stranger, the same SCSI card and scanner works fine on Ubuntu 6.06 LTS, kernel: 2.6.15-23-386 gcc: GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5) glibc:2.3.6 sane-backends: 1.0.17 Does anybody of the experts have any idea what's going on? Regards, Oliver