-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pubsub: Node process terminates "free(): double free detected in tcache 2" #212
Comments
I cannot do anything with that information. You'll have to minimize the problem to the base minimum, for instance you should try without Cluster and you have to stress the server to crash earlier than 24 hours |
This bug report is missing essentially everything to go by -> I have no idea what features you are using, SSL or not, Cluster or not, pub/sub or not, etc. It really only says "I crashed". I can't make anything of this. |
You're not even telling what version you are using. How do you expect me to even begin looking at this? |
Yeah I can see you need more info. uWebsockets 16.1 Seems like it might be due to websocket expiring - im running sockets that dont timeout (=0). I'll try and find more info in a trace when I have time. |
You need to provide exactly what you are doing. SSLApp or App, pub/sub or not, what functions you use, Cluster or not, etc. etc. Then, the best would be to build the binary with AddressSanitizer which will tell me exactly what happens with these kind of issues. I can tell you how to build with AddressSanitizer if you want to |
SSLApp Forgot to send backtrace too: #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 rtld_fini=, stack_end=0x7fffffffd908) at ../csu/libc-start.c:308 #15 0x000000000089ed85 in _start () Yes please tell me how to AddressSanitizer! Thanks! :) |
Btw (for others too) I setup a debug branch for testing/developing: And had to run:
Then in gdb:
|
You don't need gdb but you need preload with nodejs. I made changes to your build |
What you report in this bug is not the cause but rather the consequences, asan will report the cause with lots of info in text format |
Thanks mate found it: https://gist.github.com/dioptre/08fb3feb56e91f827a331de423d9103e For others who might get here (might be worthwhile to merge the debug branch in the main repo mate):
|
You are calling subscribe? |
Yes, I subscribe to a channel, but I haven't updated the pub yet (I do not use it yet). Since you fixed it I only added sockets to a set and have been using send to each using a for loop temporarily. Has worked fine up until recently but I've also had to move to SSL. Once a ws disconnects, I remove them from the set. I've commented all this set logic out so don't think that's interfering with it. I got another free error (looks like its trimtree): |
This also looks different (heap use after free): |
All of these are about pub sub. It makes sense, it is new and needs tests and more fixing |
OK let me know how I can help. I'll be removing all subscribe actions again for now. |
Also can test anytime you need after you make updates. |
Also can confirm once the subscribe is removed the system is stable. |
Perfect. Pubsub functions needs tests and some more testing |
This should be bug #222, could you check that? |
After about 24 hours I get this:
On Node
Aborted
free(): double free detected in tcache 2
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! XXX@0.0.1 debug:
DEBUG=* node index.js
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the XXX@0.0.1 debug script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
OS Linux 5.1.7
Node v10.15.3
Npm v6.12.0
13 verbose stack Exit status 134
13 verbose stack at EventEmitter. (/home/a/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess. (/home/a/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
Found this running gdb...
double free or corruption (fasttop)
Thread 1 "node" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) run index.js
The text was updated successfully, but these errors were encountered: