From: Cyrus H. <ch...@bo...> - 2006-12-20 07:45:02
|
Ok, so here's another patch. All tests except exhaust.impure.lisp pass. Notes: 1. we no longer define USE_MACH_EXCEPTION_HANDLER, but rather define a feature :mach-exception-handler. and, come to think of it, my customize-target-features.lisp is probably not in the patch, so if you want to use this, you need to add that feature to your build, preferably via customize-target-features.lisp. 2. the problem with impure tests failing was due to fork not working. Well, fork was working, but it was forking a process with only one thread, the lisp thread, and no mach exception handling thread. There are two possible solutions here, one is to provide an sb-ext type function fork-process or some such that wraps forks and starts up the mach exception handling thread. the other, and the one I've taken, is to modify sb-posix such that fork spawns the mach exception handling thread. To do this, I've hacked up the define-call stuff such that it can take a c-name argument so the posix fork call becomes (define- call "posix-fork" :c-name "fork" ...) or something like that. And I made the formerly optional (or rest, I forget which) :largefile be :options :largefile. There are certainly other ways to do this, but this works. If anyone objects, please speak up. 3. the mach exception stuff generation stuff was cleaned up a little and moved into separate functions so that fork could call it 4. the one test that fails, exhaust.impure.lisp, fails when trying to push the context on the stack after we've run out of stack. we need to figure out how to error out gracefully from stack exhaustion in the mach exception handler, but everything else seems to be working, so far, although I've only really tried the tests. 5. threads - haven't gone there yet. I think this shouldn't be to bad, but we'll see. So, give it a whirl and let me know how it goes. Cyrus |