uWebSockets: Memory allocation error - incorrect checksum for freed object
Description
Memory allocation errors occur when launching 100 servers that do not appear when launching 10 servers in the same configuration.
- OS: Mac OS 10.14
- Node: Homebrew v10.15.2
Code to reproduce
https://github.com/bunchtogether/braid-server/blob/master/tests/peers-ring.test.js
(Apologies, I have been unable to reproduce in a simpler example.)
Output
node(65675,0x1091595c0) malloc: Incorrect checksum for freed object 0x104819200: probably modified after being freed.
Corrupt value: 0x1baffed00baffedf
node(65675,0x1091595c0) malloc: *** set a breakpoint in malloc_error_break to debug
Extended Description
The Braid application syncs key-value pairs between a small network of peers and a larger network of read-only subscribers. All communication between the peer and subscriber processes occurs over WebSockets.
In this test 100 uWebSocket servers are created and linked in a ring using ws, i.e. peer A opens a connection to peer B, peer B opens a connection to peer C, peer C opens a connection to peer A.
When the test is reduced to 10 uWebSocket servers the error does not occur.
Thanks
Thanks for the great work and let me know if there is any additional information I can provide.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17
Commits related to this issue
- Malloc tests for https://github.com/uNetworking/uWebSockets/issues/871 — committed to bunchtogether/braid-server by wehriam 5 years ago
Chiming in with something sort of relevant: I started watching this issue because it’s similar to an error I’m coming across. I have a C addon that I wrote for Node, but I’m only using Mocha for my test framework. I also only get the error when running my tests. Practice samples seem to work fine.
I’m starting to think that it may be a problem related to mocha with native addons. Mocha is a dependency of Jest, so could be relevant?