Subject: Solaris emulation, pmap botches, panics
To: None <port-sparc@NetBSD.ORG>
From: Greg Hudson <ghudson@mit.edu>
List: port-sparc
Date: 10/01/1995 00:39:35
We're having some trouble with Solaris emulation on a Sparc IPX using
-current sources (as of a couple of days ago).

First, we get a lot of pmap botches when we run Solaris binaries.  I
modified the pmap botch message to display the actual address and the
result of vm_object_prefer(), and discovered that most of the
MAP_FIXED mmap()s were resulting in pmap botches (on an execution of
Solaris /bin/sh, which is statically linked but which appears to open
a few libraries dynamically).  I can provide traces of Solaris
programs to show how they're using mmap during dynamic linking;
apparently they like to unmap and remap files around a lot.

In June, pk wrote about pmap botches:
> This happens when a process requests a file to be mmap'ed at a fixed
> address - either explicitly by using MAP_FIXED or implicitly because
> of a execve() - while that file is already mapped at another virtual
> address (somewhere, maybe in another process) which is not congruent
> modulo the cache distance.

If these messages report a problem with optimality but not
correctness, should the pmap_botch error be inside #ifdef DIAGNOSTIC?

Anyway, more serious is the alignment fault panics we get if we run
the Solaris /bin/ls in a UFS directory.  (It doesn't seem to panic a;;
tje time, although it displays double entries... maybe it's just a
matter of luck with regard to the contents of the current directory.)
It's a little hard to debug this, since the traceback we get from ddb
only goes back as far as trapbase().  The panic message is:

	panic: alignment fault

The traceback is:

	_trap(7,90908c0, f80de238, f9b0adb0, 4073ac0, 65ca5ac) at trap+0x210
	_trapbase(40c69d8, 10266, 60, 3010266, f7fff574, 0) + 0x249c

Is this a known problem?  I can send a pr if people would like, and I
guess I can try stepping through svr4_getdirentries to see if that
yields anything interesting.