Date: Sat, 30 Dec 1995 12:58:38 +1100 From: Bruce Evans <bde@zeta.org.au> To: creilly@maths.tcd.ie, freebsd-hackers@FreeBSD.ORG Subject: Re: Linux emulator and Mathematica. Message-ID: <199512300158.MAA07930@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>Using a vanilla 2.1R installation: >I've been trying to make Linux Mathematica using a network license,run >under the linux emulator, and after adding a trivial implementation of >... >The problem now is that mathclient crashes. Looking at the syslog output >and the system calls, it would appearing to be crashing on a sigreturn: > 791 mathclient CALL sigreturn(0xefbfc0e0,0xe,0) > 791 mathclient RET sigreturn -1 errno 1 Operation not permitted > 791 mathclient PSIG SIGBUS SIG_DFL > 791 mathclient NAMI "mathclient.core" >The signal it is responding to is a sigalarm. >Now, from my reading of the sigreturn stuff and the Design and Implementation of >4.3BSD, it would seem that what is happening is that the sigreturn is trying The Linux sigreturn() isn't fully implemented in the Linux emulator. It returns ENOSYS. The problem here is probably quite different. Few applications call sigreturn() directly. It is normally called as part of returning from a signal handler. The kernel builds a signal trampoline with a sigreturn() syscall at the end of it. The Linux emulator should replace the code that builds the trampoline so that the syscall is the Linux sigreturn() and not the BSD sigreturn(). It should also convert the BSD sigcontext struct to the Linux sigcontext sigcontext struct. It doesn't do this, so the Linux syscall that happens to have the same number as the BSD sigreturn (#103 = Linux syslog()) is called instead. This is fudged to work by breaking the Linux syslog() by pretending that it is the Linux sysreturn(). >to restore some part of the state that it is not permitted to manipulate. Would >this seem reasonable to the kernel experts out there? One problem with this Yes, it's quite likely that Mathematica is sophisticated enough to manipulate the signal context. Since the sigcontext struct is incompatible, this is unlikely to work, and could easily attempt to change a protected register. However, this should result in errno EINVAL, not EPERM. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512300158.MAA07930>