Phantom blank cd

Bug #562978 reported by John Yates
60
This bug affects 11 people
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Fix Released
Medium
Martin Pitt
Lucid
Fix Released
Medium
Martin Pitt

Bug Description

Binary package hint: udev

Lucid, with all updates, shows a phantom blank cd on the desktop.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: udev 151-10
ProcVersionSignature: Ubuntu 2.6.32-20.30-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-20-generic i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Wed Apr 14 08:17:59 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
ProcCmdLine: BOOT_IMAGE=(hd1,2)/boot/vmlinuz-2.6.32-20-generic root=/dev/sdb2 ro ipv6.disable=1
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: udev
dmi.bios.date: 02/03/2005
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P1.70
dmi.board.name: P4V88
dmi.board.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.70:bd02/03/2005:svn:pnP4V88:pvr1.00:rvn:rnP4V88:rvr1.0:
dmi.product.name: P4V88
dmi.product.version: 1.00

Revision history for this message
John Yates (andyfranyates) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Can you please copy&paste the output of

  sudo strace -vvfs1024 -o /tmp/strace /lib/udev/cdrom_id -d /dev/sr0

and then attach /tmp/strace here? Thanks!

I suspect this is similar to forestpiskie's and John Yate's problems in bug 559723, but let's make sure that it's really the same problem and not yet another root cause.

Martin Pitt (pitti)
Changed in udev (Ubuntu Lucid):
importance: Undecided → Medium
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

Sorry for the confusion, the previous request for strace/output was directed to Mike Brudevold. Somehow I thought that Mike opened this bug, not John. We already have John's straces in the other bug.

This is currently being discussed on the upstream ML: http://www.spinics.net/lists/hotplug/msg03635.html

I have a patch which should help in some cases of this, thanks to Mike Brudevold! Can you please install udev 150-10pitti1 from my PPA and see how it goes? Thanks!

  sudo add-apt-repository ppa:pitti/ppa
  sudo apt-get update
  sudo apt-get install udev

(Should be built within the next hour)

Changed in udev (Ubuntu Lucid):
assignee: Martin Pitt (pitti) → nobody
status: New → Incomplete
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
John Yates (andyfranyates) wrote :

OK. 150-10pitti1 got rid of the phantom CD, but when I insert a blank CD, it is NOT detected. A CD with data on it is.

Revision history for this message
Martin Pitt (pitti) wrote :

*sigh*, thanks John. Can you please send me the output of

  sudo strace -vvfs1024 -o /tmp/strace /lib/udev/cdrom_id -d /dev/sr0

and then attach /tmp/strace here? Thanks!

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, interesting, I get a regression with a blank CD:

diff -u <(sudo /lib/udev/cdrom_id -d /dev/sr0 2>&1) <(sudo ./cdrom_id -d /dev/sr0 2>&1)
--- /dev/fd/63 2010-04-15 20:53:25.248391380 +0200
+++ /dev/fd/62 2010-04-15 20:53:25.248391380 +0200
@@ -10,8 +10,7 @@
 cd_profiles: profile 0x11
 cd_profiles: profile 0x10
 cd_profiles: current profile 0x09
-cd_media_toc: READ TOC: len: 2
-cd_media_info: disk type ff
+info_scsi_cmd_err: READ TOC failed with SK=5h/ASC=24h/ACQ=00h
 ID_CDROM=1
 ID_CDROM_CD_R=1
 ID_CDROM_CD_RW=1
@@ -25,7 +24,3 @@
 ID_CDROM_MRW_W=1
 ID_CDROM_MEDIA=1
 ID_CDROM_MEDIA_CD_R=1
-ID_CDROM_MEDIA_STATE=blank
-ID_CDROM_MEDIA_SESSION_NEXT=1
-ID_CDROM_MEDIA_SESSION_COUNT=1
-ID_CDROM_MEDIA_TRACK_COUNT=1

audio, data, and no CD are still fine.

Revision history for this message
John Yates (andyfranyates) wrote :

main: probing: '/dev/sr0'
cd_media_compat: CDROM_DRIVE_STATUS != CDS_DISC_OK
cd_inquiry: INQUIRY: [SONY ][CD-RW CRX230ED ][4YS1]
cd_profiles: GET CONFIGURATION: number of profiles 184
cd_profiles: profile 0x0a
cd_profiles: current profile 0x02
info_scsi_cmd_err: READ TOC failed with SK=2h/ASC=3Ah/ACQ=00h
ID_CDROM=1
ID_CDROM_CD_R=1
ID_CDROM_CD_RW=1
ID_CDROM_MRW=1
ID_CDROM_MRW_W=1
ID_CDROM_MEDIA=1

Revision history for this message
Martin Pitt (pitti) wrote :

OK, I uploaded pitti2 into my PPA, which fixes the handling of blank CDs after the pitti1 fix for phantom CDs. I now tested this with no media, audio CD, blank CD, and data CD, and additionally with some fake CDs in kvm.

Can you please test pitti2, and give me the cdrom_id -d output/strace if it still fails for some case? Thanks!

Revision history for this message
Martin Pitt (pitti) wrote :

For the record:

This is the fix for the phantom drives:

http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=58e178894bfc040834e1270c6fe9b9fdef513550

That fix (not ignoring error messages) now uncovered another bug which broke blank CD detection:

http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=30e3b1a0d3a3ec76f16736470dc656744848d941

Those two fixes are in the pitti2 version of my PPA.

But since John said that data CD detection would be broken for him now, I need the debug output to see what's wrong.

Revision history for this message
John Yates (andyfranyates) wrote :

That fixed it. Thanks.

Revision history for this message
Martin Pitt (pitti) wrote :

Sweet, thanks for testing!

Changed in udev (Ubuntu Lucid):
status: Incomplete → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Uploaded 151-11, waiting for ubuntu-release review now. Both Kay and I tested this inside out.

Revision history for this message
NoOp (glgxg) wrote :

This looks to be a duplicate of
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/552195
However, given that you may be on to a fix I'll be happy to mark 5522195 as a dupe of this bug if you think it appropriate.

Revision history for this message
Martin Pitt (pitti) wrote :

Indeed, I'll do so

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package udev - 151-11

---------------
udev (151-11) lucid; urgency=low

  * Fix cdrom_id even harder to correctly detecting media. (Committed to
    and cherrypicked from upstream git head):
    - Rework feature/profiles buffer parsing: Previously we were ignoring many
      profiles, which could lead to misdetecting the content types.
    - Print more debug messages with -d.
    - Do not ignore errors from scsi_cmd_run(). scsi_cmd_run() can return
      positive error messages if we have CHECK_CONDITION set and get the error
      code from the SCSI command result. So check the result for non-zero, not
      for being negative. This fix another common cause for "phantom" media
      in empty CD-ROM drives. (LP: #562978)
    - Swap media state and TOC info probing. Blank CDs do not have a TOC, thus
      will fail cd_media_toc() (at least with the "Do not ignore errors from
      scsi_cmd_run()" fix). Thus probe the media state first, so that we can
      properly detect blank media.
 -- Martin Pitt <email address hidden> Thu, 15 Apr 2010 22:29:06 +0200

Changed in udev (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
NoOp (glgxg) wrote :

$ apt-cache policy udev
udev:
  Installed: 151-11
  Candidate: 151-11
  Version table:
 *** 151-11 0
        500 http://archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

Works for me - no more phantom blank cd icon. Thanks for the fix!

Revision history for this message
Bernard Decock (decockbernard) wrote :

I have another problem regarding a blank cd ( https://bugs.launchpad.net/ubuntu/+source/udev/+bug/602862 ) . in my case
the blank cd is mounted properly but nautilus reports no free space on the cd. (Empty-cd-icon pops up -> properties :
free space = 0 ??? used space = 0

lshal reports however that volume.disc.capacity = 735051776 (0x2bd00000) (uint64)

dmesg:

Jul 16 17:43:12 Ubuntu-Bernard kernel: [ 81.971591] sr 1:0:1:0: [sr1] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jul 16 17:43:12 Ubuntu-Bernard kernel: [ 81.971601] sr 1:0:1:0: [sr1] Sense Key : Illegal Request [current]
Jul 16 17:43:12 Ubuntu-Bernard kernel: [ 81.971608] sr 1:0:1:0: [sr1] Add. Sense: Logical block address out of range
Jul 16 17:43:12 Ubuntu-Bernard kernel: [ 81.971619] sr 1:0:1:0: [sr1] CDB: Read(10): 28 00 00 00 00 00 00 00 01 00
Jul 16 17:43:12 Ubuntu-Bernard kernel: [ 81.974110] sr 1:0:1:0: [sr1] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

I have udev version 151-12.

This problem did occur after installing the regular ubuntu-upgrades => can't burn cd's anylonger (brasero reports that there is
no space on the cd).

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

Other bug subscribers

Remote bug watches

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