<div dir="ltr"><div><font face="verdana, sans-serif">Hi,<br>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 </font><span style="font-family:verdana,sans-serif">continuously </span><font face="verdana, sans-serif">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_<wbr>ERROR etc.</font></div><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">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?). </font></div><div><span style="font-family:verdana,sans-serif"><br></span></div><div><font face="verdana, sans-serif">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 </font><span style="font-family:verdana,sans-serif">erl_receive_msg.</span></div><div><span style="font-family:verdana,sans-serif"><br></span></div><div><span style="font-family:verdana,sans-serif">Another point observed is that, in the thread after </span><font face="verdana, sans-serif">erl_free_compound, when we look at the allocated blocks using erl_eterm_statistics(<wbr>allocated, freed), it is 0 most of the times but sometimes it is non zero value, i.e. 9, 18, etc.</font></div><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">Any help is appreciated. </font></div><div><br></div><div>Greg</div><img id="gmail-:0_3" name=":0" src="https://ssl.gstatic.com/ui/v1/icons/mail/no_photo.png" class="gmail-ajn gmail-bofPge"></div>