Subject: Core dumps now work



A while back, mw reported the following:

Bug:

Kernel core dumps sometimes lock up the system.  Savecore cannot find the core
image.

Fix:

*** sd.c	Sun Oct  3 23:40:40 1993
--- sd.c.old	Sun Oct  3 23:38:46 1993
***************
*** 1167,1175 ****
  		return (EINVAL);
  	if (dumplo + ctod(pages) > sc->sc_label.d_partitions[part].p_size)
  		pages = dtoc(sc->sc_label.d_partitions[part].p_size - dumplo);
! 	/* dej 3-Oct-93: Use the byte offset, not the page offset.  Previous code was
! 	   dumping CHIP RAM to the swap device!!! */
! 	maddr = ctob(lowram);
  	baddr = dumplo + sc->sc_label.d_partitions[part].p_offset;
  	/* scsi bus idle? */
  	if (!scsireq(&sc->sc_dq)) {
--- 1167,1173 ----
  		return (EINVAL);
  	if (dumplo + ctod(pages) > sc->sc_label.d_partitions[part].p_size)
  		pages = dtoc(sc->sc_label.d_partitions[part].p_size - dumplo);
! 	maddr = lowram;
  	baddr = dumplo + sc->sc_label.d_partitions[part].p_offset;
  	/* scsi bus idle? */
  	if (!scsireq(&sc->sc_dq)) {
-- 

Note: I was able to dump without locking up.  The above patch merely makes the
dump do the right thing so savecore works.  The problem was that maddr was
being set to the page offset.  As a byte offset, this was somewhere in CHIP
RAM, which skewed everything.  As a result, the kernel would dump 4MB of RAM
from a 2MB area.  It is possible that this overshot may have caused mw's
lockups.

--
David Jones, M.A.Sc student, Electronics Group (VLSI), University of Toronto
email: [email-masked], finger for more info