Hi,

I went through the runtime code but could not find any issue with
non-protected accessed to GrowableIndexedMemoryChunk.
I may have missed something of course.

Are you using Stack or ArrayList in your code?
These two classes are implemented on top of GrowableIndexedMemoryChunk.
So adding or removing elements concurrently from a Stack or an ArrayList
may result in the error you observed.


You could look into this by
1) compiling the x10 runtime without garbage collection
ant dist -DDISABLE_GC=true
2) running your application with a memory profiler such as valgrind.

Of course, you may run out of memory before getting anything meaningful
from valgrind.

Alternatively you could share you code with me so I can try to dig deeper.

Olivier


Andreas Zwinkau <zwin...@kit.edu> wrote on 11/19/2012 07:49:02 AM:

> From: Andreas Zwinkau <zwin...@kit.edu>
> To: x10-users@lists.sourceforge.net,
> Date: 11/19/2012 07:49 AM
> Subject: [X10-users] Duplicate large block deallocation
>
> There is at least one race condition in the runtime.
>
> My larger application (multigrid algorithm for solving partial
> differential equations) crashes with a garbage collection error after
> some indeterministic time:
>
> Duplicate large block deallocation of 0x13bc9000
> Duplicate large block deallocation
>
> I'm not sure where exactly this problem happens, but at least I
> discovered something in GrowableIndexedMemoryChunk. The grow/shrink
> method is not thread-safe, so a concurrent use is dangerous. Here is a
> small program to reproduce it (dual core machine and X10_NTHREADS=2):
>
> import x10.util.GrowableIndexedMemoryChunk;
> public class LargeDealloc {
>    private static def adding(chunk:GrowableIndexedMemoryChunk[int]) {
>       while(true) {
>          val size = chunk.capacity();
>          chunk.grow(size+2);
>       }
>    }
>    public static def main(args:Array[String]):void {
>       val m = new GrowableIndexedMemoryChunk[int]();
>       finish {
>          async { adding(m); }
>          async { adding(m); }
>       }
>    }
> }
>
> Is that a bug or just wrong use of GrowableIndexedMemoryChunk?
>
> My application does not use GrowableIndexedMemoryChunk directly, so the
> runtime seems to have a bug anyways.
>
> --
> Andreas Zwinkau
>
>  Karlsruhe Institute of Technology (KIT)
>  Institut für Programmstrukturen und Datenorganisation (IPD)
>  Lehrstuhl Prof. Snelting
>  Adenauerring 20a
>  76131 Karlsruhe
>
>  Phone:  +49 721 608 48351
>  Fax:    +49 721 608 48457
>  Email:  zwin...@kit.edu
>  Web:    http://pp.info.uni-karlsruhe.de/person.php?id=107
>
>  KIT – University of the State of Baden-Wuerttemberg and
>  National Research Center of the Helmholtz Association
> [attachment "0xB7A62DA2.asc" deleted by Olivier Tardieu/Watson/IBM]
> [attachment "signature.asc" deleted by Olivier Tardieu/Watson/IBM]
>
------------------------------------------------------------------------------

> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/
> zoho_dev2dev_nov_______________________________________________
> X10-users mailing list
> X10-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/x10-users
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to