Erlang on FreeBSD/amd64

Brian Buchanan <>
Thu Feb 10 07:03:27 CET 2005


I just did a little investigative work on this.  Here's an error I get:

=ERROR REPORT==== 9-Feb-2005::21:47:41 ===
Error in process <0.22.0> with exit value:

./disk_log.erl:none: internal error in parse_module;
crash reason: {badarg,[{erlang,demonitor,[{}]},

I instrumented the bootstrap version of the io module and discovered what
appears to be reference corruption in the interpreter after a process
waits in "receive".

My modified "io" prints out {monitor, MRef} after the call to
erlang:monitor in io:receive, {wait_io_mon_reply,MRef} at the top of
wait_io_mon_reply(), and {demonitor, MRef} right before the call to

The output should look like a bunch of:



And that's what I get for the first many iterations.  Then:



Here's the first fragment of io:wait_mon_reply/2 so you can see my

wait_io_mon_reply(From, Mref) when is_reference(Mref) ->
    erlang:display({wait_io_mon_reply, Mref}),
        {io_reply,From,Reply} ->
            erlang:display({demonitor, Mref}),
                {'DOWN', Mref, _, _, _} -> true
            after 0 -> true

I made a few more tweaks after this to try to figure out if the
interpreter stack was being clobbered, but determined that the "From"
variable and any new variables I defined before the receive were not
affected.  I suspect something is broken in the implementation of

Unfortunately, I have no real experience with the beam interpreter, and at
this point am not even sure how to get it running in gdb, so I must appeal
to someone more knowledgeable to provide some guidance here.

- Brian

Brian Buchanan <>
Principal Engineer
nCircle Network Security                   

More information about the erlang-bugs mailing list