Skip to content

malloc(0) being called by node.js c-ares wrapper #392

@dhrumilrana

Description

@dhrumilrana

Here is an assert attached in the dependent code of c-ares for node.js. The assert is looking for a malloc(0) call, a wrapper function in c-ares wrapper file is responsible for the malloc(0) calls. I have provided the trace of the assert call for more information (what file and function is the culprit). Are there any suggestions for what could be done?

Assertion failed: size, file: ../deps/cares/src/ares_library_init.c, line: 54, function: default_malloc
 1: 0x28477D4C abort
 2: 0x278016E2 ares_parse_ptr_reply
 3: 0x277FD924 node::cares_wrap::(anonymous namespace)::ParseGeneralReply(node::Environment*, unsigned cha...)+0x116 [ZOSCAN2B:../src/cares_wrap.cc/:806]
 4: 0x2780BA3A node::cares_wrap::(anonymous namespace)::QueryAnyWrap::Parse(unsigned char*, int)+0xeb8 [ZOSCAN2B:../src/cares_wrap.cc/:1328]
 5: 0x2780B95E node::cares_wrap::(anonymous namespace)::QueryWrap::AfterResponse()+0x9e [ZOSCAN2B:../src/cares_wrap.cc/:635]
 6: 0x2786DF78 node::CallbackQueue<void, node::Environment*>::CallbackImpl<node::cares_wrap::(anonymous na...)+0x1a [ZOSCAN2B:../src/cares_wrap.cc/:698]
 7: 0x2786BA02 node::Environment::RunAndClearNativeImmediates(bool)::$_5::operator()(node::CallbackQueue<v...)+0x14c [ZOSCAN2B:../src/env.cc/:688]
 8: 0x2786AD00 node::Environment::RunAndClearNativeImmediates(bool)+0x226 [ZOSCAN2B:../src/env.cc/:701]
 9: 0x284C31C2 node::Environment::CheckImmediate(uv_check_s*)+0x194 [ZOSCAN2B:../src/env.cc/:841]
 10: 0x284965DE uv__run_check+0xd6 [ZOSCAN2B:../deps/uv/src/unix/loop-watcher.c/:67]
 11: 0x27A8DBDC uv_run+0x24a [ZOSCAN2B:../deps/uv/src/unix/core.c/:394]
 12: 0x278F0CF6 node::NodeMainInstance::Run()+0x2c0 [ZOSCAN2B:../src/node_main_instance.cc/:130]
 13: 0x2670CA0C node::Start(int, char**)+0x34a [ZOSCAN2B:../src/node.cc/:1284]
 14: 0x2673BAAC main+0xe0 [ZOSCAN2B:../src/node_main.cc/:153]
 15: 0x2673BECA CELQINIT+0x1a98 [CELQINIT:]
CEE5207E The signal SIGABRT was received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions