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
received SIGSEGV when GC #550
Comments
Can you create a reduced stand-alone test case? Preferably something that's 50 lines or less. |
I think the bug is that your item's char in producer.create is allocated with |
Yes, either that, or a static address is being passed to the function and then free gets called on that. A further difference is that NewBuffer takes ownership of the pointer it was passed. On March 26, 2016 12:12:55 PM GMT+02:00, "Mathias Küsel" notifications@github.com wrote:
|
Thank you @bnoordhuis, you may do like this:
I can reappear this issue in this way all the time. |
Thank you @mathiask88 @kkoopa The producer and consumer are different process, The
only used in Consumer. And Consumer's ItemType is not the same with Produer's
Only used in Consumer, not Producer.
I create ItemType in this pop function, is there anything wrong in pop
|
As you seem to have noticed, you can use |
yes, @kkoopa but It seems that use with glace RES increase from 100M to 1G.
I'm not sure how to handle The
The val's mv_data will pass to NewBuffer/CopyBuffer, and the val's mv_data's value comes from lmdb's
|
@zwb-ict I'm also writing a node module based on LMDB. The data returned by LMDB is owned by LMDB and you should not try to I had a similar issue and also thought that the empty |
Thank you @bnoordhuis @mathiask88 @kkoopa This issue has solved. I add an empty FreeCallBack as NewBuffer's param. The pointer which passed to NewBuffer is from lmdb's B+ tree. So It shouldn't be free/delete. @kkoopa The memory leak is caused by http's keep-alive. (setup too many). |
Thank you @Venemo, you are right. I found the memory leak's real reason is my program opens too many keepalive sockets. |
@zwb-ict By the way, if you have questions about how to deal with LMDB, you can join us in the |
@Venemo That's great! Happy to join you! |
@Venemo @bnoordhuis @mathiask88 @kkoopa Would you please review my code if you have time? I'm a junior engineer, and want to write code better. Please Let me know my bad design and implement. I want to impl a simple queue, which is similar with kafka, but lightweight. The meta db used to record procuder and consumers Topic1 (db)
The data db used to record real data. data file1 (db)
The Consumer_%s is string,dataDBFileIndex is uint32, and offset is uint64 So my compare func looks like:
My email is zwb.ict@gmail.com |
@zwb-ict First I have two suggestions for you:
Nobody likes to read undocumented code. Finally, this isn't the right place to ask for code reviews. Some people would even consider it rude. But since you look like a beginner, let me point you to a place for this. |
@Venemo Thank you very much and I'm so sorry to bother you. |
I update my old addon to support nan latest, update nodejs to v4.4.1. Run a while, got SIGSEGV when GC. I use valgrind and get the reason:
In my Code,
Before update, I use nan 1.8.3,and the old code is:
I diff nan 2.2.0 and nan 1.8.3's NewBuffer:
2.2.0:
1.8.3:
I cann't find anything wrong.
My addon http://github.com/zwb-ict/lmdb-queue
In master branch, ForDebug dir:
Can run
for ten min.
Then stop producer.js, just run
When GC, SIGSEGV will be received .
Mac OS seems OK.
This issue is on Centos 7
The text was updated successfully, but these errors were encountered: