Skip to content

Stack-overflow in JS_CallInternal #775

@Hanseltu

Description

@Hanseltu

Hi,

The following test input (input.js) causes the qjs a stack-overflow issue.

$cat input.js
function f()	{
f(1,2,3)
}
f(1)

$./qjs input.js
ASAN:DEADLYSIGNAL
=================================================================
==8279==ERROR: AddressSanitizer: stack-overflow on address 0x7fffff7fe5d8 (pc 0x55555572c03a bp 0x7fffff8004a0 sp 0x7fffff7fe580 T0)
    #0 0x55555572c039 in JS_CallInternal /home/benchmarks/quickjs/quickjs.c:14853
    #1 0x5555557341de in JS_CallInternal /home/benchmarks/quickjs/quickjs.c:15304
    #2 0x5555557341de in JS_CallInternal /home/benchmarks/quickjs/quickjs.c:15304
    ...... // omit the same stack trace infomration
    #249 0x5555557341de in JS_CallInternal /home/benchmarks/quickjs/quickjs.c:15304
    #250 0x5555557341de in JS_CallInternal /home/benchmarks/quickjs/quickjs.c:15304

SUMMARY: AddressSanitizer: stack-overflow /home/benchmarks/quickjs/quickjs.c:14853 in JS_CallInternal
==8279==ABORTING

Compilation command: cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-fsanitize=address -ldl -static-libasan" -DCMAKE_INSTALL_PREFIX=/home/benchmarks/quickjs/build .. and make -j12.
Compiler version: gcc-7.5.0.
System: ubuntu 18.04.
quickjs version: master (74fd4d7).

Thanks.

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