Skip to content

Assertion 'id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT' failed in lit_get_magic_string_size #2733

@renatahodovan

Description

@renatahodovan
Jerry version:
Checked revision: 924f4bbd

Build command: ./tools/build.py --clean --debug --compile-flag=-m32 --profile=es2015-subset --system-allocator=on --error-messages=on --logging=on
OS:
Linux-4.15.0-43-generic-x86_64-with-Ubuntu-18.04-bionic
Test case:
var fz_globalObject = this

function fz_is_primitive(value) {
    var value_type = typeof value
    if (value_type !== "function" && value_type !== "object")
        return value_type
}

function fz_starts_with(str, pattern) {
    for (var i = 0; i < pattern.length; i++)
        if (str[i] !== pattern[i])
            return
    return true
}

function fz_collect_values(value) {
    var primitive = fz_is_primitive(value)
    if (primitive)
        return
    var prop_names = Object.getOwnPropertyNames(value)
    for (var i = 0; i < prop_names.length; i++) {
        var prop_name = prop_names[i]
        if (!fz_starts_with(prop_name, "fz_")) {
            fz_collect_values(value[prop_name])
        }
    }
}

fz_collect_values(fz_globalObject)
Backtrace:
ICE: Assertion 'id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT' failed at jerryscript/jerry-core/lit/lit-magic-strings.c(lit_get_magic_string_size):77.
Error: ERR_FAILED_INTERNAL_ASSERTION

Program received signal SIGABRT, Aborted.
0xf7fd5059 in __kernel_vsyscall ()
(gdb) bt
#0  0xf7fd5059 in __kernel_vsyscall ()
#1  0xf7de1832 in raise () from /lib/i386-linux-gnu/libc.so.6
#2  0xf7de2cc1 in abort () from /lib/i386-linux-gnu/libc.so.6
#3  0x5655ca1e in jerry_port_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
    at jerryscript/jerry-port/default/default-fatal.c:71
#4  0x565a009a in jerry_fatal (code=ERR_FAILED_INTERNAL_ASSERTION)
    at jerryscript/jerry-core/jrt/jrt-fatals.c:58
#5  0x565a00d4 in jerry_assert_fail (assertion=0x565dfc54 "id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT", 
    file=0x565dc248 "jerryscript/jerry-core/lit/lit-magic-strings.c", 
    function=0x565d2278 <__func__.3343.lto_priv.454> "lit_get_magic_string_size", line=77)
    at jerryscript/jerry-core/jrt/jrt-fatals.c:82
#6  0x565a10fc in lit_get_magic_string_size (id=LIT_GLOBAL_SYMBOL_TO_STRING_TAG)
    at jerryscript/jerry-core/lit/lit-magic-strings.c:77
#7  0x565c36ca in ecma_string_get_ascii_size (string_p=0x23cd)
    at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:1989
#8  0x565c38b6 in ecma_string_get_length (string_p=0x23cd)
    at jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:2025
#9  0x56596b7f in ecma_op_object_find_own (base_value=9165, object_p=0x566f8a80, property_name_p=0x15)
    at jerryscript/jerry-core/ecma/operations/ecma-objects.c:435
#10 0x5656744e in ecma_op_get_value_object_base (base_value=9165, property_name_p=0x15)
    at jerryscript/jerry-core/ecma/operations/ecma-get-put-value.c:116
#11 0x5658c01d in vm_op_get_value (object=9165, property=0) at jerryscript/jerry-core/vm/vm.c:118
#12 0x5658ec6e in vm_loop (frame_ctx_p=0xffffc48c) at jerryscript/jerry-core/vm/vm.c:1694
#13 0x565922c6 in vm_execute (frame_ctx_p=0xffffc48c, arg_p=0xffffc668, arg_list_len=2)
    at jerryscript/jerry-core/vm/vm.c:3478
#14 0x565924f3 in vm_run (bytecode_header_p=0x566f76b0, this_binding_value=1450144131, lex_env_p=0x566f71b0, parse_opts=0, 
    arg_list_p=0xffffc668, arg_list_len=2) at jerryscript/jerry-core/vm/vm.c:3581
#15 0x565ae1a2 in ecma_op_function_call (func_obj_p=0x566f79a0, this_arg_value=72, arguments_list_p=0xffffc668, 
    arguments_list_len=2) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:721
#16 0x5658c77e in opfunc_call (frame_ctx_p=0xffffc68c) at jerryscript/jerry-core/vm/vm.c:534
#17 0x565922f0 in vm_execute (frame_ctx_p=0xffffc68c, arg_p=0xffffc868, arg_list_len=1)
    at jerryscript/jerry-core/vm/vm.c:3484
#18 0x565924f3 in vm_run (bytecode_header_p=0x566f77c0, this_binding_value=1450144131, lex_env_p=0x566f71b0, parse_opts=0, 
    arg_list_p=0xffffc868, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:3581
#19 0x565ae1a2 in ecma_op_function_call (func_obj_p=0x566f79c0, this_arg_value=72, arguments_list_p=0xffffc868, 
    arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:721
#20 0x5658c77e in opfunc_call (frame_ctx_p=0xffffc88c) at jerryscript/jerry-core/vm/vm.c:534
#21 0x565922f0 in vm_execute (frame_ctx_p=0xffffc88c, arg_p=0xffffca68, arg_list_len=1)
    at jerryscript/jerry-core/vm/vm.c:3484
#22 0x565924f3 in vm_run (bytecode_header_p=0x566f77c0, this_binding_value=1450144131, lex_env_p=0x566f71b0, parse_opts=0, 
    arg_list_p=0xffffca68, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:3581
#23 0x565ae1a2 in ecma_op_function_call (func_obj_p=0x566f79c0, this_arg_value=72, arguments_list_p=0xffffca68, 
    arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:721
#24 0x5658c77e in opfunc_call (frame_ctx_p=0xffffca8c) at jerryscript/jerry-core/vm/vm.c:534
#25 0x565922f0 in vm_execute (frame_ctx_p=0xffffca8c, arg_p=0xffffcc54, arg_list_len=1)
    at jerryscript/jerry-core/vm/vm.c:3484
#26 0x565924f3 in vm_run (bytecode_header_p=0x566f77c0, this_binding_value=1450144131, lex_env_p=0x566f71b0, parse_opts=0, 
    arg_list_p=0xffffcc54, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:3581
#27 0x565ae1a2 in ecma_op_function_call (func_obj_p=0x566f79c0, this_arg_value=72, arguments_list_p=0xffffcc54, 
    arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:721
#28 0x5658c77e in opfunc_call (frame_ctx_p=0xffffcc6c) at jerryscript/jerry-core/vm/vm.c:534
#29 0x565922f0 in vm_execute (frame_ctx_p=0xffffcc6c, arg_p=0x0, arg_list_len=0)
    at jerryscript/jerry-core/vm/vm.c:3484
#30 0x565924f3 in vm_run (bytecode_header_p=0x566f78e0, this_binding_value=1450144131, lex_env_p=0x566f71b0, parse_opts=0, 
    arg_list_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:3581
#31 0x5658c221 in vm_run_global (bytecode_p=0x566f78e0) at jerryscript/jerry-core/vm/vm.c:235
#32 0x565b4e9e in jerry_run (func_val=1450146115) at jerryscript/jerry-core/api/jerry.c:544
#33 0x565b3866 in main (argc=3, argv=0xffffcf04) at jerryscript/jerry-main/main-unix.c:676

Metadata

Metadata

Assignees

No one assigned

    Labels

    ES2015Related to ES2015 featuresbugUndesired behaviour

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions