Skip to content

ASSERTION FAILED at wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c, line 4800 #4698

@Q1IQ

Description

@Q1IQ

Current State

Run the following command:

iwasm --interp -f main test.wasm

Observed output:

[01:37:25:505 - 7F3695A0DEC0]: 
ASSERTION FAILED: (init_expr->init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL) || (init_expr->init_expr_type == INIT_EXPR_TYPE_REFNULL_CONST) || (init_expr->init_expr_type >= INIT_EXPR_TYPE_FUNCREF_CONST && init_expr->init_expr_type <= INIT_EXPR_TYPE_ARRAY_NEW_FIXED), at file /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c, line 4800


Original Command (For Reference)

The full command that triggered this issue:

/work/harnesses/binaries/iwasm --interp -f main test.wasm

GDB Backtrace

warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[01:37:26:002 - 7F017C9A1EC0]: 
ASSERTION FAILED: (init_expr->init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL) || (init_expr->init_expr_type == INIT_EXPR_TYPE_REFNULL_CONST) || (init_expr->init_expr_type >= INIT_EXPR_TYPE_FUNCREF_CONST && init_expr->init_expr_type <= INIT_EXPR_TYPE_ARRAY_NEW_FIXED), at file /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c, line 4800


Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=139644362170048) at ./nptl/pthread_kill.c:44
44	./nptl/pthread_kill.c: No such file or directory.
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139644362170048) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=139644362170048) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=139644362170048, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007f017ca09476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007f017c9ef7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x000055dd02e567bc in bh_assert_internal (v=<optimized out>, file_name=<optimized out>, file_name@entry=0x55dd02f7ab60 "/work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c", line_number=line_number@entry=4800, expr_string=<optimized out>, expr_string@entry=0x55dd02f7d000 "(init_expr->init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL) || (init_expr->init_expr_type == INIT_EXPR_TYPE_REFNULL_CONST) || (init_expr->init_expr_type >= INIT_EXPR_TYPE_FUNCREF_CONST && init_expr->init"...) at /work/harnesses/sources/wasm-micro-runtime/core/shared/utils/bh_assert.c:24
#6  0x000055dd02f262b0 in load_init_expr_vec (p_buf=p_buf@entry=0x7ffd49218590, buf_end=buf_end@entry=0x50c00000008f "\n\247\200\200\200", module=module@entry=0x515000000080, table_segment=table_segment@entry=0x506000000080, error_buf=error_buf@entry=0x7ffd49219120 "", error_buf_size=error_buf_size@entry=128) at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c:4800
#7  0x000055dd02f47238 in load_table_segment_section (error_buf_size=128, error_buf=0x7ffd49219120 "", module=0x515000000080, buf_end=0x50c00000008f "\n\247\200\200\200", buf=<optimized out>) at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c:4989
#8  load_from_sections (module=module@entry=0x515000000080, sections=<optimized out>, is_load_from_file_buf=is_load_from_file_buf@entry=true, wasm_binary_freeable=wasm_binary_freeable@entry=false, no_resolve=no_resolve@entry=false, error_buf=error_buf@entry=0x7ffd49219120 "", error_buf_size=<optimized out>) at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c:6354
#9  0x000055dd02f4c2b7 in load (error_buf_size=128, error_buf=0x7ffd49219120 "", no_resolve=false, wasm_binary_freeable=false, module=0x515000000080, size=124, buf=0x50c000000040 "") at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c:7048
#10 wasm_loader_load (buf=buf@entry=0x50c000000040 "", size=size@entry=124, main_module=main_module@entry=true, args=args@entry=0x7ffd49218be0, error_buf=error_buf@entry=0x7ffd49219120 "", error_buf_size=error_buf_size@entry=128) at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_loader.c:7225
#11 0x000055dd02e6686a in wasm_load (buf=buf@entry=0x50c000000040 "", size=size@entry=124, main_module=main_module@entry=true, name=name@entry=0x7ffd49218be0, error_buf=error_buf@entry=0x7ffd49219120 "", error_buf_size=error_buf_size@entry=128) at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/interpreter/wasm_runtime.c:65
#12 0x000055dd02e5d1aa in wasm_runtime_load_ex (buf=buf@entry=0x50c000000040 "", size=size@entry=124, args=args@entry=0x7ffd49218be0, error_buf=error_buf@entry=0x7ffd49219120 "", error_buf_size=error_buf_size@entry=128) at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/common/wasm_runtime_common.c:1476
#13 0x000055dd02e5d3a3 in wasm_runtime_load (buf=buf@entry=0x50c000000040 "", size=<optimized out>, error_buf=error_buf@entry=0x7ffd49219120 "", error_buf_size=error_buf_size@entry=128) at /work/harnesses/sources/wasm-micro-runtime/core/iwasm/common/wasm_runtime_common.c:1530
#14 0x000055dd02e55807 in main (argc=<optimized out>, argv=<optimized out>) at /work/harnesses/sources/wasm-micro-runtime/product-mini/platforms/linux/../posix/main.c:950
A debugging session is active.

	Inferior 1 [process 3621486] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]

Reproduction steps

  1. Save the attached WASM file: test.wasm
  2. Run the command:
iwasm --interp -f main test.wasm

test.wasm.txt

IWASM Version or Commit you used

Commit: 4b42cfd
Version: iwasm 2.4.3

Operating system information

Ubuntu 20.04

Hardware Architecture

amd64 (x86_64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions