[erlang-questions] Erlang C-nodes crashed randomly with double free, memory corruption malloc messege

Silver Surfer <>
Tue Dec 6 10:57:25 CET 2016

Yes, I have tried valgrind; with valgrind the problem does not come.

On Wed, Nov 16, 2016 at 6:49 PM, Sverker Eriksson <
> wrote:

> Have you tried to run your c-node under valgrind.
> http://valgrind.org/.
> /Sverker
> On 11/15/2016 08:32 PM, Silver Surfer wrote:
>> Hi,
>> I have an application running on otp-19.0, where there is a single erlang
>> node and two c-nodes; several processes from erlang node continuously send
>> messages to the c-node servers. The c-node accepts a single connection and
>> process all the received messages (ERL_MSG-> ERL_REG_SEND, ERL_SEND) in
>> separate threads except ERL_TICK, ERL_ERROR etc.
>> So in the c-node main() a connection is accepted and all the messages are
>> received (erl_receive_msg), if the message is ERL_TICK, ERL_ERROR etc.
>> they
>> are dealt appropriately by freeing the memory, else if the message is
>> ERL_MSG then a thread is created and the message is passed to the thread
>> where it is processed and a reply is send using erl_send; this approach of
>> handling message through thread is taken as some of the operation
>> performed
>> by the c-node takes considerable amount of time which is more than the
>> tick
>> time (is there a better way to do this?).
>> Now out of the two c-nodes one is crashing randomly (10 times in 24Hrs,
>> more or less); both the c-nodes follows same architecture, only the
>> operations they perform are different. In most of the times the c-node
>> just
>> goes down without giving any error reason and in 2 or 3 cases it crashes
>> because of double free or memory corruption printer by malloc, the trace
>> back points to erl_receive_msg.
>> Another point observed is that, in the thread after erl_free_compound,
>> when
>> we look at the allocated blocks using erl_eterm_statistics(allocated,
>> freed), it is 0 most of the times but sometimes it is non zero value, i.e.
>> 9, 18, etc.
>> Any help is appreciated.
>> Greg
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161206/7a474120/attachment.html>

More information about the erlang-questions mailing list