node-ibm_db: Driver Issue with MacOS Monterey (not fault of node-ibm_db)

Hi, I don’t know if this is an issue with node-ibm_db and Monterey or if it is a db2 driver issue. If it is a driver issue, do you know where can I report it?

Problem description Whenever I execute the .open() method with a connection string nodejs fails with the following message

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

This happens even with the latest version of the package and freshly installed drivers.

Environment

  • The node version used is v14.18.1 (freshly installed from nvm)
  • Intel Macbook Pro 16
  • MacOS 12.0.1
  • GCC: Apple clang version 13.0.0 (clang-1300.0.29.3)

About this issue

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

Most upvoted comments

@bimaljha

@cpibm After your latest update, I think the issue got resolved due to installation of g++ and by looking on this stack again, the issue seems with the libstdc++.6.dylib library which is under ibm_db\installer\clidriver\lib directory. So, deleting ibm_db\installer\clidriver\lib\libstdc++.6.dylib should fix the issue. This libstdc++.6.dylib library seems older and not compatible with Monterey. When you installed g++, it installed libstdc++.6.dylib too and with your workaround, systems libstdc++.6.dylib is getting effective. Running otool -L libdb2.dylib should give info about from where libstdc++.6.dylib is getting picked up. So, you can delete or rename clidriver\lib\libstdc++.6.dylib post installation of ibm_db and run your test program. Thanks.

That did it 🥳 ! deleting the libstdc++.6.dylib library from ibm_db\installer\clidriver\lib fixes the issue. Thanks a lot for your help

Ok, this works, but does the mean we have to do this now each time ? or will there be some fix somewhere (in mac ? node ? or ibm_db ? ) thanks

@huineng @vuldin Removed clidriver\lib\libstdc++.6.dylib from clidriver. So, there should not be any issue for new installation now and below process should fix the issue for existing installation:

  1. uninstall ibm_db and reinstall it. OR,
  2. rm -rf ibm_db\installer\clidriver; cd ibm_db; npm install Thanks.

fyi i did a fresh install today (delete node_modules) and i still had to do the above…

Ok, this works, but does the mean we have to do this now each time ? or will there be some fix somewhere (in mac ? node ? or ibm_db ? ) thanks