Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274182 - [2.6.30 regression] oops in ide_complete_rq when booting with CDRW in the drive
Summary: [2.6.30 regression] oops in ide_complete_rq when booting with CDRW in the drive
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: http://bugzilla.kernel.org/show_bug.c...
Whiteboard: linux-2.6.30-regression
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2009-06-15 02:15 UTC by Malcolm Lashley
Modified: 2009-07-03 23:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel bootlog with cdrw-disc present in drive - crash. (bootlog-2.6.30-r1_cdrw_crash,25.80 KB, text/plain)
2009-06-15 02:17 UTC, Malcolm Lashley
Details
kernel bootlog with cdrw-disc absent in drive - *no* crash. (bootlog-2.6.30-r1_nocdrw_nocrash,30.20 KB, text/plain)
2009-06-15 02:18 UTC, Malcolm Lashley
Details
assembly for kernel source in question - to give offsets for OOPS (ide-io.s,37.70 KB, text/plain)
2009-06-15 02:19 UTC, Malcolm Lashley
Details
disassembly of ide-io.o (actually this gives the true offsets... it's late here) (ide-io.dsm,50.26 KB, text/plain)
2009-06-15 02:20 UTC, Malcolm Lashley
Details
possible fix (idecd.patch,1.59 KB, patch)
2009-06-21 15:16 UTC, Daniel Drake (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Malcolm Lashley 2009-06-15 02:15:53 UTC
After upgrading *from* 2.6.29-r1 to 2.6.30-r1 - my desktop would reliably crash on boot when detecting ide-cd drives. After some debugging I tracked this down to a null pointer dereference of rq in ide_complete_rq - rq is zero when the macro blk_noretry_request is invoked. (I added some printk()s as below at the start of that function right after the variables are defined.)

printk(KERN_ERR "MALC: in ide_complete_rq, drive: 0x%llx drive->hwif: 0x%llx\n",drive,drive->hwif);
printk(KERN_ERR "MALC: in ide_complete_rq, rq: 0x%llx \n",rq);

I further tracked this down to be reproducible if I had a CDRW in the drive at boot - if I remove the cdrw - the system boots normally.

The contrasting boot-logs captured using serial console are attached - as is the output of 
   make drivers/ide/ide-io.s
and 
   objdump  -d ide-io.o > ide-io.dsm

I've limited knowledge of this area of the kernel - so could do with some help in tracking down why we're trying to complete a null request.

(I'm guessing this probably needs to go $upstream - as there were no genpatches in this area at the time of writing...)

If you need more info - let me know.

Reproducible: Always

Steps to Reproduce:
1. Build 2.6.30-r1 on my system, boot (from hdd) with a CDRW-disc in /dev/hda
2. Toss CDRW-disc accross the room, reboot with empty /dev/hda


Actual Results:  
1. Observe OOPS
2. Bask in a fully-functioning system once more :)


Including emerge --info - but fairly sure it's of little consequence here ;-)

duality ide # emerge --info
WARNING: One or more repositories have missing repo_name entries:

        /home/mlashley/overlay/profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.                  
Portage 2.2_rc33 (default/linux/amd64/2008.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.30-gentoo-r1 x86_64)
=================================================================                                 
System uname: Linux-2.6.30-gentoo-r1-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4400+-with-gentoo-2.0.1
Timestamp of tree: Sun, 14 Jun 2009 20:30:01 +0000                                                          
distcc 3.1 x86_64-pc-linux-gnu [disabled]                                                                   
ccache version 2.4 [enabled]                                                                                
app-shells/bash:     4.0_p24                                                                                
dev-java/java-config: 1.3.7-r1, 2.1.8-r1                                                                    
dev-lang/python:     2.5.4-r2, 2.6.2-r1                                                                     
dev-python/pycrypto: 2.0.1-r8                                                                               
dev-util/ccache:     2.4-r8                                                                                 
dev-util/cmake:      2.6.4                                                                                  
sys-apps/baselayout: 2.0.1                                                                                  
sys-apps/openrc:     0.4.3-r3                                                                               
sys-apps/sandbox:    2.0                                                                                    
sys-devel/autoconf:  2.13, 2.63-r1                                                                          
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11                                
sys-devel/binutils:  2.19.1-r1                                                                              
sys-devel/gcc-config: 1.4.1                                                                                 
sys-devel/libtool:   2.2.6a                                                                                 
virtual/os-headers:  2.6.29                                                                                 
ACCEPT_KEYWORDS="amd64 ~amd64"                                                                              
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -g -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.2/env /usr/kde/4.2/share/config /usr/kde/4.2/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=k8 -pipe -g -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache collision-protect cvs distlocks fixpackages multilib-strict nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://mirror.cambrium.nl/pub/os/linux/gentoo/ http://mirror.averse.net/pub/gentoo/ http://91.121.124.139/gentoo-distfiles/"
LDFLAGS="-Wl,-O1"
LINGUAS="en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--stats --progress"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/mlashley/overlay /usr/local/portage/layman/pro-audio /usr/local/portage/layman/toolchain /usr/local/portage/layman/perl-experimental /usr/local/portage/layman/roslin"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl aiglx alsa amd64 amr amrnb amrwb apache2 avi bash-completion berkdb bluetooth browserplugin bzip2 cdr cli consolekit cracklib crosscompile crypt cscope cups curl daap dbus dri dts dv dvb dvd dvdr dvdread encode ethereal evo examples exif f77 fam fastcgi ffmpeg firefox flac foomaticdb fortran gdbm gif gimp gimpprint glade glitz glut gphoto2 gpm gtk gtk2 hal iconv ieee1394 imagemagick imap imlib ipod ipv6 isdnlog jack java jikes joystick jpeg jpeg2k kde kdeprefix kqemu lame lesstif libwww live mad mbox midi mikmod mmx mng motif mozilla mp3 mpeg msn mudflap multilib mysql nagios-ntp nagios-ping nagios-ssh ncurses nls nptl nptlonly nsplugin nvidia offensive oggvorbis openexr opengl openmp pam pcre pda pdf pdflib perl pic png pnp pppd python qt quicktime raw rdesktop readline reflection rrdcgi rrdtool samba sdl sensord session smp snmp spell spl sqlite sse sse2 ssl svg symlink sysfs tcltk tcpd theora threads tiff truetype trusted udev uk_bleb uk_rt unicode ups usb userlocales v4l v4l2 visualization webkit wifi x264 xcb xcomposite xine xinerama xml2 xorg xosd xprint xscreensaver xvid yahoo yv12 zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" ELIBC="glibc" INPUT_DEVICES="keyboard mouse wacom evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" LIRC_DEVICES="kworld devinput" USERLAND="GNU" VIDEO_CARDS="nv nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Malcolm Lashley 2009-06-15 02:17:40 UTC
Created attachment 194726 [details]
kernel bootlog with cdrw-disc present in drive - crash.
Comment 2 Malcolm Lashley 2009-06-15 02:18:36 UTC
Created attachment 194728 [details]
kernel bootlog with cdrw-disc absent in drive - *no* crash.
Comment 3 Malcolm Lashley 2009-06-15 02:19:43 UTC
Created attachment 194730 [details]
assembly for kernel source in question - to give offsets for OOPS
Comment 4 Malcolm Lashley 2009-06-15 02:20:55 UTC
Created attachment 194732 [details]
disassembly of ide-io.o (actually this gives the true offsets... it's late here)
Comment 5 ixuz 2009-06-15 17:37:20 UTC
(In reply to comment #0)
> After upgrading *from* 2.6.29-r1 to 2.6.30-r1 - my desktop would reliably crash
> on boot when detecting ide-cd drives. After some debugging I tracked this down
> to a null pointer dereference of rq in ide_complete_rq - rq is zero when the
> macro blk_noretry_request is invoked. (I added some printk()s as below at the
> start of that function right after the variables are defined.)
> 
> printk(KERN_ERR "MALC: in ide_complete_rq, drive: 0x%llx drive->hwif:
> 0x%llx\n",drive,drive->hwif);
> printk(KERN_ERR "MALC: in ide_complete_rq, rq: 0x%llx \n",rq);
> 
> I further tracked this down to be reproducible if I had a CDRW in the drive at
> boot - if I remove the cdrw - the system boots normally.
> 
> The contrasting boot-logs captured using serial console are attached - as is
> the output of 
>    make drivers/ide/ide-io.s
> and 
>    objdump  -d ide-io.o > ide-io.dsm
> 
> I've limited knowledge of this area of the kernel - so could do with some help
> in tracking down why we're trying to complete a null request.
> 
> (I'm guessing this probably needs to go $upstream - as there were no genpatches
> in this area at the time of writing...)
> 
> If you need more info - let me know.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Build 2.6.30-r1 on my system, boot (from hdd) with a CDRW-disc in /dev/hda
> 2. Toss CDRW-disc accross the room, reboot with empty /dev/hda
> 
> 
> Actual Results:  
> 1. Observe OOPS
> 2. Bask in a fully-functioning system once more :)
> 
> 
> Including emerge --info - but fairly sure it's of little consequence here ;-)
> 

Hmm, could this

http://forums.gentoo.org/viewtopic-t-772142.html

be related with your bug?

Dunno what to do else...
Comment 6 Daniel Drake (RETIRED) gentoo-dev 2009-06-21 15:16:29 UTC
Created attachment 195350 [details, diff]
possible fix

Please try this patch
Comment 7 Malcolm Lashley 2009-06-21 22:07:19 UTC
Daniel, tested both the simple fix you attached - and the more complex fix (including quirks for the particular Sony DVD-ROM drive I have - found later on the kernel bug at http://bugzilla.kernel.org/show_bug.cgi?id=13399#c29 

I can confirm either patch fixes the problem - and I am now able to insert/eject/mount/unmount CD/CDRW media in this drive successfully.

Cheers,
malc.
Comment 9 Mike Pagano gentoo-dev 2009-07-03 23:01:53 UTC
Released in gentoo-sources-2.6.30-r2