View Issue Details

IDProjectCategoryView StatusLast Update
0000564Sane for OS/2 & eComStationBugpublic2022-05-24 18:37
Reporterasavage Assigned Topsmedley  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformHP DC7100CMT P4 x86OSeCSOS Version2.1
Summary0000564: SANE's scanimage -L hangs system hard
DescriptionFrom: "Al Savage" <asavage@iname.com>
Message-ID: <YdXcPjhdfZKu-pn2-hQzUKdV8FQK9@tori>
Newsgroups: comp.os.os2.apps
Subject: SANE's scanimage -L hangs system hard
Date: Fri, 08 Feb 2013 11:42:38 -0600
Attempting to use SANE's scanimage.exe locks up the computer hard. No
POPUPLOG entry, no trap screen. The eCenter CPU load freezes, as does
the clock, and the mouse doesn't move, all I can do is pull the power
cord. Same problem on two identical computers (but differing version of
OS, different SCSI HAs and cables). Both computers can boot WinXP and
are able to scan well using TWAIN & PMView there.
 
Steps To Reproducerun "scanimage -L"
Additional InformationTwo different computers, same problem.

The HAs are Adaptec 2940UW Pro and 2930B.
I use the 2002 driver AIC7870.ADD v10.3.1
The HA BIOSs have been updated to the latest level for many years.

The scanner has an "In" and "Out" port. I've always had a separate,
expensive active terminator (with LED indicator) on the "Out" port.

As there is only the scanner on the SCSI chain on either computer, I
have set the 2930B & 2940UW Pro to Termination Enable for the adapter.
Automatic has worked fine in the past, though.

I've also turned off "Allow Disconnect/Reconnect" in the adapter
settings, and tried different SCSI bus speeds, and tried toggling "Auto
Negotiation" of bus width.

Recently, I migrated my W4 (FP17 HPFS386) box to newer hardware. In the
process, many OS files had to be changed. I needed APIC to work. I had
to move the kernel from 14.104 to 14.105_SMP, etc. Memory went from 1Gb
to 2Gb.

I've been attempting to get the scanners working with the same version
of SANE (or any version) and the new hardware. After a number of hours,
I also set up an eCS box with SCSI and SANE and tried from there as
well. Both boxes exhibit the same problem of a hard system hang at a
certain point after running sane-find-scanner or scanimage.

After trying two older sane releases (.15 & .18), for recent testing
I've been sticking with the last port: 1.0.22-os2-20120131 and the eCS
box.

I added these to CONFIG.SYS (without the versioning comments):

REM *** 07Feb2013 Added SCSI support for AHA2940 family
basedev=AIC7870.ADD /V (v10.1.3)
BASEDEV=OS2SCSI.DMD (v10.70)
BASEDEV=OS2ASPI.DMD /ALL (v10.70)
DEVICE=c:\OS2\BOOT\ASPIROUT.SYS /v (v1.1b10)


I'm using:
SET SANE_DEBUG_DLL=255
SET SANE_DEBUG_SANEI_SCSI=255
SET SANE_DEBUG_MUSTEK=255
SET SANE_DEBUG_SANEI_THREAD=255

I can't take screenshots when it's hung, so I resorted to a camera. I've
commented out everything in dll.conf except my scanner:

scanimage -L
http://asavage.dyndns.org/ftp/hosting/SANE/SANE_04b.jpg

At the time of the screenshots, the system is dead-dead; all I can do is
pull the power cord.

I ran ASPIROUT.SYS' ASPIDBUG.exe /F and captured a log of the ASPI
interaction prior to a system hang:

1: Set buffer (pre): 02E7:0000
1: Set buffer (post): Status 0x0000; RC: 0

2: Send SRB (pre): 02DF:21A0; Inquiry; HA: 0; Ext. sig: 0x0000; Ext.
length: 0
2: Send SRB (post): Status 0x0000; SRB Status: 0x01
Num HA: 2; HA ID: 7; Ext. sig: 0x0000; Ext. length: 0
AspiMgr: 'OS2ASPI Dev Mgr '; Host: ''; Unique: ''

3: Send SRB (pre): 02DF:21A0; Inquiry; HA: 0; Ext. sig: 0x0000; Ext.
length: 0
3: Send SRB (post): Status 0x0000; SRB Status: 0x01
Num HA: 2; HA ID: 7; Ext. sig: 0x0000; Ext. length: 0
AspiMgr: 'OS2ASPI Dev Mgr '; Host: ''; Unique: ''

4: Send SRB (pre): 02DF:21A0; Device Type; HA,ID,LUN: 0,0,0
Ext. sig: 0x0000; Ext. length: 0
4: Send SRB (post): Status 0x0000; SRB Status: 0x82

5: Send SRB (pre): 02DF:21A0; Device Type; HA,ID,LUN: 0,1,0
Ext. sig: 0x0000; Ext. length: 0
5: Send SRB (post): Status 0x0000; SRB Status: 0x82

6: Send SRB (pre): 02DF:21A0; Device Type; HA,ID,LUN: 0,2,0
Ext. sig: 0x0000; Ext. length: 0
6: Send SRB (post): Status 0x0000; SRB Status: 0x82

7: Send SRB (pre): 02DF:21A0; Device Type; HA,ID,LUN: 0,3,0
Ext. sig: 0x0000; Ext. length: 0
7: Send SRB (post): Status 0x0000; SRB Status: 0x82

8: Send SRB (pre): 02DF:21A0; Device Type; HA,ID,LUN: 0,4,0
Ext. sig: 0x0000; Ext. length: 0
8: Send SRB (post): Status 0x0000; SRB Status: 0x82

9: Send SRB (pre): 02DF:21A0; Device Type; HA,ID,LUN: 0,5,0
Ext. sig: 0x0000; Ext. length: 0
9: Send SRB (post): Status 0x0000; SRB Status: 0x82

10: Send SRB (pre): 02DF:21A0; Device Type; HA,ID,LUN: 0,6,0
Ext. sig: 0x0000; Ext. length: 0
10: Send SRB (post): Status 0x0000; SRB Status: 0x01; Device Type: 6
Ext. sig: 0x0000; Ext. length: 0

11: Send SRB (pre): 02DF:21A0; Command; HA,ID,LUN: 0,6,0; Flags: 0x09
Data pointer: 0000:0000; Data length: 5; Sense length: 32; CDB length: 6
CDB (Unknown command): 12 00 00 00 05 00

[system hang]

The scanner is the only SCSI device, and it's ID is 6,0, so that looks
correct right up to entry 11.

Entry 11's DBD's command is 12 (INQUIRY), and the system hangs before a
response is found.

Paul Ratcliffe opined:
>Having a data pointer of 0000:0000 isn't going to get you very far is it?

> I thought this would have been verified so as not to crash, but it's
> years since I looked at the ASPIROUT code. Anyway it's an application
> problem...

And I have to agree.
 

--
Regards,
Al S.
TagsNo tags attached.
Attached Files
SANE_04b.jpg (625,629 bytes)

Activities

asavage

2013-02-09 22:05

reporter   ~0002402

1) I modified the line:
PSD=ACPI.PSD
to add "/PIC", which restricts to using legacy 16 IRQs.
sane-find-scanner & scanimage operate as expected.

sane-1.0.22-os2-20120131.zip
Adaptec 2930B

I ran several 50Mb scans without problems. However, I'd like to run /APIC rather than /PIC. Is there a way that I can help on my end?


2) Answering a Q from Steven: I have never used OS2APIC.PSD

asavage

2013-02-10 00:02

reporter   ~0002403

Now trying
PSD-ACPI.PSD /VW
which works as well.

Running ASPIDBUG.exe /F, to capture ASPIROUT's SCSI interactions with a working setup, here's some comparison lines. This is with a dll.conf with only "mustek" not commented, and running

scanimage -L

ASPIDBUG log file snippet:

[ . . . ]

10: Send SRB (pre): 041F:0240; Device Type; HA,ID,LUN: 0,6,0
  Ext. sig: 0x0000; Ext. length: 0
10: Send SRB (post): Status 0x0000; SRB Status: 0x01; Device Type: 6
  Ext. sig: 0x0000; Ext. length: 0

11: Send SRB (pre): 041F:0240; Command; HA,ID,LUN: 0,6,0; Flags: 0x09
  Data pointer: 0000:0000; Data length: 5; Sense length: 32; CDB length: 6
  CDB (Unknown command): 12 00 00 00 05 00
11: Send SRB (post): Status 0x0000; SRB Status: 0x01
  HA Status: 0x00; Target Status: 0x00

12: Send SRB (pre): 041F:0240; Command; HA,ID,LUN: 0,6,0; Flags: 0x09
  Data pointer: 0000:0000; Data length: 96; Sense length: 32; CDB length: 6
  CDB (Unknown command): 12 00 00 00 60 00
12: Send SRB (post): Status 0x0000; SRB Status: 0x01
  HA Status: 0x00; Target Status: 0x00

13: Send SRB (pre): 041F:0240; Inquiry; HA: 1; Ext. sig: 0x0000; Ext. length: 0
13: Send SRB (post): Status 0x0000; SRB Status: 0x01
  Num HA: 2; HA ID: 7; Ext. sig: 0x0000; Ext. length: 0
  AspiMgr: 'OS2ASPI Dev Mgr '; Host: 'ATA_ATAPI '; Unique: ''

14: Send SRB (pre): 041F:0240; Device Type; HA,ID,LUN: 1,0,0
  Ext. sig: 0x0000; Ext. length: 0
14: Send SRB (post): Status 0x0000; SRB Status: 0x82

[ . . . log continues through 48 . . . ]


"Data pointer: 0000:0000" is still present, yet the application works. I can scan and everything ;)

psmedley

2013-02-10 02:22

administrator   ~0002404

Interesting... the data pointer may be an issue - but I've touched nothing in the SCSI code in Sane....

asavage

2013-02-10 02:59

reporter   ~0002405

For me, this is "new" hardware (circa 2004, but new to me). It may have never worked with this particular combination of hardware and APIC. I had tried sane versions .14 and .18 and they all locked up with the 3.21.07 APIC.

The eCS box (with /VW) scans (2930B, IRQ11)
The W4 box (with /VW) scans (2940UW Pro, IRQ5)

psmedley

2013-02-13 08:38

administrator   ~0002408

This is from sanei_scsi.c:
      DBG (1, "OS/2: type is '%s'\n",
           PSRBlock->u.dev.devtype < sizeof (devtypes) / sizeof (char *)?
           devtypes[PSRBlock->u.dev.devtype] : "unknown device");

      /* query adapter string id */
      memset (PSRBlock, 0, sizeof (SRB));
      PSRBlock->cmd = SRB_Command; /* execute SCSI command */

      PSRBlock->ha_num = i; /* host adapter number */
      PSRBlock->flags = SRB_Read | SRB_Post; /* data transfer, posting */
      PSRBlock->u.cmd.target = id; /* Target SCSI ID */
      PSRBlock->u.cmd.lun = 0; /* Target SCSI LUN */
      PSRBlock->u.cmd.data_len = 5; /* # of bytes transferred */
      PSRBlock->u.cmd.sense_len = 32; /* length of sense buffer */
      PSRBlock->u.cmd.data_ptr = NULL; /* pointer to data buffer */
      PSRBlock->u.cmd.link_ptr = NULL; /* pointer to next SRB */
      PSRBlock->u.cmd.cdb_len = 6; /* SCSI command length */
      PSRBlock->u.cmd.cdb_st[0] = INQUIRY; /* inquiry command */
      PSRBlock->u.cmd.cdb_st[1] = 0; /* ?? length */
      PSRBlock->u.cmd.cdb_st[2] = 0; /* transfer length MSB */
      PSRBlock->u.cmd.cdb_st[3] = 0; /* transfer length */
      PSRBlock->u.cmd.cdb_st[4] = 5; /* transfer length LSB */
      PSRBlock->u.cmd.cdb_st[5] = 0;
      rc = DosDevIOCtl (driver_handle, 0x92, 0x02,
                (void *) PSRBlock, sizeof (SRB), &cbParam,
                (void *) PSRBlock, sizeof (SRB), &cbreturn);
      len = ((char *) aspi_buf)[4]; /* additional length */

The sane code has:
PSRBlock->u.cmd.data_ptr = NULL; /* pointer to data buffer */

So it is set to NULL. This code hasn't been touched in years - never by me. Not saying the code is correct, but I don't know enough about aspirout to comment.

psmedley

2014-04-03 06:50

administrator   ~0002718

Is this still an issue? If it is, I'm not certain that it's a Sane issue.

asavage

2014-04-03 13:48

reporter   ~0002720

Since adding the /VW to PSD-ACPI.PSD & successfully scanningf, I have not tried anything else. Is there something you'd like me to try? A newer ACPI package, perhaps?

Issue History

Date Modified Username Field Change
2013-02-09 04:09 asavage New Issue
2013-02-09 04:10 asavage File Added: SANE_04b.jpg
2013-02-09 22:05 asavage Note Added: 0002402
2013-02-10 00:02 asavage Note Added: 0002403
2013-02-10 02:22 psmedley Note Added: 0002404
2013-02-10 02:59 asavage Note Added: 0002405
2013-02-13 08:38 psmedley Note Added: 0002408
2014-04-03 06:50 psmedley Note Added: 0002718
2014-04-03 13:48 asavage Note Added: 0002720
2014-10-11 19:13 psmedley Status new => resolved
2014-10-11 19:13 psmedley Resolution open => unable to reproduce
2014-10-11 19:13 psmedley Assigned To => psmedley
2020-08-24 03:07 psmedley Status resolved => closed