Skip to content

SEGV in ecma_string_copy_to_buffer #5236

Open
@clearcache7

Description

@clearcache7
JerryScript revision

5020015

Build platform

Ubuntu 24.04.2 LTS

Build steps
python3 tools/build.py --debug --lto=off 
--compile-flag=-fsanitize=address --compile-flag=-D_POSIX_C_SOURCE=200809 --compile-flag=-Wno-strict-prototypes 
--stack-limit=15"
Test case

crash.zip

Execution steps
build/bin/jerry --exec-snapshot case.snapshot
Backtrace
==37808==ERROR: AddressSanitizer: unknown-crash on address 0x02a000001a2d at pc 0x55ee821c93c6 bp 0x7ffc76394c70 sp 0x7ffc76394430
READ of size 12717 at 0x02a000001a2d thread T0
    #0 0x55ee821c93c5 in __asan_memcpy (/home/www/jerryscript/cmake-build-asan/bin/jerry+0x1253c5) (BuildId: fe91e061c746f8e94da14cc05bad8a51a0f3c785)
    #1 0x55ee8224e0ff in ecma_string_copy_to_buffer /home/www/jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:1146:7
    #2 0x55ee82253303 in ecma_string_to_cesu8_bytes /home/www/jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:1184:32
    #3 0x55ee82253303 in ecma_stringbuilder_append /home/www/jerryscript/jerry-core/ecma/base/ecma-helpers-string.c:2591:3
    #4 0x55ee822aff20 in ecma_raise_standard_error_with_format /home/www/jerryscript/jerry-core/ecma/operations/ecma-exceptions.c:375:7
    #5 0x55ee823b8440 in ecma_op_resolve_reference_value /home/www/jerryscript/jerry-core/ecma/operations/ecma-reference.c:394:5
    #6 0x55ee82355922 in vm_loop /home/www/jerryscript/jerry-core/vm/vm.c:1058:9
    #7 0x55ee823547c7 in vm_execute /home/www/jerryscript/jerry-core/vm/vm.c:5220:37
    #8 0x55ee82352d9e in vm_run /home/www/jerryscript/jerry-core/vm/vm.c:5320:10
    #9 0x55ee82352902 in vm_run_global /home/www/jerryscript/jerry-core/vm/vm.c:287:25
    #10 0x55ee82426821 in jerry_exec_snapshot /home/www/jerryscript/jerry-core/api/jerry-snapshot.c:1086:15
    #11 0x55ee8241b262 in jerryx_source_exec_snapshot /home/www/jerryscript/jerry-ext/util/sources.c:125:5
    #12 0x55ee8220a1a3 in main /home/www/jerryscript/jerry-main/main-desktop.c:208:18
    #13 0x75e3b982a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #14 0x75e3b982a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    #15 0x55ee821306c4 in _start (/home/www/jerryscript/cmake-build-asan/bin/jerry+0x8c6c4) (BuildId: fe91e061c746f8e94da14cc05bad8a51a0f3c785)

Address 0x02a000001a2d is located in the high shadow area.
SUMMARY: AddressSanitizer: unknown-crash (/home/www/jerryscript/cmake-build-asan/bin/jerry+0x1253c5) (BuildId: fe91e061c746f8e94da14cc05bad8a51a0f3c785) in __asan_memcpy
==37808==ABORTING

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions