Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Feb 1999 14:32:24 -0500 (EST)
From:      Brian Dean <brdean@unx.sas.com>
To:        freebsd-current@FreeBSD.ORG
Subject:   aio_read panics SMP kernel
Message-ID:  <199902031932.OAA01903@dean.pc.sas.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm using a dual 350MHz Dell Precision 410 with 4.0-19990130-SNAP (SMP
enabled) to prototype a program that uses asynchronous read and write
(aio_read() and aio_write()), and found that the following simple and
not very useful program (it's for demonstration purposes only!) causes
the system to do one of three things:

	1) panic - "page fault in the kernel" ... I don't have any
                   other specifics, I will follow up with the details
                   provided by the console as soon as I can make this
                   occur again (I should have written it down the
                   first time).

	2) reset - no panic or anything, just a system reset and
                   subsequent reboot

	3) hang - everything totally unresponsive, machine does not
                  respond to pings or anything else, no keyboard
                  response.

Below, please find the output of 'mptable' for the SMP experts and the
program that I used to cause the panic.

Any help on fixing this and/or suggestions on what I might be doing
wrong are much appreciated.

Thanks,
-Brian
--
Brian Dean          Process Engineering          brdean@unx.sas.com



Following is the output of 'mpinfo' on this machine:

[root@mrose]:/brdean- mptable 

===============================================================================

MPTable, version 2.0.15

-------------------------------------------------------------------------------

MP Floating Pointer Structure:

  location:                     BIOS
  physical address:             0x000fe710
  signature:                    '_MP_'
  length:                       16 bytes
  version:                      1.4
  checksum:                     0x91
  mode:                         Virtual Wire

-------------------------------------------------------------------------------

MP Config Table Header:

  physical address:             0x000f0000
  signature:                    'PCMP'
  base table length:            468
  version:                      1.4
  checksum:                     0x33
  OEM ID:                       'DELL    '
  Product ID:                   'WS 410      '
  OEM table pointer:            0x00000000
  OEM table size:               0
  entry count:                  50
  local APIC address:           0xfee00000
  extended table length:        0
  extended table checksum:      0

-------------------------------------------------------------------------------

MP Config Base Table Entries:

--
Processors:     APIC ID Version State           Family  Model   Step    Flags
                 0       0x11    BSP, usable     6       5       2       0x183fbff
                 1       0x11    AP, usable      6       5       2       0x183fbff
--
Bus:            Bus ID  Type
                 0       PCI   
                 1       PCI   
                 2       PCI   
                 3       ISA   
--
I/O APICs:      APIC ID Version State           Address
                 2       0x11    usable          0xfec00000
--
I/O Ints:       Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#
                ExtINT  active-hi        edge        3     0          2    0
                INT      conforms    conforms        3     1          2    1
                INT      conforms    conforms        3     0          2    2
                INT      conforms    conforms        3     3          2    3
                INT      conforms    conforms        3     4          2    4
                INT      conforms    conforms        3     5          2    5
                INT      conforms    conforms        3     6          2    6
                INT      conforms    conforms        3     7          2    7
                INT      conforms    conforms        3     8          2    8
                INT      conforms    conforms        3     9          2    9
                INT      conforms    conforms        3    10          2   10
                INT      conforms    conforms        3    11          2   11
                INT      conforms    conforms        3    12          2   12
                INT      conforms    conforms        3    14          2   14
                INT      conforms    conforms        3    15          2   15
                INT      conforms    conforms        0  13:A          2   16
                INT      conforms    conforms        0  14:D          2   16
                INT      conforms    conforms        0  16:B          2   16
                INT      conforms    conforms        1   0:A          2   16
                INT      conforms    conforms        2   6:C          2   16
                INT      conforms    conforms        2   9:D          2   16
                INT      conforms    conforms        0  13:B          2   17
                INT      conforms    conforms        0  14:A          2   17
                INT      conforms    conforms        0  16:C          2   17
                INT      conforms    conforms        1   0:B          2   17
                INT      conforms    conforms        2   6:D          2   17
                INT      conforms    conforms        2   9:A          2   17
                INT      conforms    conforms        0  13:C          2   18
                INT      conforms    conforms        0  14:B          2   18
                INT      conforms    conforms        0  16:D          2   18
                INT      conforms    conforms        2   6:A          2   18
                INT      conforms    conforms        2   9:B          2   18
                INT      conforms    conforms        2  10:A          2   18
                INT      conforms    conforms        2  14:A          2   18
                INT      conforms    conforms        0   7:D          2   19
                INT      conforms    conforms        0  13:D          2   19
                INT      conforms    conforms        0  14:C          2   19
                INT      conforms    conforms        0  16:A          2   19
                INT      conforms    conforms        0  17:A          2   19
                INT      conforms    conforms        2   6:B          2   19
                INT      conforms    conforms        2   9:C          2   19
--
Local Ints:     Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#
                ExtINT  active-hi        edge        3     0        255    0
                NMI     active-hi        edge        3     0        255    1

-------------------------------------------------------------------------------

# SMP kernel config file options:


# Required:
options         SMP                     # Symmetric MultiProcessor Kernel
options         APIC_IO                 # Symmetric (APIC) I/O

# Optional (built-in defaults will work in most cases):
#options                NCPU=2                  # number of CPUs
#options                NBUS=4                  # number of busses
#options                NAPIC=1                 # number of IO APICs
#options                NINTR=41                # number of INTs

===============================================================================



And here is the simple program to demonstrate the panic:

#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#include <aio.h>
#include <string.h>
#include <errno.h>

#define BUFLEN 4096

char * progname;


int main ( int argc, char * argv [] )
{
  int rc, fd;
  char buf [ BUFLEN ];
  char * fname;
  int done;
  aiocb_t cb = { 0 };
  long long unsigned int pollcount;

  progname = rindex ( argv[0], '/' );
  if (progname == NULL)
    progname = argv[0];
  else
    progname++;

  if (argc != 2) {
    fprintf ( stderr, "Usage: %s InputFile\n", progname );
    exit(1);
  }

  fname = argv[1];

  fd = open ( fname, O_RDONLY );
  if (fd < 0) {
    fprintf ( stderr, "%s: can't open %s for reading: %s\n",
              progname, fname, strerror(errno) );
    exit(1);
  }

  cb.aio_fildes = fd;
  cb.aio_offset = 0;
  cb.aio_buf = buf;
  cb.aio_nbytes = BUFLEN;

  done = 0;
  while (!done) {
    rc = aio_read ( &cb );
    if (rc) {
      fprintf ( stderr, "%s: aio_read(): %s\n", progname, strerror(errno) );
      exit(1);
    }
    fprintf ( stderr, "%s: aio_read() OK, polling for completion ...\n", 
              progname );
    pollcount = 0;
    while (aio_error(&cb)==EINPROGRESS)
      pollcount++;
    fprintf ( stderr, "%s: polling completed, count = %qu\n", 
              progname, pollcount );
    rc = aio_return ( &cb );
    if (rc < 0) {
      fprintf ( stderr, "%s: aio_return([read]): %s\n", 
                progname, strerror(errno) );
      exit(1);
    }
    else if (rc == 0) {
      done = 1;
    }
    else {
      cb.aio_offset += rc;
    }
  }

  return 0;
}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902031932.OAA01903>