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
ibm_db crashing on M1 MacBook Pro when running inside VS Code #864
Comments
@jamsden What is the error that you are getting? Please paste the full error here. |
@jamsden Your vscode might be of arm64 version and not |
Since, point 1 and 2 is working fine, so there is no issue with ibm_db installation and using it. For point 3, google and check how to make DYLD_LIBRARY_PATH effective.
Thanks. |
Clarification in item 3: ibm_db only crashes in a Jupyter notebook run in VS code that is using a virtual environment. If the notebook kernel is set to an applicable python version (i.e., 3.9.13 using x86_64 architecture) it works fine. If you create a virtual environment with that same python version, ibm_db crashes because DYLD_LIBRARY_PATH is being striped out of the defined environment variables (i.e., in a .env file) in this case.
In the Jupyter notebook, LD_LIBRARY_PATH is defined in the environment, but DYLD_LD_LIBRARY path isn't its being stripped out possibly because of entitlements. Hope this helps. |
@jamsden How you installed jupyter in vscode? By looking on the crash log,
Thanks. |
I used the vs code marketplace to add python and Jupyter notebook support. The Jupyter I used was installed as part of the virtual environment. I assumed vs code could run in arm64 while executing a kernel that is x86_64, that seems to be the case. LD_LIBRARY_PATH was just an example environment variable I used to make sure .env was being read properly. I didn't expect it to have any impact on ibm_db. That's how I found DYLD_LIBRARY_PATH is being stripped out vs. not read at all. I'll try your suggestion to remove the dependency on DYLD_LIBRARY_PATH wit install_name_tool as soon as I can, that looks like a good possibility. |
@jamsden Let us know if install_name_tool has solved your issue? Thanks. |
Operating System Name: macOS 13.4.1
db2level output from clidriver if in use:
DB21085I This instance or install (instance name, where applicable: "*") uses
"64" bits and DB2 code release "SQL11058" with level identifier "0609010F".
Informational tokens are "DB2 v11.5.8.0", "special_26260",
"DYN2301190517MAC_26260", and Fix Pack "0".
Product is installed at
"/Users/jamsden/Library/CloudStorage/Box-Box/Users/jamsden/Developer/analytics/
venv/lib/python3.9/site-packages/clidriver"
Target Db2 Server Version:
Python Version: 3.9.13
ibm_db version: 3.1.4
For non-Windows, output of below commands:
uname # Darwin
uname -m # arm64
Value of below environment variables if set:
IBM_DB_HOME:
PATH:
LIB/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH:
PATH=/Users/jamsden/Library/CloudStorage/Box-Box/Users/jamsden/Developer/analytics/venv/lib/python3.9/site-packages/clidriver/bin:$PATH
DYLD_LIBRARY_PATH=/usr/local/lib/gcc/12:/Users/jamsden/Library/CloudStorage/Box-Box/Users/jamsden/Developer/analytics/venv/lib/python3.9/site-packages/clidriver/lib:$DYLD_LIBRARY_PATH
Test script to reproduce the problem.
For installation related issue, complete output of
pip install ibm_db
command.Steps to Reproduce:
code .
from that folderCannot execute code, session has been disposed. Please try restarting the Kernel.
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further deta
The result is None.
Likely cause: VS Code is not running in a hardened runtime, or does not have entitlements
com.apple.security.cs.disable-library-validation and com.apple.security.cs.allow-dyld-environment-variables set to true. So SIP is causing all DYLD_* environment variables to be stripped. Even if you set that environment variable in the notebook, SIP prevents it from being propagated to spawned processes. This is likely causing ibm_db to crash because of the missing libraries.
The text was updated successfully, but these errors were encountered: