Andreas,

GrowableIndexdMemoryChunk is not intended to be thread safe.
As a general rule, collection classes in x10.util are not trying to be 
thread safe.
Classes in x10.util.concurrent should be thread safe.

It is indeed possible the runtime makes the incorrect assumption GIMC is 
thread safe somewhere.
I'll have a look shortly.
Thanks for the report.

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
------------------------------------------------------------------------------
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

Reply via email to