R A Smith - 2009-01-14

141=128+13 (at least under Linux) means a broken pipe occurred among
children of the shell running
an aegis test. This is what is reported when some aegis commands segfault.
The segfault itself is hidden lower down in the process chain, where
standard error has been diverted.

One way to debug aegis in cases like this:
1. Work in the dev. dir. of a change, and build an aegis binary to test.
2. Make the working aegis binary NOT setuid. (This allows for
core dumps and running under a debugger with consistent user ids and
permissions.)
3. Find or write an aegis test which illustrates the bug.
4. Perhaps set your core ulimit to allow a dump.
5. Run the test interactively, perhaps with a script like this:

#!/bin/sh
AEGIS_SEARCH_PATH=...
EXEC_SEARCH_PATH=...
export AEGIS_SEARCH_PATH EXEC_SEARCH_PATH
/bin/sh -x test/00/t0001a.sh

6. The "-x" lets you see the context of the segfault, and shows the
command line. Now you can fire up a debugger and find the problem,
either by examining the core file or rerunning the offending command.

If the bug you are working on depends on the userid-swapping, more
trickery is needed (I have not discovered a solution to this case).