Skip to content
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

iOS: Should fail gracefully when JIT is not available #14196

Open
hrydgard opened this issue Feb 21, 2021 · 4 comments
Open

iOS: Should fail gracefully when JIT is not available #14196

hrydgard opened this issue Feb 21, 2021 · 4 comments

Comments

@hrydgard
Copy link
Owner

hrydgard commented Feb 21, 2021

Currently, when JIT is selected but unavailable on iOS (that means, not running from the debugger, as of iOS 14.4), the app just crashes and instantly exits. This is not ideal as it's confusing for users what happened. We should probably just automatically switch to IR interpreter instead, and maybe display a message.

(A minor challenge when fixing this will be that logging is not available when the debugger isn't attached, AFAIK....)

@hrydgard hrydgard added this to the v1.12.0 milestone Feb 21, 2021
@unknownbrackets
Copy link
Collaborator

You can use the web debugger to get logging, although that won't work until after you connect.

-[Unknown]

@hrydgard
Copy link
Owner Author

hrydgard commented Feb 21, 2021

Yeah, that does seem to work. Don't know why I keep forgetting that one.

Anyway, it's kinda weird - it seems to happily allow you to mmap and mprotect memory as EXEC, no bad return codes, it just blows up as soon as you try to execute anything. So it seems to be hard to detect, unless I'm missing something of course. Maybe a fork() would do it.

I think I'm just gonna have it check for iOS 14.3 or higher, and block attempts to use JIT if the debugger isn't attached (which we do seem to be able to detect).

@unknownbrackets
Copy link
Collaborator

Is this "resolved" now, given comments in #14240?

-[Unknown]

@hrydgard
Copy link
Owner Author

I think there are still combinations of states between jailbroken and jit that we don't handle exactly right because we can't detect whether we can execute code or not reliably. although I'm quite thoroughly confused about it all at this point..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants