jerryscript-project / jerryscript

Ultra-lightweight JavaScript engine for the Internet of Things.
https://jerryscript.net
Apache License 2.0
6.92k stars 669 forks source link

Segmentation fault in ecma_builtin_date_prototype_set_utc_minutes #413

Closed renatahodovan closed 9 years ago

renatahodovan commented 9 years ago
Jerry version:
Checked revision: abc2b55
Build: debug.linux
OS:
Ubuntu 15.04, x86_64
Test case:
Date.prototype.setUTCMinutes();
Backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x000000000048fd22 in ecma_builtin_date_prototype_set_utc_minutes(unsigned int, unsigned int const*, unsigned int) [clone .lto_priv.1041] (this_arg=2823, args=0x0, args_number=0)
    at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.cpp:730
730   ECMA_OP_TO_NUMBER_TRY_CATCH (m, args[0], ret_value);
(gdb) bt
#0  0x000000000048fd22 in ecma_builtin_date_prototype_set_utc_minutes(unsigned int, unsigned int const*, unsigned int) [clone .lto_priv.1041] (this_arg=2823, args=0x0, args_number=0)
    at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.cpp:730
#1  0x0000000000495dfd in ecma_builtin_date_prototype_dispatch_routine (builtin_routine_id=174, this_arg_value=2823, arguments_list=0x0, arguments_number=0)
    at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date-prototype.inc.h:73
#2  0x0000000000497e55 in ecma_builtin_dispatch_routine(ecma_builtin_id_t, unsigned short, unsigned int, unsigned int const*, unsigned int) [clone .lto_priv.1098] (builtin_object_id=ECMA_BUILTIN_ID_DATE_PROTOTYPE, 
    builtin_routine_id=174, this_arg_value=2823, arguments_list=0x0, arguments_number=0) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:145
#3  0x00000000004a094f in ecma_builtin_dispatch_call (obj_p=0x7e1960 <_ZL13mem_heap_area.lto_priv.1140+7584>, this_arg_value=2823, arguments_list_p=0x0, arguments_list_len=0)
    at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.cpp:419
#4  0x0000000000450fcc in ecma_op_function_call(ecma_object_t*, unsigned int, unsigned int const*, unsigned int) (func_obj_p=0x7e1960 <_ZL13mem_heap_area.lto_priv.1140+7584>, this_arg_value=2823, 
    arguments_list_p=0x0, arguments_list_len=0) at jerryscript/jerry-core/ecma/operations/ecma-function-object.cpp:787
#5  0x0000000000441908 in opfunc_call_n (opdata=..., int_data=0x7fffffffdbb0) at jerryscript/jerry-core/vm/opcodes.cpp:866
#6  0x00000000004aacb5 in vm_loop (int_data_p=0x7fffffffdbb0, run_scope_p=0x0) at jerryscript/jerry-core/vm/vm.cpp:466
#7  0x00000000004aaf42 in vm_run_from_pos (opcodes_p=0x7e2cd8 <_ZL13mem_heap_area.lto_priv.1140+12568>, start_pos=1, this_binding_value=835, lex_env_p=0x7e2bc8 <_ZL13mem_heap_area.lto_priv.1140+12296>, 
    is_strict=false, is_eval_code=false) at jerryscript/jerry-core/vm/vm.cpp:556
#8  0x00000000004aab1f in vm_run_global () at jerryscript/jerry-core/vm/vm.cpp:395
#9  0x00000000004a69c1 in jerry_run () at jerryscript/jerry-core/jerry.cpp:1375
#10 0x00000000004a556c in main (argc=2, argv=0x7fffffffdf78) at jerryscript/main-linux.cpp:294
renatahodovan commented 9 years ago

Calling the following functions on the Date.prototype also ends in a segfault:

setUTCSeconds, setMinutes, setHours, setUTCHours, setFullYear, setUTCFullYear