[erlang-bugs] Mnesia/R15B: TYPE ASSERTION FAILED, erl_term.c line 109 (when stopping mnesia)

Winston Smith <>
Wed Apr 4 18:43:35 CEST 2012

On Tue, Apr 3, 2012 at 9:59 PM, Winston Smith
<> wrote:
> On Mon, Apr 2, 2012 at 11:04 PM, Winston Smith
> <> wrote:
>> I have run into the following issue with R15B cross compiled to an
>> AVR32 (similar to ARM) system (no HiPE).
> 2> mnesia:stop().
> TYPE ASSERTION FAILED, file beam/utils.c, line 2380: !is_header(x)
> Aborted (core dumped)
> I still have no backtrace, but indeed line 2380 of utils.c is in the
> middle of the function "cmp" that I found previously.  I did
> rebuilding the debug build with -fno-omit-frame-pointer, but it hasn't
> improved the stack trace.

Don't know what's up with bt/where not working in gdb, but with
-fno-omit-frame-pointer (and a bit of research into the AVR32 ABI), I
can trace the stack via the fp register R7; it points to the return
address followed by the previous value of R7 (like EBP on x86).

So I have been able to recreate the "C" stack manually:

    0 - cmp(a,b)  --  utils.c:2380
    1 - seqeq_2(l)  --  erl_bif_op.c:115
    2 - db_prog_match()  --  erl_db_util.c:1997
    3 - db_match_dbterm()  --  erl_db_util.c:5051
    4 - db_select_chunk_hash()  --  erl_db_hash.c:1485
    5 - db_select_hash()  --  erl_db_hash.c:1404
    6 - ets_select2()  --  erl_db.c:2376
    7 - ets_select2()  --  erl_db.c:2350
    8 - process_main()  --  beam_emu.c:2642
    9 - ?? (0x02)

Unfortunately, I have not yet figured out how to get to local
variables from the AVR32 ABI, I'd really like to see what's going on
at frame #2.  It's trying to process a matchCall2 where it puts the
arguments to seqeq_2 into the stack by accessing esp[-1] and esp[-2].

I have tried to recompile with -DHARDDEBUG to turn on more tracing as
described at the bottom of this page:


Although it looks like the code -DHARDDEBUG enables doesn't compile in
R15B01.  I will see if I can fix that ...



More information about the erlang-bugs mailing list