[sane-devel] Problems with testbackend and non-blocking IO

Henning Meier-Geinitz henning@meier-geinitz.de
Wed, 3 Apr 2002 21:12:58 +0200


Hi,

On Wed, Apr 03, 2002 at 05:31:35PM +0200, mh wrote:
> while playing with the test-backend I noticed a strange behaviour with the 
> non-blocking IO option enabled. E.g. a preview scan in xsane, gray/8bit, 
> testimage option enabled *sometimes* causes xsane to hang.

I get this everytime with both xsane and xscanimage. I talked about
this one some time ago with Oliver. The problem is, that both programs
assume that if non-blocking is supported, select_fd is also. But the
standard doesn't forbid to support only one of these functions.

> QuiteInsane ("the not yet released version") doesn't hang, but sometimes 
> returns an IO error. 

Please send me a debug log (SANE_DEBUG_TEST=255). Sounds like a
test backend problem. I remember that I gor an IO error with xsane one time
but I couldn't ever reproduce that.

> A preview scan (quiteinsane) in color mode/1bit, testimage option enabled 
> reveals another odd behaviour: the preview scan looks different with every 
> scan, i.e. sometimes the upper left corner isn't black. I don't change any 
> options; the debug output of the backend is exactly the same for all preview 
> scans. If I disable non-blocking IO, it works just fine.
> Did anyone else notice this?

If I set both non-blocking io and select_fd xscanimage preview works
in all modes. If I use only non-blocking it freezes. So the problem
seems to be with the non-blocking. Xsane produces all sorts of
interesting colors that change with every scan in 1 bit color. So this
mode is real fun :-/

> To Henning: If you like to test this, I can send you a patch for 
> quiteinsane-0.4.1. (~ 150 kB).

Yes, please.

Bye,
  Henning