** exception exit: shutdown

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

** exception exit: shutdown

Sid Muller
Hi,

does anyone have any pointers on how to debug an exception exit in shell?

When I type q(). into the shell I get this:

3> q().          
ok
** exception exit: shutdown
4> sidm@test:~/src/proj$


The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ** exception exit: shutdown

dmkolesnikov
Hi,

I’ve seen such exception when some of my application have not cleaned up supervised processes properly. Check out your supervisor tree(s).

Best Regards,
Dmitry

> On 13 Aug 2015, at 18:26, Sid Muller <[hidden email]> wrote:
>
> Hi,
>
> does anyone have any pointers on how to debug an exception exit in shell?
>
> When I type q(). into the shell I get this:
>
> 3> q().          
> ok
> ** exception exit: shutdown
> 4> sidm@test:~/src/proj$
>
>
> The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ** exception exit: shutdown

Chandru-4
In reply to this post by Sid Muller
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.

Functions you type in the shell are defined in shell_default.erl.

shell_default:q/0 is defined as:


q()             -> c:q().


c:q/0 is defined as:

-spec q() -> no_return().


q() ->

    init:stop().


If you turn tracing on for the init process to see what happens.

$ ~/erlang/R17-5/bin/erl

Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]


Eshell V6.4  (abort with ^G)

1> whereis(init).

<0.0.0>

2> 

2> 

2> 

2> dbg:tracer().

{ok,<0.35.0>}

3> dbg:p(whereis(init), [s,r]).

{ok,[{matched,nonode@nohost,1}]}

4> 

4> 

4> q().

(<0.0.0>) << {stop,stop}

(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}

ok

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"


Chandru



On 13 August 2015 at 16:26, Sid Muller <[hidden email]> wrote:
Hi,

does anyone have any pointers on how to debug an exception exit in shell?

When I type q(). into the shell I get this:

3> q().
ok
** exception exit: shutdown
4> sidm@test:~/src/proj$


The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ** exception exit: shutdown

Sid Muller
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.
 
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:
 
3> whereis(init).
<0.0.0>
4> dbg:tracer().
{ok,<0.5341.0>}
5> dbg:p(whereis(init), [s,r]).
{ok,[{matched,nonode@nohost,1}]}
6> q().
(<0.0.0>) << {stop,stop}
(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}
ok
** exception exit: shutdown
7> (no error logger present) error: <0.5341.0>
sidm@test:~/src/proj$
 
 
Sent: Thursday, August 13, 2015 at 2:55 PM
From: Chandru <[hidden email]>
To: "Sid Muller" <[hidden email]>
Cc: erlang-questions <[hidden email]>
Subject: Re: [erlang-questions] ** exception exit: shutdown
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.
 
Functions you type in the shell are defined in shell_default.erl.
 
shell_default:q/0 is defined as:

 

q()             -> c:q().

 
c:q/0 is defined as:
 

-spec q() -> no_return().

 

q() ->

    init:stop().

 
If you turn tracing on for the init process to see what happens.
 

$ ~/erlang/R17-5/bin/erl

Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

 

Eshell V6.4  (abort with ^G)

1> whereis(init).

<0.0.0>

2> 

2> 

2> 

2> dbg:tracer().

{ok,<0.35.0>}

3> dbg:p(whereis(init), [s,r]).

{ok,[{matched,nonode@nohost,1}]}

4> 

4> 

4> q().

(<0.0.0>) << {stop,stop}

(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}

ok

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"

 

Chandru

 

 
On 13 August 2015 at 16:26, Sid Muller <sid5@...> wrote:
Hi,

does anyone have any pointers on how to debug an exception exit in shell?

When I type q(). into the shell I get this:

3> q().
ok
** exception exit: shutdown
4> sidm@test:~/src/proj$


The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?

_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ** exception exit: shutdown : SOLVED dets_server:stop().

Sid Muller
It appears that when I close all dets files there is a lingering dets process left because if I run:
 dets_server:stop().
 
Then the shell doesn't report "** exception exit: shutdown"
 
Is that normal? Should I be calling dets_server:stop() from my code once I close dets files? None of the dets example use cases show that.
 
 
 
Sent: Friday, August 14, 2015 at 8:52 AM
From: "Sid Muller" <[hidden email]>
To: Chandru <[hidden email]>
Cc: erlang-questions <[hidden email]>
Subject: Re: [erlang-questions] ** exception exit: shutdown
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.
 
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:
 
3> whereis(init).
<0.0.0>
4> dbg:tracer().
{ok,<0.5341.0>}
5> dbg:p(whereis(init), [s,r]).
{ok,[{matched,nonode@nohost,1}]}
6> q().
(<0.0.0>) << {stop,stop}
(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}
ok
** exception exit: shutdown
7> (no error logger present) error: <0.5341.0>
sidm@test:~/src/proj$
 
 
Sent: Thursday, August 13, 2015 at 2:55 PM
From: Chandru <[hidden email]>
To: "Sid Muller" <[hidden email]>
Cc: erlang-questions <[hidden email]>
Subject: Re: [erlang-questions] ** exception exit: shutdown
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.
 
Functions you type in the shell are defined in shell_default.erl.
 
shell_default:q/0 is defined as:

 

q()             -> c:q().

 
c:q/0 is defined as:
 

-spec q() -> no_return().

 

q() ->

    init:stop().

 
If you turn tracing on for the init process to see what happens.
 

$ ~/erlang/R17-5/bin/erl

Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

 

Eshell V6.4  (abort with ^G)

1> whereis(init).

<0.0.0>

2> 

2> 

2> 

2> dbg:tracer().

{ok,<0.35.0>}

3> dbg:p(whereis(init), [s,r]).

{ok,[{matched,nonode@nohost,1}]}

4> 

4> 

4> q().

(<0.0.0>) << {stop,stop}

(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}

ok

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"

 

Chandru

 

 
On 13 August 2015 at 16:26, Sid Muller <[hidden email]> wrote:
Hi,

does anyone have any pointers on how to debug an exception exit in shell?

When I type q(). into the shell I get this:

3> q().
ok
** exception exit: shutdown
4> sidm@test:~/src/proj$


The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ** exception exit: shutdown : SOLVED dets_server:stop().

Chandru-4
On 15 August 2015 at 05:21, Sid Muller <[hidden email]> wrote:
It appears that when I close all dets files there is a lingering dets process left because if I run:
 dets_server:stop().
 
Then the shell doesn't report "** exception exit: shutdown"
 
Is that normal? Should I be calling dets_server:stop() from my code once I close dets files? None of the dets example use cases show that.

 
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. 

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.

supervisor:which_children(dets_sup).

should tell you if there are any pending dets processes.

cheers,
Chandru


 
Sent: Friday, August 14, 2015 at 8:52 AM
From: "Sid Muller" <[hidden email]>
To: Chandru <[hidden email]>
Cc: erlang-questions <[hidden email]>
Subject: Re: [erlang-questions] ** exception exit: shutdown
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.
 
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:
 
3> whereis(init).
<0.0.0>
4> dbg:tracer().
{ok,<0.5341.0>}
5> dbg:p(whereis(init), [s,r]).
{ok,[{matched,nonode@nohost,1}]}
6> q().
(<0.0.0>) << {stop,stop}
(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}
ok
** exception exit: shutdown
7> (no error logger present) error: <0.5341.0>
sidm@test:~/src/proj$
 
 
Sent: Thursday, August 13, 2015 at 2:55 PM
From: Chandru <[hidden email]>
To: "Sid Muller" <[hidden email]>
Cc: erlang-questions <[hidden email]>
Subject: Re: [erlang-questions] ** exception exit: shutdown
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.
 
Functions you type in the shell are defined in shell_default.erl.
 
shell_default:q/0 is defined as:

 

q()             -> c:q().

 
c:q/0 is defined as:
 

-spec q() -> no_return().

 

q() ->

    init:stop().

 
If you turn tracing on for the init process to see what happens.
 

$ ~/erlang/R17-5/bin/erl

Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

 

Eshell V6.4  (abort with ^G)

1> whereis(init).

<0.0.0>

2> 

2> 

2> 

2> dbg:tracer().

{ok,<0.35.0>}

3> dbg:p(whereis(init), [s,r]).

{ok,[{matched,nonode@nohost,1}]}

4> 

4> 

4> q().

(<0.0.0>) << {stop,stop}

(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}

ok

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"

 

Chandru

 

 
On 13 August 2015 at 16:26, Sid Muller <[hidden email]> wrote:
Hi,

does anyone have any pointers on how to debug an exception exit in shell?

When I type q(). into the shell I get this:

3> q().
ok
** exception exit: shutdown
4> sidm@test:~/src/proj$


The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ** exception exit: shutdown : SOLVED dets_server:stop().

Sid Muller
Hi Chandru-
 
thank you for the info. You are absolutely right that there were tables open.
 
Not because I wasn't closing them, the code seemed correct.
It was the fact that I wasn't checking the return of des:close which was failing due to ownership.
 
Thank you so much!!!
 
Sent: Tuesday, August 18, 2015 at 3:27 AM
From: Chandru <[hidden email]>
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. 
 
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.
 
supervisor:which_children(dets_sup).
 
should tell you if there are any pending dets processes.
 
cheers,
Chandru
 
 
 
Sent: Friday, August 14, 2015 at 8:52 AM
From: "Sid Muller" <sid5@...>
To: Chandru <chandrashekhar.mullaparthi@...>
Cc: erlang-questions <erlang-questions@...>
Subject: Re: [erlang-questions] ** exception exit: shutdown
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.
 
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:
 
3> whereis(init).
<0.0.0>
4> dbg:tracer().
{ok,<0.5341.0>}
5> dbg:p(whereis(init), [s,r]).
{ok,[{matched,nonode@nohost,1}]}
6> q().
(<0.0.0>) << {stop,stop}
(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}
ok
** exception exit: shutdown
7> (no error logger present) error: <0.5341.0>
sidm@test:~/src/proj$
 
 
Sent: Thursday, August 13, 2015 at 2:55 PM
From: Chandru <chandrashekhar.mullaparthi@...>
To: "Sid Muller" <sid5@...>
Cc: erlang-questions <erlang-questions@...>
Subject: Re: [erlang-questions] ** exception exit: shutdown
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.
 
Functions you type in the shell are defined in shell_default.erl.
 
shell_default:q/0 is defined as:

 

q()             -> c:q().

 
c:q/0 is defined as:
 

-spec q() -> no_return().

 

q() ->

    init:stop().

 
If you turn tracing on for the init process to see what happens.
 

$ ~/erlang/R17-5/bin/erl

Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

 

Eshell V6.4  (abort with ^G)

1> whereis(init).

<0.0.0>

2> 

2> 

2> 

2> dbg:tracer().

{ok,<0.35.0>}

3> dbg:p(whereis(init), [s,r]).

{ok,[{matched,nonode@nohost,1}]}

4> 

4> 

4> q().

(<0.0.0>) << {stop,stop}

(<0.0.0>) <0.7.0> ! {'EXIT',<0.2.0>,shutdown}

ok

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"

 

Chandru

 

 
On 13 August 2015 at 16:26, Sid Muller <[hidden email]> wrote:
Hi,

does anyone have any pointers on how to debug an exception exit in shell?

When I type q(). into the shell I get this:

3> q().
ok
** exception exit: shutdown
4> sidm@test:~/src/proj$


The problem is I don't know where to look since the exception is so terse. Does anyone have any pointers?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________ erlang-questions mailing list erlang-questions@... http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions