ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
190 stars 151 forks source link

Monterey 12.1 - Malloc error #824

Closed adamtanczos closed 2 years ago

adamtanczos commented 2 years ago

Hello I am facing an issue with ibm_db after upgrading to Monterey. App is crashing with the below error:

node(51601,0x10d13b600) malloc: *** error for object 0x7ffb4b021300: pointer being freed was not allocated
node(51601,0x10d13b600) malloc: *** set a breakpoint in malloc_error_break to debug

Node.js: 14.16.1 ibm_db: 2.8.1

Any help would be appreciated.

bimalkjha commented 2 years ago

@adamtanczos Its a new installation of ibm_db post OS upgrade or existing installation? If it is existing installation, then remove ibm_db and reinstall it. Thanks.

adamtanczos commented 2 years ago

It is a new installation. Also tried a fresh project with these versions, only ibm_db installed, and same issue comes up.

bimalkjha commented 2 years ago

@adamtanczos cd to ibm_db/installer/clidriver/lib directory and share the result of otool -L libdb2.dylib command. Thanks.

adamtanczos commented 2 years ago
otool -L libdb2.dylib 
libdb2.dylib:
        libdb2.dylib (compatibility version 0.0.0, current version 0.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0)
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
        /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
        @loader_path/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.25.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
        /usr/local/lib/gcc/8/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
bimalkjha commented 2 years ago

@adamtanczos Rename clidriver/lib/libstdc++.6.dylib and then try. If still see issue, copy /usr/lib/libstdc++.6.dylib to clidriver/lib and then try. Please update the result. Thanks.

bimalkjha commented 2 years ago

Also, add full path of clidriver/lib directory to DYLD_LIBRARY_PATH environment variable and then try like export DYLD_LIBRARY_PATH=full_path_of_ibm_db/clidriver/lib:$DYLD_LIBRARY_PATH. Thanks.

adamtanczos commented 2 years ago

@bimalkjha renaming clidriver/lib/libstdc++.6.dylib fixed the issue. Didn't have to copy from /usr/lib or set the DYLD_LIBRARY_PATH env. Thank you for the help

dorudumitru-hh commented 2 years ago

same issue here. fixed by renaming libstdc++.6.dylib

instakarlo commented 2 years ago

This happened to me also.. renamed "libstdc++.6.dylib" in node_modules/ibm_db to something like "libstdc++.7.dylib" worked.. but hopefully it can be fixed already without renaming the file

Im using ibm_db version 2.8.0