-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Cannot allocate write+execute memory on M1 Mac #16907
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
Comments
packaging |
HI @fengzhou-msft could you pls help to look at it? is it related to cryptopgraphy upgradign? thanks |
It appears to be coming from PyOpenSSL itself. |
hey man , i also have this problem when i using the command mitmproxy. can you give me any idea to fix this ? thank you very much ! |
@yiyongheng I don't have a solution. I'm not using azure-cli on my M1 mac (it was just a test) thus I did not spent more time. But this is an issue with pyopenssl. The fix would be to either stop using pyopenssl or to "fix" it, but I don't have enough knowledge to do one or another. Ideally fixing pyopenssl would be best because it would benefit every software using it. Maybe you could run azure-cli using rosetta ? |
@jeromepin, thanks for reporting this issue and the investigation. Azure CLI has not been tested on M1 Mac. Once pyca/pyopenssl#873 is fixed, we will bump |
Describe the bug
When running an
az
command, it triggers a MemoryError on a M1 Mac :Full stack trace
ERROR: The command failed with an unexpected error. Here is the traceback: ERROR: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute raise ex File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 727, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_job six.reraise(*sys.exc_info()) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/six.py", line 693, in reraise raise value File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 698, in _run_job result = cmd_copy(params) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 331, in __call__ return self.handler(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/__init__.py", line 816, in default_command_handler return op(**command_args) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/command_modules/profile/custom.py", line 154, in login subscriptions = profile.find_subscriptions_on_login( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/_profile.py", line 210, in find_subscriptions_on_login subscriptions = subscription_finder.find_from_service_principal_id( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/_profile.py", line 899, in find_from_service_principal_id token_entry = sp_auth.acquire_token(context, resource, client_id) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/azure/cli/core/_profile.py", line 1211, in acquire_token return authentication_context.acquire_token_with_client_credentials(resource, client_id, self.secret) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/adal/authentication_context.py", line 179, in acquire_token_with_client_credentials return self._acquire_token(token_func) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/adal/authentication_context.py", line 128, in _acquire_token return token_func(self) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/adal/authentication_context.py", line 177, in token_func return token_request.get_token_with_client_credentials(client_secret) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/adal/token_request.py", line 312, in get_token_with_client_credentials token = self._oauth_get_token(oauth_parameters) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/adal/token_request.py", line 112, in _oauth_get_token return client.get_token(oauth_parameters) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/adal/oauth2_client.py", line 263, in get_token resp = requests.post(token_url.geturl(), File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 116, in post return request('post', url, data=data, json=json, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 597, in urlopen httplib_response = self._make_request(conn, method, url, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn conn.connect() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 330, in connect self.ssl_context = create_urllib3_context( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 283, in create_urllib3_context context.verify_mode = cert_reqs File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 413, in verify_mode self._ctx.set_verify( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/OpenSSL/SSL.py", line 1028, in set_verify self._verify_helper = _VerifyHelper(callback) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/OpenSSL/SSL.py", line 331, in __init__ self.callback = _ffi.callback( MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks To open an issue, please run: 'az feedback'az
worked for a few hours. Now I cannot run any command.az login
works but still raises this error.az feedback
too, as any other subcommand.To Reproduce
Run any
az
command, evenaz --version
.Expected behavior
Being able to run any command
Environment summary
az --version
doesn't work). I had to compilecryptography
myself.Unused
memory is kind of low, but it happened with 250M unused too.Maybe it's an issue with OpenSSL itself, but I cannot understand why it worked until then.
It works for a little while after a reboot but ends up failing again soon after.
The text was updated successfully, but these errors were encountered: