-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sigreturn on macOS 10.14 Beta on functions including (quit) #146
Comments
I think I have a simple fix for the 1.12 development branch. If it seems stable there, I'll back-port it to 1.11.5 shortly. |
212c254 seems to fix 1.12-dev. I did some light testing on an old 10.6 system, and while it seems to work for the most part (i.e, it works to do
And for 32-bit:
Frankly, I am not much inclined to worry about this, even if I port 212c254 to 1.11.5. |
Hi,
Thanks! It works perfectly.
The comment in the change says 10.4 not 10.14. Right now we all know what it means, but, it might be confusing at some point :-)
cheers
bruce
… 212c254 seems to fix 1.12-dev.
I did some light testing on an old 10.6 system, and while it seems to work for the most part (i.e, it works to do (rebuild-ccl :clean t)), when I evaluate (quit), I see errors like this:
Clozure Common Lisp Version 1.12-dev (v1.12-dev.3-18-g212c2544) DarwinX8664 ? (quit) > Error: Fault during read of memory address #x0 > While executing: 0, in process listener(1). > Type :POP to abort, :R for a list of available restarts. > Type :? for other options. $
And for 32-bit:
Clozure Common Lisp Version 1.12-dev (v1.12-dev.3-18-g212c2544) DarwinX8664 ? (quit) > Error: Fault during read of memory address #x0 > While executing: 0, in process listener(1). > Type :POP to abort, :R for a list of available restarts. > Type :? for other options.
Frankly, I am not much inclined to worry about this, even if I port 212c254 to 1.11.5.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [view it on GitHub](#146 (comment)), or [mute the thread](https://github.com/notifications/unsubscribe-auth/AIl0oipqvXWZI6V-3u6LeFlxWPFZdJWWks5uWcbGgaJpZM4WVzgw).![](https://github.com/notifications/beacon/AIl0ot2txbM8iD3YUF6GeG_AWxXMI1VJks5uWcbGgaJpZM4WVzgw.gif)
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/Clozure/ccl","title":"Clozure/ccl","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #146: 212c254 seems to fix 1.12-dev.\r\n\r\nI did some light testing on an old 10.6 system, and while it seems to work for the most part (i.e, it works to do `(rebuild-ccl :clean t)`), when I evaluate `(quit)`, I see errors like this:\r\n```\r\nClozure Common Lisp Version 1.12-dev (v1.12-dev.3-18-g212c2544) DarwinX8664\r\n? (quit)\r\n\u003e Error: Fault during read of memory address #x0\r\n\u003e While executing: 0, in process listener(1).\r\n\u003e Type :POP to abort, :R for a list of available restarts.\r\n\u003e Type :? for other options.\r\n$ \r\n```\r\nAnd for 32-bit:\r\n```\r\nClozure Common Lisp Version 1.12-dev (v1.12-dev.3-18-g212c2544) DarwinX8664\r\n? (quit)\r\n\u003e Error: Fault during read of memory address #x0\r\n\u003e While executing: 0, in process listener(1).\r\n\u003e Type :POP to abort, :R for a list of available restarts.\r\n\u003e Type :? for other options.\r\n```\r\n\r\nFrankly, I am not much inclined to worry about this, even if I port 212c254 to 1.11.5.\r\n "}],"action":{"name":"View Issue","url":"#146 (comment)"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#146 (comment)", "url": "#146 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } }, { ***@***.***": "MessageCard", ***@***.***": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [Clozure/ccl] sigreturn on macOS 10.14 Beta on functions including (quit) (#146)", "sections": [ { "text": "", "activityTitle": "**R. Matthew Emerson**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": ***@***.***", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", ***@***.***": "ActionCard", "inputs": [ { "isMultiLine": true, ***@***.***": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"Clozure/ccl\",\n\"issueId\": 146,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"Clozure/ccl\",\n\"issueId\": 146\n}" }, { "targets": [ { "os": "default", "uri": "#146 (comment)" } ], ***@***.***": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 374814768\n}" } ], "themeColor": "26292E" } ]
|
It is beginning to look like it isn't safe to get rid of DarwinSigReturn on pre-Mojave systems. Things seem to work most of the time, but there are definitely issues. I'm going to quote some mail from openmcl-devel that shows some (fairly heavyweight) steps to reproduce:
My reply:
|
I'm also seeing crashes into the lisp kernel debugger when doing Example:
So I'm pretty sure that just getting rid of DarwinSigReturn is not the complete solution for Mojave, which is unfortunate. |
It seems that there's a third argument to the sigreturn system call on Mojave. From the _sigtramp disassembly, we see:
The High Sierra sigtramp doesn't put anything in %rdx. I have no idea what this extra argument is (and I don't see the Mojave sources on opensource.apple.com yet). https://trac.clozure.com/ccl/changeset/11565 is a breadcrumb. Other archaeology leads me to beleive that we're in this situation because (at one point at least) sigaltstack isn't (or wasn't) thread-local on Darwin. |
Another test case: On macOS Mojave (earlier macOS versions work as expected):
|
This exception (4 is SIGILL) is because the call to sigreturn in the sigtramp routine returned unexpectedly, and there's helpfully an illegal instruction there to catch that unexpected case. |
https://opensource.apple.com/release/macos-1014.html is now available (but they say "coming soon" for the sources for xnu-4903.201.2, which is probably what I really need to figure out what the third arg to sigreturn is.) |
Tue Dec 11 10:11:28 GMT 2018 bsd/dev/i386/unix_signal.c:
for cross references: tarball: |
Given the resources available and the complexity of the issue, I'd prioritize getting it to work on Mojave, and deprecate earlier versions of MacOS. If there's time to get it running in earlier versions, that's great. But the most important thing is getting it working on Mojave. |
I ran a 1.11.5 binary under a Mojave debug kernel. I got, as I feared I would, the following message:
After this debug message is printed, the sigreturn system call returns with an error code. The Mojave sources contain code to mitigate a class of attacks ("sigreturn oriented programming") described in, for example, https://dl.acm.org/citation.cfm?id=2650802. It seems that this mitigation breaks a technique that CCL has been using. update: link to PDF of paper in question: https://www.cs.vu.nl/~herbertb/papers/srop_sp14.pdf |
Thanks to some help from Apple DTS, I committed dd5622e, and this really does seem to make CCL compatible with macOS Mojave. |
dd5622e Seems to still work fine on OSX 10.9.5 in terminal mode and as a GUI app. |
Are we going to see the Mac App Store version of Clozure CL updated soon? I'm waiting for that since my attempts to build it from this repos + comments haven't worked. |
I just submitted an updated Mac App Store version of Clozure CL. It now has to get through app review. This seems to take about a week. It might take a little longer if the app review team identifies any issues that need to be corrected. I'll post a note when it is approved (as I hope it will be). |
On a beta machine, if I try:
I get a similar result trying to load quicklisp, although loading my own test file that just defines a simple function works fine.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: