scsci host num / busno is getting to high at wodim and cdrdao

Bug #388436 reported by Wolfgang Eibner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cdrkit (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi!

We are using Ubuntu 8.04.2 server with wodim 9:1.1.6-1ubuntu6 and cdrdao 1:1.2.2-8ubuntu3. We have a cd and dvd burning robot connected to our server. The robots cd/dvd drives are ide drives that are connected via a ide <-> firewire changer. So the drives are recognized as /dev/sr* an can be used like normal internal drives.

Now we got the following problem: When we turn of the robot (and in fact the power source for the drives) and turn it on again, the scsi busno is increased by one. After some time this can lead to very high numbers like 277 or so. If we do a wodim --scanbus we can still see the drives, but wodim and cdrdao can't use them any more. At busno >= 256 we get this error message:

Cdrdao version 1.2.2 - (C) Andreas Mueller <email address hidden>
  SCSI interface library - (C) Joerg Schilling
  Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

ERROR: Cannot open SCSI device '/dev/sr1': Illegal value for busno, target or lun '256,0,0'
...

The same problem seems to occur with all usb or firewire connected writers/drives.

So my question is how to solve this... I looked at the source code and found a maximum number in some lib, but also some arrays are allocated with that number - so maybe it is a bad idea to change it... A reboot of course helps, but that's really a bad solution.

I've found a kernel patch at [1] from Ben Collins which was intended to solve our problem. The final version of the patch can be found at [2]. I tried it and it worked well until a drive hung up and I got some sort of NULL Pointer Error. Then the whole system hung until a cold start.

In [3] H. Peter Anvin states that he doesn't like the patch because of the number allocation scheme. I certainly agree his comment but how can we solve our problem? Is it really a kernel issue or is it an issue of cdrkit (wodim/cdrecord/...) cause it has a maximum value while the kernel has none (only at overflow)? Is there any way to patch the lib myself (cause i'm not very familiar with C and linux libraries)?

If you need any further information or outputs please feel free to contact me! Thanks in advance!

Best regards,
Wolfgang Eibner

[1] http://lkml.indiana.edu/hypermail/linux/kernel/0402.3/1052.html
[2] http://lkml.indiana.edu/hypermail/linux/kernel/0402.3/1403.html
[3] http://lkml.indiana.edu/hypermail/linux/kernel/0402.3/1323.html

Revision history for this message
Wolfgang Eibner (we-x-net) wrote :

As I found out in libusal/scsi-linux-sg.c:165 wodim stops at 1256: #define MAX_SCG 1256 /* Max # of SCSI controllers */

cdrdao stops at 256, defined in scsilib/libscg/scsi-linux-sg.c:147

I could raise these numbers but it is still a problem of "where is the end?" or how much memory is additionally consumed for the arrays which are allocated with these constants.

Revision history for this message
Schily (schilling-fokus) wrote :

The bug is really in the Linux kernel. If you change the number
as you mentioned above, you only hide the problem for some time.

Regarding cdrdao:

Cdrdao is umnaintained since 3 years and did not add new features
since 4 years. The last time the libscg code in cdrdao was updated is
more than 5 years ago.

Regarding wodim:

It is dead since May 6th 2007 and in the 8 months of speudo activity
before, it added many bugs that never have been in the ofiginal code.
Wodim is also in conflict with the Copyright law.

BTW: for what putpose do you need cdrdao?

Revision history for this message
insaner (insaner) wrote :

hi, i just hit this problem too, but this is on my fedora (fc 15) machine. here's the error:

# cdrecord dev=/dev/sr0 -scanbus
Cdrecord-Clone 2.01 (cpu-pc-linux-gnu) Copyright (C) 1995-2004 J�rg Schilling
Note: This version is an unofficial (modified) version with DVD support
Note: and therefore may have bugs that are not present in the original.
Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
Note: The author of cdrecord should not be bothered with problems in this version.
scsidev: '/dev/sr0'
devname: '/dev/sr0'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
cdrecord: Invalid argument. Illegal value for busno, target or lun '529,0,0'. Cannot open SCSI driver.
cdrecord: For possible targets try 'cdrecord -scanbus'.
cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

note the busno of 529. everytime i connect or disconnect a usb device the number goes up. and since my dvdwriter is external via USB, that means i cant burn anything with it until i reboot.

any workarounds are appreciated.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.