[erlang-questions] Erlang C-nodes crashed randomly with double free, memory corruption malloc messege
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 <
> Have you tried to run your c-node under valgrind.
> On 11/15/2016 08:32 PM, Silver Surfer wrote:
>> 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.
>> 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
>> by the c-node takes considerable amount of time which is more than the
>> 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
>> 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,
>> 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.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions