jerryscript icon indicating copy to clipboard operation
jerryscript copied to clipboard

Segmentation fault in mem_pools_alloc (from ecma_alloc_number)

Open renatahodovan opened this issue 10 years ago • 1 comments

Jerry version:
Checked revision: e1c8a2e
Build: debug.linux
OS:
Ubuntu 15.10, x86_64
Test case:
((new RegExp("}").constructor)("a", "g").constructor)(undefined).constructor.prototype.toString();
new Date("2015-07-09T12:13:14.121+01:30").toISOString();
RegExp(new RegExp("a", "g")).constructor("").constructor.prototype.compile(RegExp.prototype);
new Date("2015-09-17").getUTCFullYear();

The place of the segfault is the same as in #1072 but the reason (at least the traces) looks different.

Backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x000000000047a61d in mem_pools_alloc () at jerryscript/jerry-core/mem/mem-poolman.c:147
147     mem_free_chunk_p = chunk_p->next_p;
#0  0x000000000047a61d in mem_pools_alloc () at jerryscript/jerry-core/mem/mem-poolman.c:147
#1  0x000000000044a0dc in ecma_alloc_number () at jerryscript/jerry-core/ecma/base/ecma-alloc.c:92
#2  0x0000000000442505 in ecma_create_float_number (ecma_number=1442448000000) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:346
#3  0x000000000044262a in ecma_make_number_value (ecma_number=1442448000000) at jerryscript/jerry-core/ecma/base/ecma-helpers-value.c:412
#4  0x000000000046421c in ecma_builtin_date_parse (this_arg=2323, arg=2002) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date.c:383
#5  0x00000000004645d9 in ecma_builtin_date_dispatch_construct (arguments_list_p=0x7fffffffcbd4, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtin-date.c:505
#6  0x00000000004748bc in ecma_builtin_dispatch_construct (obj_p=0x8b37c0 <mem_heap+1856>, arguments_list_p=0x7fffffffcbd4, arguments_list_len=1) at jerryscript/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h:153
#7  0x0000000000431b10 in ecma_op_function_construct (func_obj_p=0x8b37c0 <mem_heap+1856>, arguments_list_p=0x7fffffffcbd4, arguments_list_len=1) at jerryscript/jerry-core/ecma/operations/ecma-function-object.c:844
#8  0x000000000047aed1 in opfunc_construct.lto_priv.798 (frame_ctx_p=0x7fffffffcc50) at jerryscript/jerry-core/vm/vm.c:437
#9  0x000000000047a139 in vm_execute (frame_ctx_p=0x7fffffffcc50, arg_p=0x0, arg_list_len=0) at jerryscript/jerry-core/vm/vm.c:2509
#10 0x000000000047a1bf in vm_run_with_inline_stack.lto_priv.796 (frame_ctx_p=0x7fffffffcc50, arg_p=0x0, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:2540
#11 0x00000000004766d0 in vm_run (bytecode_header_p=0x8b3378 <mem_heap+760>, this_binding_value=35, lex_env_p=0x8b30b8 <mem_heap+56>, is_eval_code=false, arg_list_p=0x0, arg_list_len=1) at jerryscript/jerry-core/vm/vm.c:2614
#12 0x000000000047a9d2 in vm_run_global (error_value_p=0x7fffffffcd38) at jerryscript/jerry-core/vm/vm.c:190
#13 0x000000000048194a in jerry_run (error_value_p=0x7fffffffced0) at jerryscript/jerry-core/jerry.c:1748
#14 0x000000000047fbc2 in main (argc=2, argv=0x7fffffffd3c8) at jerryscript/main-unix.c:511

renatahodovan avatar May 19 '16 10:05 renatahodovan

Works on current master (97be8bf).

ktorpi avatar Jul 08 '16 10:07 ktorpi