Skip to content

What could be the reason for this crash? #15

burinov opened this Issue Jan 8, 2012 · 1 comment

2 participants

burinov commented Jan 8, 2012

In code I very often call gproc like this:

handle_cast({msg, To, Message}, State) ->
    spawn(fun() -> 
            % Trying to lookup Pid from gproc
            case gproc:lookup_local_name(To) of
                undefined ->
                    % player is not loaded, loading the player
                    player:start(To, Message);
                Pid ->
                    % player is here, passing the message to him
                    gen_server:cast(Pid, Message)
    {noreply, State};
handle_cast(_Msg, State) ->
    {noreply, State}.

In module player I work with grpoc like this:

init([Name]) ->
    % Registering in gproc
    ?LOG("Creating new process", Name),
    {ok, #state{name = Name, ready = 0}}.

From time to time I see something like this in my logs:

=CRASH REPORT==== 8-Jan-2012::01:50:52 ===
    initial call: player:init/1
    pid: <0.19872.4>
    registered_name: []
    exception exit: {badarg,[{gproc,chk_reply,
      in function  gen_server:init_it/6
    ancestors: [<0.19870.4>]
    messages: []
    links: []
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 377
    stack_size: 24
    reductions: 164

What could be the reason for this? Is this because of gproc of my code?

uwiger commented Jan 8, 2012
@uwiger uwiger closed this May 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.