[sane-devel] [dev] net backend and timing problems? (pretty weird)

mh crapsite@gmx.net
Thu, 6 Sep 2001 12:34:19 +0200

Hi all,
when I try to scan over saned (localhost) using the net/plustek backend, the
frontend crashes with a bt like this:

Program received signal SIGPIPE, Broken pipe.
0x403f7004 in write () from /lib/libc.so.6
(gdb) bt
#0  0x403f7004 in write () from /lib/libc.so.6
#1  0x404a6408 in __DTOR_END__ () from /usr/local/lib/sane/libsane-net.so.1
#2  0x404a45ca in flush (w=0x810f164) at sanei_wire.c:345
#3  0x404a4614 in sanei_w_set_dir () at sanei_wire.c:345
#4  0x404a468b in sanei_w_call () at sanei_wire.c:345

(tested with xsane and quiteinsane, SANE 1.0.5)

This crash occurs after the scanner has returned to it's start position.

Now the weird part of the story:

If I modify the net backend (~ line 268, net.c) like this,

static SANE_Status
do_cancel (Net_Scanner * s)
  sleep(3); /* <--- add this line */
  s->hw->auth_active = 0;
  if (s->data >= 0)
      close (s->data);
      s->data = -1;

then everything seems to work fine. The scanner returns to the start position,
the whole stuff freezes for 3 seconds, but i don't get a SIGPIPE.
Now it's possible, that my old hardware simply needs some sleep from time to
time :-)
However, I hope, that someone might have an idea what's really going on ?

Thanks for any hint