Skip to content
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

Native crash when running npm test with node 6 #9

Closed
Pchelolo opened this issue Aug 16, 2016 · 2 comments
Closed

Native crash when running npm test with node 6 #9

Pchelolo opened this issue Aug 16, 2016 · 2 comments

Comments

@Pchelolo
Copy link
Contributor

That's weird, but I get a native crash simply by running npm test in the repository when using node.js 6.0.0. It's not completely clear where is it coming from, but here's a relevant part of the crash dump:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Application Specific Information:
abort() called
*** error for object 0x7f9602e014f0: pointer being freed was not allocated


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8f610f06 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff9cd414ec pthread_kill + 90
2   libsystem_c.dylib               0x00007fff9e9cb6e7 abort + 129
3   libsystem_malloc.dylib          0x00007fff8aef5041 free + 425
4   node-librdkafka.node            0x0000000109855578 RdKafka::ConfImpl::~ConfImpl() + 14 (rdkafkacpp_int.h:228)
5   node-librdkafka.node            0x0000000109849ffb NodeKafka::Connection::~Connection() + 67 (connection.cc:67)
6   node-librdkafka.node            0x000000010984fa36 NodeKafka::Producer::~Producer() + 14 (producer.cc:40)
7   node                            0x0000000107ddde43 v8::internal::GlobalHandles::DispatchPendingPhantomCallbacks(bool) + 163
8   node                            0x0000000107dde171 v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, v8::GCCallbackFlags) + 49
9   node                            0x0000000107deb35f v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) + 1871
10  node                            0x0000000107dea79d v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char const*, char const*, v8::GCCallbackFlags) + 717
11  node                            0x0000000107dae6bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) + 107
12  node                            0x0000000107ff31bb v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) + 139

Seems like the 'RdKafka::Conf' object deletion crashes internally - perhaps some of the properties were garbage-collected by v8?

@Pchelolo
Copy link
Contributor Author

Here's a minimalistic test case, run it with --expose_gc flag, with this test the version of node doesn't matter - it crashes anyway.

"use strict";
var Producer = require('bindings')('node-librdkafka').Producer;
new Producer({}, {});
global.gc();

@webmakersteve
Copy link
Contributor

Fixed with PR #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants