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

Assertion `iterable->isArrayObject()' failed in Escargot::builtinPromiseAll #30

Closed
renatahodovan opened this issue Dec 31, 2018 · 0 comments

Comments

@renatahodovan
Copy link
Member

Escargot version:
Checked revision: 8bcf72a
Build command: cmake -DESCARGOT_HOST=linux -DESCARGOT_ARCH=x64 -DESCARGOT_MODE=debug -DESCARGOT_OUTPUT=bin -GNinja && ninja
OS:
Ubuntu 18.04, x86_64
Test case:
Object.prototype[1] = 0 ; 
Promise.all('x') ;
Backtrace:
escargot: src/runtime/GlobalObjectBuiltinPromise.cpp:96: Escargot::Value Escargot::builtinPromiseAll(Escargot::ExecutionState&, Escargot::Value, size_t, Escargot::Value*, bool): Assertion `iterable->isArrayObject()' failed.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff688d801 in __GI_abort () at abort.c:79
#2  0x00007ffff687d39a in __assert_fail_base (fmt=0x7ffff6a047d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x555555834d63 "iterable->isArrayObject()", 
    file=file@entry=0x555555834d38 "src/runtime/GlobalObjectBuiltinPromise.cpp", line=line@entry=96, 
    function=function@entry=0x555555834f40 <Escargot::builtinPromiseAll(Escargot::ExecutionState&, Escargot::Value, unsigned long, Escargot::Value*, bool)::__PRETTY_FUNCTION__> "Escargot::Value Escargot::builtinPromiseAll(Escargot::ExecutionState&, Escargot::Value, size_t, Escargot::Value*, bool)") at assert.c:92
#3  0x00007ffff687d412 in __GI___assert_fail (assertion=0x555555834d63 "iterable->isArrayObject()", file=0x555555834d38 "src/runtime/GlobalObjectBuiltinPromise.cpp", line=96, 
    function=0x555555834f40 <Escargot::builtinPromiseAll(Escargot::ExecutionState&, Escargot::Value, unsigned long, Escargot::Value*, bool)::__PRETTY_FUNCTION__> "Escargot::Value Escargot::builtinPromiseAll(Escargot::ExecutionState&, Escargot::Value, size_t, Escargot::Value*, bool)") at assert.c:101
#4  0x000055555575116c in Escargot::builtinPromiseAll (state=..., thisValue=..., argc=1, argv=0x7fffffffd9b8, isNewExpression=false) at src/runtime/GlobalObjectBuiltinPromise.cpp:96
#5  0x00005555556cba78 in Escargot::FunctionObject::processCall (this=0x7ffff486d330, state=..., receiverSrc=..., argc=@0x7fffffffd940: 1, argv=0x7fffffffd9b8, isNewExpression=false)
    at src/runtime/FunctionObject.cpp:326
#6  0x00005555555ee742 in Escargot::FunctionObject::call (state=..., callee=..., receiver=..., argc=@0x7fffffffd940: 1, argv=0x7fffffffd9b8)
    at escargot/src/runtime/FunctionObject.h:100
#7  0x00005555555f15bf in Escargot::ByteCodeInterpreter::interpret (state=..., byteCodeBlock=0x7ffff7e68730, programCounter=93824998886912, registerFile=0x7fffffffd9a0, initAddressFiller=0x7fffffffda28)
    at src/interpreter/ByteCodeInterpreter.cpp:527
#8  0x0000555555611a21 in Escargot::Script::execute (this=0x7ffff48242b0, state=..., isEvalMode=false, needNewEnv=false, isOnGlobal=true) at src/parser/Script.cpp:80
#9  0x0000555555611b73 in Escargot::Script::<lambda()>::operator()(void) const (__closure=0x7fffffffdd30) at src/parser/Script.cpp:93
#10 0x0000555555612c16 in std::_Function_handler<Escargot::Value(), Escargot::Script::sandboxExecute(Escargot::ExecutionState&)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
    at /usr/include/c++/7/bits/std_function.h:302
#11 0x00005555557a4106 in std::function<Escargot::Value ()>::operator()() const (this=0x7fffffffdd30) at /usr/include/c++/7/bits/std_function.h:706
#12 0x00005555557a2c4b in Escargot::SandBox::run(std::function<Escargot::Value ()> const&) (this=0x7fffffffdca0, scriptRunner=...) at src/runtime/SandBox.cpp:36
#13 0x0000555555611c50 in Escargot::Script::sandboxExecute (this=0x7ffff48242b0, state=...) at src/parser/Script.cpp:94
#14 0x00005555557c102b in eval (context=0x7ffff7e59ed0, str=0x7ffff4829750, fileName=0x7ffff48296b0, shouldPrintScriptResult=false) at src/shell/Shell.cpp:46
#15 0x00005555557c197a in main (argc=2, argv=0x7fffffffe058) at src/shell/Shell.cpp:129

Found by Fuzzinator with grammarinator.

DanielBallaSZTE pushed a commit to DanielBallaSZTE/escargot that referenced this issue Jan 9, 2019
The assertions were wrong, if the given `iterable` was not an `Object` or not an `ArrayObject` the promise should have been just rejected.
Fixes Samsung#25
Fixes Samsung#30

Signed-off-by: Daniel Balla [email protected]
DanielBallaSZTE pushed a commit to DanielBallaSZTE/escargot that referenced this issue Jan 21, 2019
The assertions were wrong, if the given `iterable` was not an `Object` or not an `ArrayObject` the promise should have been just rejected.
Fixes Samsung#25
Fixes Samsung#30

Signed-off-by: Daniel Balla [email protected]
DanielBallaSZTE pushed a commit to DanielBallaSZTE/escargot that referenced this issue Jan 21, 2019
The assertions were wrong, if the given `iterable` was not an `Object` or not an `ArrayObject` the promise should have been just rejected.
Fixes Samsung#25
Fixes Samsung#30

Signed-off-by: Daniel Balla [email protected]
DanielBallaSZTE pushed a commit to DanielBallaSZTE/escargot that referenced this issue Jan 21, 2019
The assertions were wrong, if the given `iterable` was not an `Object` or not an `ArrayObject` the promise should have been just rejected.
Fixes Samsung#25
Fixes Samsung#30

Signed-off-by: Daniel Balla [email protected]
yichoi pushed a commit that referenced this issue Jan 22, 2019
The assertions were wrong, if the given `iterable` was not an `Object` or not an `ArrayObject` the promise should have been just rejected.
Fixes #25
Fixes #30

Signed-off-by: Daniel Balla [email protected]
clover2123 referenced this issue in clover2123/escargot Jan 22, 2019
The assertions were wrong, if the given `iterable` was not an `Object` or not an `ArrayObject` the promise should have been just rejected.
Fixes #25
Fixes #30

Signed-off-by: Daniel Balla [email protected]
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

1 participant