Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2001 08:08:41 -0800 (PST)
From:      Kenneth Stailey <kstailey@yahoo.com>
To:        freebsd-scsi@FreeBSD.ORG
Subject:   does the Advansys SCSI driver corrupt kernel memory?
Message-ID:  <20011130160841.31277.qmail@web10001.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
My system will sometimes panic during startup with page fault in kernel mode. 
Even more often than that SIGVTALRM and/or SIGPROF kill programs that have not
set any interval timers.  What's more I wrote a test program to just call
getitimer(2) and print what it finds.  On a system without Advansys SCSI I get
all zeros which is correct.  On my system with Advansys SCSI I get random
non-zero values back.  Bad hardware?  Boots and runs Windows 95 and
OpenBSD like a champ.  To top it off I modified kern_exec.c to bzero() the
interval timers and the problem vanished.

IMHO these problem reports have not been fixed:

http://www.freebsd.org/cgi/query-pr.cgi?pr=23460
http://www.freebsd.org/cgi/query-pr.cgi?pr=23505
http://www.freebsd.org/cgi/query-pr.cgi?pr=24401

I wrote the people who submitted the bug reports and one of them replied saying
that he eventually gave up and installed a different host adaptor.

FreeBSD hermes 4.3-RELEASE FreeBSD 4.3-RELEASE #11: Sat Nov 17 14:00:50 EST
2001     kstailey@XXXXXX:/usr/src/sys/compile/HERMES  i386

Yes, GENERIC has the same problem.

kernel patch:

--- kern_exec.c.DIST    Sat Nov 17 13:50:49 2001
+++ kern_exec.c Sat Nov 17 14:00:45 2001
@@ -40,6 +40,7 @@
 #include <sys/imgact_elf.h>
 #include <sys/wait.h>
 #include <sys/proc.h>
+#include <sys/resourcevar.h>   /* XXX kludge around memory corruption */
 #include <sys/pioctl.h>
 #include <sys/malloc.h>
 #include <sys/namei.h>
@@ -354,6 +355,9 @@
                p->p_args->ar_length = i;
                bcopy(imgp->stringbase, p->p_args->ar_args, i);
        }
+
+       /* XXX kludge around memory corruption */
+       bzero(p->p_stats->p_timer, sizeof(p->p_stats->p_timer));
 
 exec_fail_dealloc:

--------

test program:

#include <sys/time.h>
#define ITIMER_REAL      0
#define ITIMER_VIRTUAL   1
#define ITIMER_PROF      2

#include <stdio.h>

main()
{
  struct itimerval itv;

  if (getitimer(ITIMER_VIRTUAL, &itv) < 0) {
    perror("getitimer VIRTUAL");
    exit(1);
  }
  printf("itv.it_interval.tv_sec = %d\n", itv.it_interval.tv_sec);
  printf("itv.it_interval.tv_usec = %d\n", itv.it_interval.tv_usec);
  printf("itv.it_value.tv_sec = %d\n", itv.it_value.tv_sec);
  printf("itv.it_value.tv_usec = %d\n", itv.it_value.tv_usec);

  if (getitimer(ITIMER_PROF, &itv) < 0) {
    perror("getitimer PROF");
    exit(1);
  }
  printf("itv.it_interval.tv_sec = %d\n", itv.it_interval.tv_sec);
  printf("itv.it_interval.tv_usec = %d\n", itv.it_interval.tv_usec);
  printf("itv.it_value.tv_sec = %d\n", itv.it_value.tv_sec);
  printf("itv.it_value.tv_usec = %d\n", itv.it_value.tv_usec);
}


__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

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




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