简体   繁体   中英

Malloc error when trying to run node js server due to ibm_db module

I have a nodejs application, and configured to run on port 5001. When I try to run the node server using node server.js , it throws me an malloc error like below

node(6080,0x1067aa600) malloc: *** error for object 0x7ffb503d2670: pointer being freed was not allocated
node(6080,0x1067aa600) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      node server.js

My machine configs are Processor - 2.4 GHz 8-Core Intel Core i9 Memory - 32 GB 2667 MHz DDR4

When I try to run this server, I do not run any other node server. I also checked all the processes running but nothing clashes with it. Maybe I am missing something. I tried running it on different ports as well, but i get the same error

My node.js version is v14.16.1

npm version is 6.14.12

Xcode version is 13.4.0.0.1.1651278267

The issue was not related with X code or node version but it was related to one the npm package I was using which was ibm_db and only if you have the mac monterey os.

Follow these step if you have this package installed to rectify the error.

  1. Delete ibm_db package from your project and delete package-lock.json as well.
  2. Install latest ibm_db package currently 2.8.1. Even if it does not resolve the error, do the last step.
  3. Go to node_modules/ibm_db/installer/clidriver/lib and rename the file libstdc++.6.dylib to anything like libstdc++.7.dylib

You can find detailed discussion here https://github.com/ibmdb/node-ibm_db/issues/824 https://github.com/ibmdb/node-ibm_db/issues/801

Hopefully the issue will be resolved. Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM