[sane-devel] First version of the new test backend released

mh crapsite@gmx.net
Mon, 1 Apr 2002 17:11:03 +0200


Henning Meier-Geinitz, Montag, 1. April 2002 13:56:
> Hi,
>
> On Sun, Mar 31, 2002 at 10:21:06PM +0200, mh wrote:
> > One remark:
> > You allow a three-pass/handscanner simulation in color mode with a bit
> > depth of 1 (which crashes xsane and xscanimage and lets quiteinsane loop
> > forever).
>
> I can't reproduce this with xsane 0.84 in viewer mode. The scanned
> image is wrong (if it's not completely black) but it doesn't crash
> even if I enable both three-pass and hand-scanner simulation.
> When scanning the preview it complains that it can't handle bit
> depth 8 :-)

Sorry, forgot to mention, that the crash happens when I scan a preview (xsane 
0.84/xscanimage from sane-frontends 1.0.7; three-pass *and* hand-held, color 
mode, 1 bit; see bt at the end of this mail)
...
> hand-scanner and three-pass together probably won't be found in the
> wild. But again, I think it's allowed by the SANE standard as long as
> the frames stay the same size.
>
> There may be a bug in the test backend especially in the 1-bit RGB
> mode. I can't really test this mode because no frondend seems to
> really support it :-)

> Can you try to locate the position in the test backend where it loops
> or breaks (SANE_DEBUG_TEST=255)?

The looping problem was obviously caused by the latest (not yet released) 
version of quiteinsane, but the preview crash is reproducable for me; at 
least with xsane. xscanimage sometimes displays something in the preview 
window. In this case, the next action (e.g. adjusting an option or doing 
another scan) results in a crash.

Michael

bt xsane:
0x08060e7c in preview_read_image_data (data=0x8175860, source=-1,
    cond=GDK_INPUT_READ) at xsane-preview.c:1709
1709                        p->image_data_enh[p->image_offset++] = gl;
(gdb) bt
#0  0x08060e7c in preview_read_image_data (data=0x8175860, source=-1,
    cond=GDK_INPUT_READ) at xsane-preview.c:1709
#1  0x08061e3d in preview_scan_start (p=0x8175860) at xsane-preview.c:2124
#2  0x08066e69 in preview_scan (p=0x8175860) at xsane-preview.c:4104
#3  0x080648ff in preview_start_button_clicked (widget=0x81785c0,
    data=0x8175860) at xsane-preview.c:3301
#4  0x401613c3 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0

bt xscanimage:
Program received signal SIGSEGV, Segmentation fault.
0x403a2abd in chunk_free () from /lib/libc.so.6
(gdb) bt
#0  0x403a2abd in chunk_free () from /lib/libc.so.6
#1  0x403a278a in chunk_alloc () from /lib/libc.so.6
#2  0x403a31cb in chunk_realloc () from /lib/libc.so.6
#3  0x403a2ed4 in realloc () from /lib/libc.so.6
#4  0x08050dbd in increment_image_y (p=0x80bf208) at preview.c:514
#5  0x080510f5 in input_available (data=0x80bf208, source=-1,
    cond=GDK_INPUT_READ) at preview.c:645
#6  0x08051680 in scan_start (p=0x80bf208) at preview.c:803
#7  0x080529d5 in preview_scan (p=0x80bf208) at preview.c:1321
#8  0x08051c72 in start_button_clicked (widget=0x80b1ed0, data=0x80bf208)
    at preview.c:994
#9  0x400d93c3 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0
#10 0x4010b268 in gtk_handlers_run () from /usr/lib/libgtk-1.2.so.0
#11 0x4010a63f in gtk_signal_real_emit () from /usr/lib/libgtk-1.2.so.0
#12 0x40108597 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0

last words from test backend (preview with xsane)
[test] sane_control_option: set option 7 (resolution) to 27 dpi
[test] sane_control_option: finished, info= reload_parameters
[test] sane_start: handle=0x8112d28
[test] sane_get_parameters: handle=0x8112d28, params=(nil)
[test] sane_get_parameters: format=red
[test] sane_get_parameters: last_frame=false
[test] sane_get_parameters: lines=-1
[test] sane_get_parameters: depth=1
[test] sane_get_parameters: pixels_per_line=112
[test] sane_get_parameters: bytes_per_line=14
[test] sane_get_parameters: handle=0x8112d28, params=0x81759cc
[test] sane_get_parameters: format=red
[test] sane_get_parameters: last_frame=false
[test] sane_get_parameters: lines=-1
[test] sane_get_parameters: depth=1
[test] sane_get_parameters: pixels_per_line=112
[test] sane_get_parameters: bytes_per_line=14
[test] sane_set_io_mode: handle = 0x8112d28, non_blocking = 1
[test] sane_read: handle=0x8112d28, data=0xbfffc3dc, max_length = 8192, 
length=
0xbfffc3d8
[test] sane_read: scanning last 2520 bytes
[test] sane_read: read 2520 bytes of 8192, total 2520
Speicherzugriffsfehler