I want to debug my erlang project, and i have some problem in my work.
The goal of my project is playing a card game on internet. For now, i'm just running all the threads on the same machine (4 clients and the server), and i can't understand in deep about the correctness of my program.
First, if i put different breakpoints and then i go step by step to see what happening, my code seems working, but if i remove all the breakpoints some thread exit, with reason "terminated" or "killed". Maybe the reason is related to logic's thread, so:
- When a thread exit by reason "terminated" and when it exit by "killed"?
One very strange thing is that, when i remove all breakpoints, threads exit during the execution of:
io:format()
I want to post here the 2 descriptions about thread's end, because it doesn't explain a lot the exit's reason:
<0.215.0>
[exit, {terminated,[{io,format,[#Pid<Scopone@acero.120.0>,"Super election...~n,
[]],[]},{client,loop,5,[{file,"client.erl"},{line,74}]}]}]
comunication_core_manager:init(#Port<Scopone@acero.1303>, #Pid<Scopone@acero.213.0>)
<0.221.0>
[exit, {terminated,[{io,format,[#Pid<Scopone@acero.120.0>,"Super election...~n",[]],[]},
{client,loop,5,[{file,"client.erl"},{line,74}]}]}]
comunication_scheduler_manager:loop(#Port<Scopone@acero.1303>, #Pid<Scopone@acero.215.0>,
{state,{[],[]},{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},[],[],1,20})
Now my questions are:
- How i can get useful information about these descriptions?
- Why i get problems with io:format()? Maybe some deadlocks?
Of course every other suggestion in your opinion are appreciated, because i'm not a pro with debugging..
EDIT: all threads are started with spawn_link.