Ticket #991 (closed bug: fixed)

Opened 12 years ago

Last modified 12 years ago

Parrot dumps core when attempting to create a FixedPMCArray with negative length

Reported by: dukeleto Owned by: dukeleto
Priority: critical Milestone:
Component: core Version: 1.5.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description (last modified by dukeleto) (diff)

This code:

.sub main
    new $P0, ['FixedPMCArray']     
    set $P0, -1
.end

does this:

Failed allocation of 4294967292 bytes
Parrot VM: PANIC: Out of mem!
C file src/gc/alloc_memory.c, line 61
Parrot file (not available), line (not available)

We highly suggest you notify the Parrot team if you have not been working on
Parrot.  Use parrotbug (located in parrot's root directory) or send an
e-mail to parrot-dev@lists.parrot.org.
Include the entire text of this error message and the text of the script that
generated the error.  If you've made any modifications to Parrot, please
describe them as well.

Version     : 1.5.0-devel
Configured  : Mon Sep  7 20:01:36 2009 GMT
Architecture: nojit
JIT Capable : No
Interp Flags: (no interpreter)
Exceptions  : (missing from core)

Dumping Core...

Change History

Changed 12 years ago by dukeleto

  • description modified (diff)

Changed 12 years ago by dukeleto

  • description modified (diff)

Changed 12 years ago by dukeleto

A full backtrace from darwin-x86:

(gdb) bt full
#0  0x91e63e42 in __kill ()
No symbol table info available.
#1  0x91e63e34 in kill$UNIX2003 ()
No symbol table info available.
#2  0x91ed623a in raise ()
No symbol table info available.
#3  0x00486b45 in do_panic (interp=0x0, message=0x6d714e "Out of mem", file=0x6d7138 "src/gc/alloc_memory.c", line=61) at src/exceptions.c:773
	_ASSERT_ARGS_CHECK = 0
#4  0x0049292d in failed_allocation (line=61, size=4294967292) at src/gc/alloc_memory.c:31
No locals.
#5  0x0049295e in mem_sys_allocate (size=4294967292) at src/gc/alloc_memory.c:61
	_ASSERT_ARGS_CHECK = 0
	ptr = (void * const) 0x0
#6  0x006479fd in Parrot_FixedPMCArray_set_integer_native (interp=0x9017c0, pmc=0xe8708, size=-1) at fixedpmcarray.pmc:370
	i = 950968
	data = (PMC **) 0x0
#7  0x0042b6aa in Parrot_set_p_ic (cur_opcode=0x912aac, interp=0x9017c0) at set.ops:177
	CUR_CTX = (const Parrot_Context * const) 0x90bf50
#8  0x004fdf6e in runops_slow_core (interp=0x9017c0, runcore=0x90b8a0, pc=0x912aac) at src/runcore/cores.c:1001
	_ASSERT_ARGS_CHECK = 0
#9  0x004fc52a in runops_int (interp=0x9017c0, offset=0) at src/runcore/main.c:629
	pc = (opcode_t * const) 0x912aa0
	core = (const runcore_runops_fn_type) 0x4fde20 <runops_slow_core>
	_ASSERT_ARGS_CHECK = 0
#10 0x004a6c95 in runops (interp=0x9017c0, offs=0) at src/call/ops.c:119
	_ASSERT_ARGS_CHECK = 0
	offset = 0
	old_runloop_id = 0
	our_runloop_level = 1
	our_runloop_id = 1
#11 0x004a6fd7 in runops_args (interp=0x9017c0, sub=0xe8270, obj=0x203b2f0, meth_unused=0x0, sig=0x6d6922 "vP", ap=0xbffff32c "??\016") at src/call/ops.c:269
	_ASSERT_ARGS_CHECK = 0
	offset = 0
	dest = (opcode_t *) 0x912aa0
	ctx = (PMC *) 0xe82b8
	new_sig = "\000\000] H\000p?\016"
	sig_p = 0x6d6923 "P"
	old_ctx = (PMC * const) 0xe80d8
#12 0x004a7cea in Parrot_runops_fromc_args (interp=0x9017c0, sub=0xe8270, sig=0x6d6922 "vP") at src/call/ops.c:338
	_ASSERT_ARGS_CHECK = 0
	args = 0xbffff32c "??\016"
	ctx = (PMC *) 0x0
	retval = (PMC *) 0x2053a00
#13 0x004825c1 in Parrot_runcode (interp=0x9017c0, argc=1, argv=0xbffff430) at src/embed.c:852
	userargv = (PMC *) 0xe8288
	main_sub = (PMC *) 0xe8270
#14 0x006ae4f7 in imcc_run_pbc (interp=0x9017c0, obj_file=0, output_file=0x0, argc=1, argv=0xbffff430) at compilers/imcc/main.c:797
	_ASSERT_ARGS_CHECK = 0
#15 0x006af1a9 in imcc_run (interp=0x9017c0, sourcefile=0xbffff54e "core.pir", argc=1, argv=0xbffff430) at compilers/imcc/main.c:1088
	obj_file = 0
	yyscanner = (yyscan_t) 0x90bdb0
	output_file = 0x0
#16 0x00002559 in main (argc=1, argv=0xbffff430) at src/main.c:60
	sourcefile = 0xbffff54e "core.pir"
	interp = (Interp *) 0x9017c0
	status = 4096

Changed 12 years ago by dukeleto

  • owner set to dukeleto

Fixed and test enabled in r41149 .

Changed 12 years ago by dukeleto

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.