Waldek Hebisch wrote:
Mirsad Todorovac wrote:
BUT THE GOOD NEWS is that there are no longer "Killed" error messages, so I think we've found the murderer: it was Linux's PAX kernel extension!
chpax has following options, so you will see why it could have affected nonlocal gotos:
-E emulate trampolines -e do not emulate trampolines -M restrict mprotect() -m do not restrict mprotect()
I wrote previously about nonlocal gotos. But now I think that the problem is with trampolines (problems with nonlocal gotos and trampolines are frequently related). Description of PAX extension makes clear that by default trampolines do not work if the extension is active, and the affected tests use trampolines. On other (non-Linux) platforms the compiler emits 'mprotect' calls to allows trampolines to work (on Linux trampolines are supposed to work even without 'mprotect' call). So, the best solution would be to modify gcc so that 'mprotect' gets called and to tell PAX to respect 'mprotect' calls.
I agree, and I hope the backend folks will do so. (Otherwise we could add backend patches in GPC again.)
In the meantime, it seems "-E" might help, or "-p". (You apparently did the latter, Mirsad, but the former might be less intrusive if it works.)
-P enforce paging based non-executable pages -p do not enforce paging based non-executable pages
The wrapper is simplistic, it still does something wrong. It does not work in all cases, and I can investigate, but I believe Frank will know immediatelly the solution, provided he has enough time ...
Not all tests use "a.out" for various reasons. I suppose Waldek's patch takes this into account already.
The wrapper:
p/test/gpc:
#/bin/bash -f
/usr/local/bin/gpc $*
Please use "$@" rather than $*. (This applis to almost all sh scripts, almost always, BTW.) "$@" leaves arguments as they are, $* does word-splitting which breaks options with spaces (e.g.).
Then add something like "|| exit $?", otherwise you discard GPC errors(*) (which leads to false positives, and false negatives in expected-fail tests). (This advice also applies to almost all shell scripts, almost always. ;-)
(*) Well, not entirely, as the test_sum script is somewhat more paranoid and checks error messages as well. But it's always a bad idea to discard the exit status of any program that may realistically fail (i.e., anything except /bin/true and "echo" ;-), especially if it's expected to fail sometimes.
Some time ago I modified test_run script to allow a runner program: instead of running test directly we would call runner program giving it the name of executable and the argument list. This was needed for testing cross-compilers (so that runner could launch apropriate emulator), in particular I used this to test djgpp and mingw ports (using dosemu and wine). I could probably dig out (or recreate) the patch, but I am not sure if such change is worth including in the standard version.
BTW, FWIW, I've always tested DJGPP by letting the whole test suite run in DosEmu (which is probably a bit faster as DosEmu doesn't have to be restarted each time), the same might apply to Mingw.
But I agree that in other situations, a runner can be useful (e.g. in Mirsad's case, or for cross-compilers -- when no emulator is available, one could even use a runner that transfers the executable to a remote machine and runs it there). So your patch seems useful for the standard distribution.
Frank