[sane-devel] Epson 640U and sane1.0.18+cvs20061127-1

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Mon Jul 2 00:38:10 UTC 2007


Bjoern Daehn <bjoern at daehn-online.net> writes:

> Hello!
>
> Thanks for your response.
>
> I tried now setting "SANE_EPSON_CMD_LVL", but neither setting it to "D1" nor
> unsetting it helps. It is still throwing the  out-of-memory exception:
>
> [root at printserver root]$ SANE_DEBUG_EPSON=255 scanimage -L
> [snip]
> [epson] type    D 0x44
> [epson] level   1 0x31
> [epson] type    D 0x44
> [epson] level   1 0x31
> [epson] forced
> [epson] no option equipment installed
> [epson] out of memory (line 5959)
> ...
>
> Does that mean, that it is running out of RAM or out of memory on the
> scanner?

It's not a scanner issue.  It's something with the backend.
This is the code that triggers the message:

  s->hw->res_list_size = 0;
  s->hw->res_list =
    (SANE_Int *) calloc (s->hw->res_list_size, sizeof (SANE_Int));

  if (NULL == s->hw->res_list)
  {
    DBG (1, "out of memory (line %d)\n", __LINE__);
    return SANE_STATUS_NO_MEM;
  }

I'd be surprised if you run out of memory when trying to allocate zero
bytes (but can't rule it completely out because there may be a bit of
memory management going on behind the scenes).

IIRC, you run with 32MB of memory on MIPS hardware.  I have absolutely
zero experience on that platform.  What C library and which version
are you using?

Wild guess, but could it be that your calloc() short circuits when you
request zero bytes?

Hope this helps,


> On 28.06.2007 5:56 Uhr, "Olaf Meeuwissen" <olaf.meeuwissen at avasys.jp> wrote:
>
>> Bjoern Daehn <bjoern at daehn-online.net> writes:
>> 
>>> Hello!
>> 
>> Hello!
>> 
>>> I trying to use an EPSON 640U with sane 1.0.18+cvs20061127-1.
>>> 
>>> The platform is a WL500gp running Oleg¹s firmware (Linux 2.4.20/mips). I
>>> have sane-backend installed and ³scanner.o² module is recognizing the
>>> scanner:
>>> ...
>>> scanner.c: USB scanner device (0x04b8/0x010c) now attached to scanner0
>>> scanner.c: 0.4.16:USB Scanner Driver
>>> 
>>> sane-find-scanner  results:
>>> ...
>>> found USB scanner (vendor=0x04b8, product=0x010c) at /dev/usb/scanner0
>>> ...
>>> 
>>> Access rights to /dev/usb/scanner0 are fine ­ a ³SANE_DEBUG_EPSON='255'
>>> scanimage ­L² results:
>>> 
>>> [snip]
>>> [epson] type    D 0x44
>>> [epson] level   1 0x31
>>> [epson] type     0x00
>>> [epson] level   T 0x54
>>> [epson] forced
>> 
>> Hmm, this looks suspicious.  Have you set the SANE_EPSON_CMD_LVL
>> environment variable?  If so, unset it or set it to D1.  Somehow the
>> backend picks up a non-existent command level setting.  Looking at the
>> code (around line 5888) that only happens when that environment
>> variable is set.
>> 
>> Hope this helps,

-- 
Olaf Meeuwissen             FLOSS Engineer -- EPSON AVASYS Corporation
FSF Associate Member #1962           sign up at http://member.fsf.org/
GnuPG key: 6BE37D90/AB6B 0D1F 99E7 1BF5 EB97  976A 16C7 F27D 6BE3 7D90
Penguin's lib!       -- I hack, therefore I am --               LPIC-2



More information about the sane-devel mailing list