Subject: macppc port "unstable" in -current
To: None <port-macppc@netbsd.org>
From: Aymeric Vincent <Aymeric.Vincent@labri.fr>
List: port-macppc
Date: 01/01/2004 18:13:04
NetBSD/macppc -current is currently unstable. I didn't see a kernel
panic in a while, but a lot of programs dump core now and then.

I saw core dumps of sh, cron, and ld recently. Some of them were
signal 11, others were signal 4 (illegal instruction).

As such instability has been reported here a few weeks ago, and my
iBook runs very fine under 1.6.1 and MacOS X, I don't think it's a
hardware problem.


Does anyone have a hint as to what might have changed in the last
months that causes this?

Here are a few thoughts:

- signal trampolines
- top down VM
- PPC64 additions

My guess would be that somewhere somehow, a page is mistaken for
another or some cache is not invalidated when it should. This makes
the bug very hard to track (around one core dump every day during
intense CPU activity). As a data point, I had core dumps while
either using an on-disk filesystem or over NFS.

In order to track it down, I modified my kernel to drop into DDB in
"trap" before sending the SIGSEGV, but that leads me nowhere because I
can't seem to access user memory from DDB. Looking at the code for
copyin(), it seems like when such access is required, a segment
register is temporarily set up, so there is no easy way to look at
userland while in DDB.

Another problem is that we seem to loose track of what happened in
userland because the core dump points to an invalid stack frame and
the only information we have is the address at which the illegal
access was performed, but I'm afraid this address has ~nothing to do
with the actual problem.
Is it a bad idea to look at core dumps because they are generated when
the program is in a "signal handling" state, or could it be useful?

Could someone please help me with new hypotheses and/or hints on how
to use DDB to get useful information?
Or maybe everybody using -current on macppc to do a lot of compiles
have no problem at all?

Thanks,
 Aymeric