Hello Dave,

Thanks for your reply. I use x10c++ to compile the code, x10 version
is 2.3.0 that built from the source and gcc is 4.4.6 for
x86_64-redhat-linux. Additionally,  I change the AtomicBoolean to
Integer and run the code again, everything works fine. Thus, I doubt
somewhere else goes wrong.

BR,
Long

On 5/1/13, David P Grove <gro...@us.ibm.com> wrote:
>
> Hi,
>
>       I'd wonder if perhaps you are running a 32 bit executable (Native
> X10) or on a 32-bit JVM (Managed X10)?  The segfault is happening at
> roughly where one might expect to have exhausted a 32-bit address space.
>
> --dave
>
> Long Cheng <parach...@gmail.com> wrote on 04/30/2013 12:49:31 PM:
>>
>> I try to build an array[AtomicBoolean] and meet a problem that:  there
>> is an "Segmentation fault" error when the size of the array is 500M,.
>> The test code is below that I try to build the array with size N and
>> initialize each element as "true" .
>>
>> import x10.util.concurrent.AtomicBoolean;
>> public class test {
>>         public static def main(args: Array[String]) {
>>                 val n=Int.parse(args(0));
>>                 val N=Math.pow(2,n) as Int;
>>                 Console.OUT.println(N);
>>                 var c:Array[AtomicBoolean]=new Array[AtomicBoolean](N);
>>                 for(i in 0..(N-1)){
>>                         c(i)=new AtomicBoolean(true);
>>                 }
>>                 Console.OUT.println(n+" has done");
>>         }
>> }
>>
>> I try the input n with 25,26,27,28,29,30. And the test results are
>> below. It shows that 25,26,27,28 work well, but meet the "Segmentation
>> fault" when trying with 29. I empty the cache and run 29 alone, but
>> still meet the problem. And when I try with 30, I wait minutes and the
>> program seems just hang there. This thing also happens with
>> "AtomicInteger". The memory of my machine is 128GB, is there any
>> comment about this?
>> //ps: Though the method var c:Array[AtomicBoolean]=new
>> Array[AtomicBoolean](N, new AtomicBoolean(true)) works, but that is
>> not I want.
>>
>> 33554432
>> 25 has done
>> 67108864
>> 26 has done
>> 134217728
>> 27 has done
>> 268435456
>> 28 has done
>> 536870912
>> Segmentation fault
>>

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to