<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hi Chandru-</div>

<div> </div>

<div>thank you for the info. You are absolutely right that there were tables open.</div>

<div> </div>

<div>Not because I wasn't closing them, the code seemed correct.</div>

<div>It was the fact that I wasn't checking the return of des:close which was failing due to ownership.</div>

<div> </div>

<div>
<div>Thank you so much!!!</div>

<div> </div>

<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div class="gmail_quote"><b>Sent:</b> Tuesday, August 18, 2015 at 3:27 AM<br/>
<b>From:</b> Chandru <chandrashekhar.mullaparthi@gmail.com>

<div>I doubt it is caused by dets_server. dets_server seems to be a "well behaved" process. It is a gen_server which traps exits, and the terminate function gets called when you shutdown the node using q(). My hunch is that you are not closing all your dets files. </div>

<div> </div>

<div>Not sure if you realise, multiple processes can open the same dets file concurrently and dets maintains a reference count. The reference count has to go down to zero before the process for the dets file gets shutdown gracefully.</div>

<div> </div>

<div>supervisor:which_children(dets_sup).</div>

<div> </div>

<div>should tell you if there are any pending dets processes.</div>

<div> </div>

<div>cheers,</div>

<div>Chandru</div>

<div> </div>

<div> </div>

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div> </div>

<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Sent:</b> Friday, August 14, 2015 at 8:52 AM<br/>
<b>From:</b> "Sid Muller" <<a href="sid5@gmx.us" target="_parent">sid5@gmx.us</a>><br/>
<b>To:</b> Chandru <<a href="chandrashekhar.mullaparthi@gmail.com" target="_parent">chandrashekhar.mullaparthi@gmail.com</a>><br/>
<b>Cc:</b> erlang-questions <<a href="erlang-questions@erlang.org" target="_parent">erlang-questions@erlang.org</a>><br/>
<b>Subject:</b> Re: [erlang-questions] ** exception exit: shutdown</div>

<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div>I'm using erlang 18.0, on ubuntu 14. It was also happening with 17.5, I'm running my own application which has been working fine for months. This issue showed up after I added code to open dets files, I do close all the dets files before I quit my application.</div>

<div> </div>

<div>I ran the commands you suggested below but interestingly there is no more info with it, matches your lines up untill the point it's supose to print what went wrong but then nothing...., so frustrating:</div>

<div> </div>

<div>
<div>3> whereis(init).<br/>
<0.0.0><br/>
4> dbg:tracer().<br/>
{ok,<0.5341.0>}<br/>
5> dbg:p(whereis(init), [s,r]).<br/>
{ok,[{matched,nonode@nohost,1}]}<br/>
6> q().<br/>
(<0.0.0>) << {stop,stop}<br/>
(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}<br/>
ok<br/>
** exception exit: shutdown<br/>
7> (no error logger present) error: <0.5341.0></div>

<div>sidm@test:~/src/proj$<br/>
 </div>
</div>

<div> 
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Sent:</b> Thursday, August 13, 2015 at 2:55 PM<br/>
<b>From:</b> Chandru <<a href="chandrashekhar.mullaparthi@gmail.com" target="_parent">chandrashekhar.mullaparthi@gmail.com</a>><br/>
<b>To:</b> "Sid Muller" <<a href="sid5@gmx.us" target="_parent">sid5@gmx.us</a>><br/>
<b>Cc:</b> erlang-questions <<a href="erlang-questions@erlang.org" target="_parent">erlang-questions@erlang.org</a>><br/>
<b>Subject:</b> Re: [erlang-questions] ** exception exit: shutdown</div>

<div>
<div>
<div>Which version of erlang are you using? What OS? Trying it on OS X, the node dies quietly. Not entirely sure why you are seeing the "exception exit" message. Did you have any processes running before you invoked q()? Basically the node shutdown procedure is being invoked, and all your processes get killed.</div>

<div> </div>

<div>Functions you type in the shell are defined in shell_default.erl.</div>

<div> </div>

<div>shell_default:q/0 is defined as:</div>

<div>
<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;"> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;"><span style="color: rgb(94,52,255);">q</span>()             -><span style="color: rgb(94,52,255);"> </span><span style="color: rgb(53,163,39);">c</span>:<span style="color: rgb(53,163,39);">q</span>().</p>
</div>

<div> </div>

<div>c:q/0 is defined as:</div>

<div> </div>

<div>
<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;color: rgb(124,124,166);">-spec<span style="color: rgb(0,0,0);"> </span><span style="color: rgb(53,163,39);">q</span><span style="color: rgb(0,0,0);">() -></span><span style="color: rgb(94,52,255);"> </span>no_return<span style="color: rgb(0,0,0);">().</span></p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;min-height: 13.0px;"> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;"><span style="color: rgb(94,52,255);">q</span>() -></p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">    <span style="color: rgb(53,163,39);">init</span>:<span style="color: rgb(53,163,39);">stop</span>().</p>
</div>

<div> </div>

<div>If you turn tracing on for the init process to see what happens.</div>

<div> </div>

<div>
<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">$ ~/erlang/R17-5/bin/erl</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;min-height: 13.0px;"> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">Eshell V6.4  (abort with ^G)</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">1> whereis(init).</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;"><0.0.0></p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">2> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">2> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">2> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">2> dbg:tracer().</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">{ok,<0.35.0>}</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">3> dbg:p(whereis(init), [s,r]).</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">{ok,[{matched,nonode@nohost,1}]}</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">4> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">4> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">4> q().</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">(<0.0.0>) << {stop,stop}</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">ok</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">5> (no error logger present) error: "Error in process <0.35.0> with exit value: {badarg,[{io,format,[user,\"** dbg got EXIT - terminating: ~p~n\",[{trace_handler_crashed,{badarg,[{io,format,[user,\"(~p) << ~p~n\",[<0.0.0>,{'EXIT',<0.7.0>,shutdown}]],[]},{dbg,dhandler1,3,[{file,\"dbg.erl\"},{line,983}]},{dbg,invoke_handler... \n"</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;"> </p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;">Chandru</p>

<p style="margin: 0.0px;font-size: 11.0px;font-family: Menlo;"> </p>
</div>
</div>

<div class="gmail_extra"> 
<div class="gmail_quote">On 13 August 2015 at 16:26, Sid Muller <span><<a>sid5@gmx.us</a>></span> wrote:

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">Hi,<br/>
<br/>
does anyone have any pointers on how to debug an exception exit in shell?<br/>
<br/>
When I type q(). into the shell I get this:<br/>
<br/>
3> q().<br/>
ok<br/>
** exception exit: shutdown<br/>
4> sidm@test:~/src/proj$<br/>
<br/>
<br/>
The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?<br/>
<br/>
_______________________________________________<br/>
erlang-questions mailing list<br/>
<a>erlang-questions@erlang.org</a><br/>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________ erlang-questions mailing list <a href="erlang-questions@erlang.org" target="_parent">erlang-questions@erlang.org</a> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div></div></body></html>