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 `isValuePresent()' failed in Escargot::ObjectPropertyDescriptor::value #28

Closed
renatahodovan opened this issue Dec 30, 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:
var proto = { } ; 
Object.defineProperty ( proto , "2" , { get : function ( ) { }, configurable : true } ) ; 
Object.defineProperty ( proto , "2" , { writable : false } ) ; 
Backtrace:
escargot: escargot/src/runtime/Object.h:289: const Escargot::Value& Escargot::ObjectPropertyDescriptor::value() const: Assertion `isValuePresent()' 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=0x555555812eb9 "isValuePresent()", 
    file=file@entry=0x555555812dd8 "escargot/src/runtime/Object.h", line=line@entry=289, 
    function=function@entry=0x555555814920 <Escargot::ObjectPropertyDescriptor::value() const::__PRETTY_FUNCTION__> "const Escargot::Value& Escargot::ObjectPropertyDescriptor::value() const")
    at assert.c:92
#3  0x00007ffff687d412 in __GI___assert_fail (assertion=0x555555812eb9 "isValuePresent()", file=0x555555812dd8 "escargot/src/runtime/Object.h", line=289, 
    function=0x555555814920 <Escargot::ObjectPropertyDescriptor::value() const::__PRETTY_FUNCTION__> "const Escargot::Value& Escargot::ObjectPropertyDescriptor::value() const") at assert.c:101
#4  0x00005555555c3448 in Escargot::ObjectPropertyDescriptor::value (this=0x7fffffffd0e0) at escargot/src/runtime/Object.h:289
#5  0x00005555557905c2 in Escargot::Object::defineOwnProperty (this=0x7ffff4829250, state=..., P=..., desc=...) at src/runtime/Object.cpp:544
#6  0x00005555556c4ca7 in Escargot::Object::defineOwnPropertyThrowsException (this=0x7ffff4829250, state=..., P=..., desc=...) at escargot/src/runtime/Object.h:678
#7  0x0000555555746a69 in Escargot::builtinObjectDefineProperty (state=..., thisValue=..., argc=3, argv=0x7fffffffd998, isNewExpression=false) at src/runtime/GlobalObjectBuiltinObject.cpp:159
#8  0x00005555556cba78 in Escargot::FunctionObject::processCall (this=0x7ffff7e5fe30, state=..., receiverSrc=..., argc=@0x7fffffffd920: 3, argv=0x7fffffffd998, isNewExpression=false)
    at src/runtime/FunctionObject.cpp:326
#9  0x00005555555ee742 in Escargot::FunctionObject::call (state=..., callee=..., receiver=..., argc=@0x7fffffffd920: 3, argv=0x7fffffffd998)
    at escargot/src/runtime/FunctionObject.h:100
#10 0x00005555555f15bf in Escargot::ByteCodeInterpreter::interpret (state=..., byteCodeBlock=0x7ffff7e68610, programCounter=93824998889744, registerFile=0x7fffffffd980, initAddressFiller=0x7fffffffda28)
    at src/interpreter/ByteCodeInterpreter.cpp:527
#11 0x0000555555611a21 in Escargot::Script::execute (this=0x7ffff4824190, state=..., isEvalMode=false, needNewEnv=false, isOnGlobal=true) at src/parser/Script.cpp:80
#12 0x0000555555611b73 in Escargot::Script::<lambda()>::operator()(void) const (__closure=0x7fffffffdd30) at src/parser/Script.cpp:93
#13 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
#14 0x00005555557a4106 in std::function<Escargot::Value ()>::operator()() const (this=0x7fffffffdd30) at /usr/include/c++/7/bits/std_function.h:706
#15 0x00005555557a2c4b in Escargot::SandBox::run(std::function<Escargot::Value ()> const&) (this=0x7fffffffdca0, scriptRunner=...) at src/runtime/SandBox.cpp:36
#16 0x0000555555611c50 in Escargot::Script::sandboxExecute (this=0x7ffff4824190, state=...) at src/parser/Script.cpp:94
#17 0x00005555557c102b in eval (context=0x7ffff7e59ed0, str=0x7ffff4829750, fileName=0x7ffff48296b0, shouldPrintScriptResult=false) at src/shell/Shell.cpp:46
#18 0x00005555557c197a in main (argc=2, argv=0x7fffffffe058) at src/shell/Shell.cpp:129

Found by Fuzzinator with grammarinator.

robertsipka added a commit to robertsipka/escargot that referenced this issue Jan 4, 2019
Pass an empty value for ObjectPropertyDescriptor call if
the value field of the current descriptor is not present.

Signed-off-by: Robert Sipka <rsipka.uszeged@partner.samsung.com>
robertsipka added a commit to robertsipka/escargot that referenced this issue Jan 6, 2019
Fixes Samsung#28

Signed-off-by: Robert Sipka <rsipka.uszeged@partner.samsung.com>
robertsipka added a commit to robertsipka/escargot that referenced this issue Jan 6, 2019
Fixes Samsung#28

Signed-off-by: Robert Sipka <rsipka.uszeged@partner.samsung.com>
yichoi pushed a commit that referenced this issue Jan 10, 2019
#45)

Fixes #28

Signed-off-by: Robert Sipka <rsipka.uszeged@partner.samsung.com>
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