Skip to content

Linux/Mac OS - *Stack Smashing Detected* when using Promises #27

@vms20591

Description

@vms20591

Hi,

When running any JS code that has promises in them like the following example, a stack smashing detected error is thrown and program crashes.

function asyncTask() {
    return new Promise((res, rej) => {
        res();
    });
}

asyncTask().then(() => {
    // code
});

I have created a repro project here.

Tried analyzing the coredump using gdb and got the following,

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `dotnet exec /home/user/ChakraNetTest/SegFaultRepro/bin/Debug/ne'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7fad8887d700 (LWP 3192))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fb669f9c535 in __GI_abort () at abort.c:79
#2  0x00007fb66a003516 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fb66a1279ee "*** %s ***: %s terminated\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007fb66a0a7431 in __GI___fortify_fail_abort (need_backtrace=need_backtrace@entry=false, msg=msg@entry=0x7fb66a1279cc "stack smashing detected") at fortify_fail.c:33
#4  0x00007fb66a0a73f2 in __stack_chk_fail () at stack_chk_fail.c:29
#5  0x00007fb6557fac8e in sigsegv_handler(int, siginfo_t*, void*) () from /usr/lib/libChakraCore.so
#6  0x0000000000000000 in ?? ()

Details:

OS: Ubuntu 18.10
.NET Core - 2.1 & 2.2
ChakraCore.NET - 1.3.2
Microsoft.ChakraCore - 1.11.7

Edit:

  • Add more environment details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions