Oops from 2.3.50pre2 using raw-io with aio_read

From: Peter Monta (pmonta@terayon.com)
Date: Tue Mar 07 2000 - 14:45:05 EST


I'm seeing an oops when using asynchronous I/O (aio_read) when
the underlying device is a raw device bound to an IDE disk.
The kernel is 2.3.50pre2, and the system uses glibc-2.1.3,
librt-2.1.3, and libpthread-0.8 (all from the Red Hat 6.2 beta).

Below are the test program that caused the oops and the decoded
oops transcript. (Note that one "." was successfully printed
by the program before the oops.) Any feedback much appreciated.

Cheers,
Peter Monta pmonta@terayon.com
Terayon Communication Systems

/* gcc -Wall -O2 -o aio_test aio_test.c -lrt */
/* run as: aio_test /dev/raw1 */
/* /dev/raw1 is bound to /dev/hda, which is on the */
/* PIIX controller, not the Promise/66 */

#define _FILE_OFFSET_BITS 64

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <aio.h>
#include <unistd.h>
#include <malloc.h>

struct aiocb a;
unsigned char* buf;

int main(int argc, char* argv[])
{ int r;
  int fd;

  fd = open(argv[1],O_RDONLY);
  if (fd<0) { perror("open"); exit(1); }

  buf = (unsigned char*)malloc(4096+512);
  buf += 512 - ((int)buf & 511);

  a.aio_fildes = fd;
  a.aio_offset = 0;
  a.aio_buf = (void*)buf;
  a.aio_nbytes = 4096;
  a.aio_sigevent.sigev_notify = SIGEV_NONE;
  r = aio_read(&a);
  if (r) perror("aio_read");
 
  while ( (r = aio_error(&a)) == EINPROGRESS) {
    fprintf(stderr,".");
    usleep(1000); }
 
  r = aio_return(&a);
  fprintf(stderr,"return val %d\n",r);
 
  return 0; }
 
ksymoops 0.7c on i686 2.2.15-2.5.0. Options used
     -v /usr/src/linux/vmlinux (specified)
     -K (specified)
     -L (specified)
     -O (specified)
     -m /usr/src/linux/System.map (specified)
 
.Unable to handle kernel NULL pointer dereference at virtual address
00000040
c012beb0
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<c012beb0>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010293
eax: c653e1e0 ebx: 00000000 ecx: 00000200 edx: 00000000
esi: 00000a00 edi: c653e1e0 ebp: 00000000 esp: c5f17abc
ds: 0018 es: 0018 ss: 0018
Process aio_test (pid: 7157, stackpage=c5f17000)
Stack: c653e1e0 c3e7e020 00000a00 c012d214 c653e1e0 00000000 00000a00
00000300
       c5f17d78 00001000 00000008 00000000 00000000 00000000 00000001
00000000
       00000000 00001000 00000000 03000000 00000000 00000000 00000000
00000000
Call Trace: [<c012d214>] [<c016b205>] [<c01730d5>] [<c0172b40>]
[<c0173d28>] [<c0172fb8>] [<c0173d47>]
       [<c0176195>] [<c0173d28>] [<c016c1e0>] [<c016c162>] [<c011d2ce>]
[<c011d2f3>] [<c018afbe>] [<c01216a1>]
       [<c011e23d>] [<c011e3a0>] [<c010f376>] [<c018ad54>] [<c012a52d>]
[<c018ad38>] [<c0109670>]
Code: 8b 43 40 85 c0 75 1c 68 82 04 00 00 68 1a 93 1d c0 68 a7 90
 
>>EIP; c012beb0 <set_bh_page+34/60> <=====
Trace; c012d214 <brw_kiovec+158/344>
Trace; c016b205 <ide_set_handler+51/5c>
Trace; c01730d5 <ide_dmaproc+11d/1f0>
Trace; c0172b40 <ide_dma_intr+0/a0>
Trace; c0173d28 <pdc202xx_dmaproc+0/28>
Trace; c0172fb8 <ide_dmaproc+0/1f0>
Trace; c0173d47 <pdc202xx_dmaproc+1f/28>
Trace; c0176195 <do_rw_disk+12d/384>
Trace; c0173d28 <pdc202xx_dmaproc+0/28>
Trace; c016c1e0 <ide_stall_queue+10/24>
Trace; c016c162 <start_request+17e/1ec>
Trace; c011d2ce <map_user_kiobuf+136/2dc>
Trace; c011d2f3 <map_user_kiobuf+15b/2dc>
Trace; c018afbe <rw_raw_dev+23e/2c0>
Trace; c01216a1 <filemap_nopage+9d/370>
Trace; c011e23d <do_no_page+55/c4>
Trace; c011e3a0 <handle_mm_fault+f4/164>
Trace; c010f376 <do_page_fault+17e/4c8>
Trace; c018ad54 <raw_read+1c/24>
Trace; c012a52d <sys_pread+cd/f0>
Trace; c018ad38 <raw_read+0/24>
Trace; c0109670 <system_call+34/38>
Code; c012beb0 <set_bh_page+34/60>
00000000 <_EIP>:
Code; c012beb0 <set_bh_page+34/60> <=====
   0: 8b 43 40 mov 0x40(%ebx),%eax <=====
Code; c012beb3 <set_bh_page+37/60>
   3: 85 c0 test %eax,%eax
Code; c012beb5 <set_bh_page+39/60>
   5: 75 1c jne 23 <_EIP+0x23> c012bed3
<set_bh_page+57/60>
Code; c012beb7 <set_bh_page+3b/60>
   7: 68 82 04 00 00 push $0x482
Code; c012bebc <set_bh_page+40/60>
   c: 68 1a 93 1d c0 push $0xc01d931a
Code; c012bec1 <set_bh_page+45/60>
  11: 68 a7 90 00 00 push $0x90a7

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:23 EST