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 src/jsiArray.c:1172 in jsi_ArraySpliceCmd #65

Closed
hope-fly opened this issue Dec 24, 2021 · 1 comment
Closed

SEGV src/jsiArray.c:1172 in jsi_ArraySpliceCmd #65

hope-fly opened this issue Dec 24, 2021 · 1 comment

Comments

@hope-fly
Copy link

hope-fly commented Dec 24, 2021

Jsish revision

Commit: 9fa798e

Version: v3.5.0

Build platform

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

Build steps
export CFLAGS='-fsanitize=address'
make
Test case
var myColors = new Array(99999);
var lastElement = myColors.push('yellow');
myColors.push('yellow');
var firstElement = myColors.shift();
myColors.splice('pink');

Execution steps & Output
$ ./jsish/jsish poc.js
/poc.js:5: error: invalid number
ASAN:DEADLYSIGNAL
=================================================================
==825==ERROR: AddressSanitizer: SEGV on unknown address 0x60c0000dc4f0 (pc 0x555a355a5e18 bp 0x7ffcd17c49b0 sp 0x7ffcd17c4960 T0)
==825==The signal is caused by a WRITE memory access.
    #0 0x555a355a5e17 in jsi_ArraySpliceCmd src/jsiArray.c:1172
    #1 0x555a35574818 in jsi_FuncCallSub src/jsiProto.c:244
    #2 0x555a3583e71a in jsiFunctionSubCall src/jsiEval.c:796
    #3 0x555a3583e71a in jsiEvalFunction src/jsiEval.c:837
    #4 0x555a3583e71a in jsiEvalCodeSub src/jsiEval.c:1264
    #5 0x555a3585215e in jsi_evalcode src/jsiEval.c:2204
    #6 0x555a35856274 in jsi_evalStrFile src/jsiEval.c:2665
    #7 0x555a3554566a in Jsi_Main src/jsiInterp.c:936
    #8 0x555a35d4a03a in jsi_main src/main.c:47
    #9 0x7fb00f1a5bf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
    #10 0x555a354d9969 in _start (/usr/local/bin/jsish+0xe8969)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV src/jsiArray.c:1172 in jsi_ArraySpliceCmd

Credits: Found by OWL337 team.

@hope-fly
Copy link
Author

This issue may have a correlation with #64, but I'm not for sure. Report this issue to assist your debug.

pcmacdon pushed a commit that referenced this issue Dec 26, 2021
…x to issue #64

FossilOrigin-Name: 18c3a7084f0cdf0aaf9dd27a591d6ed75f33b00be55439bd6d2acb979a6f1207
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