Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGV xs/sources/xsFunction.c:546:18 in fx_Function_prototype_hasInstance #767

Closed
hope-fly opened this issue Jan 7, 2022 · 2 comments
Closed

Comments

@hope-fly
Copy link

hope-fly commented Jan 7, 2022

Moddable-XS revision

Commit: 2f93df29

Version: 11.5.0 32 4

Build environment

Ubuntu 18.04.5 LTS (Linux 5.4.0-44-generic x86_64)

Build steps
cd  ~/moddable/xs/makefiles/lin
make -f xst.mk
Test case
poc.js

function JSEtest() { };

JSEtest.prototype = Function.prototype;
var obj = new JSEtest;

try {
    obj.apply();
    $ERROR('###');
} catch (e) {
    if (!(e instanceof new JSEtest)) {
        $ERROR('###');
    }
}

Execution & Output
$ ./moddable/build/bin/lin/debug/xst poc.js

AddressSanitizer:DEADLYSIGNAL
=================================================================
==16775==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000069f0da bp 0x7ffc5bbdaf10 sp 0x7ffc5bbdac70 T0)
==16775==The signal is caused by a READ memory access.
==16775==Hint: address points to the zero page.
    #0 0x69f0d9 in fx_Function_prototype_hasInstance /root/moddable/xs/sources/xsFunction.c:546:18
    #1 0x84f3ca in fxRunID /root/moddable/xs/sources/xsRun.c:842:7
    #2 0x8c98c0 in fxRunInstanceOf /root/moddable/xs/sources/xsRun.c:4396:2
    #3 0x8bac67 in fxRunID /root/moddable/xs/sources/xsRun.c:3877:4
    #4 0x8ceaac in fxRunScript /root/moddable/xs/sources/xsRun.c:4766:4
    #5 0xad3231 in fxRunProgramFile /root/moddable/xs/tools/xst.c:1387:2
    #6 0xacfa83 in main /root/moddable/xs/tools/xst.c:281:8
    #7 0x7f729fce6bf6 in __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
    #8 0x42ddc9 in _start (/usr/local/bin/xst+0x42ddc9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /root/moddable/xs/sources/xsFunction.c:546:18 in fx_Function_prototype_hasInstance
==16775==ABORTING

Credits: Found by OWL337 team.

@phoddie
Copy link
Collaborator

phoddie commented Jan 7, 2022

This looks like a duplicate of #748.

@hope-fly
Copy link
Author

hope-fly commented Jan 8, 2022

Okay. I'll check the issues reported carefully before the next submitting.

@phoddie phoddie closed this as completed Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants