python-ibmdb: ibm_db on MacOS Monterey Beta causes C malloc crash

Running the following method on MacOS Monterey:

conn = ibm_db.connect(db_host, "", "")

will cause ANY Python version to crash with the following error:

Python(35879,0x1101f6600) malloc: *** error for object 0x7ffb5ea1a120: pointer being freed was not allocated
Python(35879,0x1101f6600) malloc: *** set a breakpoint in malloc_error_break to debug

This is specific to macOS Monterey, the issue only started happening when upgrading my OS.

I have tested on Python 3.8, 3.9, and 3.10 beta. Currently the latest: ibm-db~=3.0.4.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

Using: export DYLD_LIBRARY_PATH=/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/clidriver/lib:$DYLD_LIBRARY_PATH

and

export DYLD_LIBRARY_PATH=/usr/local/Caskroom/miniconda/base/envs/py38/lib/python3.8/site-packages/clidriver/lib:$DYLD_LIBRARY_PATH

fixed the issue for me

I had a discussion with @davidg42 the other day and did some investigation on the same.

Can we ask the users to find the clidriver path and then set the DYLD_LIBRARY_PATH environment variable to <clidriver/lib> path.

So I would ask @jamsden @edumorlom Can you set the path export DYLD_LIBRARY_PATH=<clidriver_PATH>/lib:$DYLD_LIBRARY_PATH and then try running the application.

In case you want to find where the clidriver is installed you can run pip3 --version command to find the site-packages folder and the clidriver would be inside the site-packages folder.