Hi!

----

The example below triggers a valgrind hit (note that valgrind needs to
be patched as described in
http://lists.research.att.com/pipermail/ast-developers/2013q2/002574.html
("[ast-developers] valgrind 3.8.1 patch to recognise libast
allocator...")) in ast-ksh.2013-05-24...
-- snip --
$ valgrind ~/bin/ksh -c 'bool -a bl ; (( bl[7000][8000][9000]=true ))
; print -v bl'
==32386== Memcheck, a memory error detector
==32386== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==32386== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==32386== Command: /home/test001/bin/ksh -c bool\ -a\ bl\ ;\ ((\
bl[7000][8000][9000]=true\ ))\ ;\ print\ -v\ bl
[snip]
==32386==
==32386== Invalid read of size 8
==32386==    at 0x41C80B: array_unscope (array.c:125)
==32386==    by 0x41E7F5: array_putval (array.c:793)
==32386==    by 0x40FECF: nv_putv (nvdisc.c:152)
==32386==    by 0x45661A: nv_putval (name.c:1606)
==32386==    by 0x41E18E: array_putval (array.c:652)
==32386==    by 0x40FECF: nv_putv (nvdisc.c:152)
==32386==    by 0x458B76: _nv_unset (name.c:2535)
==32386==    by 0x418EAA: nv_settype (nvtype.c:1459)
==32386==    by 0x4A183E: setall (typeset.c:731)
==32386==    by 0x4A072D: b_typeset (typeset.c:458)
==32386==    by 0x47A915: sh_exec (xec.c:1357)
==32386==    by 0x47D967: sh_exec (xec.c:2218)
==32386==  Address 0x594f6f8 is 72 bytes inside a block of size 400 free'd
==32386==    at 0x4C29BF2: _ast_free (vg_replace_malloc.c:1001)
==32386==    by 0x41E712: array_putval (array.c:780)
==32386==    by 0x40FECF: nv_putv (nvdisc.c:152)
==32386==    by 0x45661A: nv_putval (name.c:1606)
==32386==    by 0x41E18E: array_putval (array.c:652)
==32386==    by 0x40FECF: nv_putv (nvdisc.c:152)
==32386==    by 0x458B76: _nv_unset (name.c:2535)
==32386==    by 0x418EAA: nv_settype (nvtype.c:1459)
==32386==    by 0x4A183E: setall (typeset.c:731)
==32386==    by 0x4A072D: b_typeset (typeset.c:458)
==32386==    by 0x47A915: sh_exec (xec.c:1357)
==32386==    by 0x47D967: sh_exec (xec.c:2218)
==32386==
(
        typeset -a [7000]=(
                typeset -a [8000]=(
                        [9000]=true
                )
        )
)
-- snip --

This is "read after |free()|" ...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to