From: Anirban B. <ban...@gm...> - 2006-09-09 19:29:29
|
Hello everyone, Newbie here :) . I'm trying to create a 4D array with 151X151X151X151 float elements. When I run the code, I get an error, and using gdb I see the following messages. I'm using Array <float, 4> ford(151,151,151,151); to declare the array. I'm not doing anything fancy after this. But the execution stops when it hits this declaration. I think its possibly a memory allocation error. If anyone has come across something similar, cold you please let me have a pointer as to how to get around this problem. Any help would be greatly appreciated. I attach gdb diagnostics below: thanks in advance. -Anirban (gdb) r 4 Starting program: /root/sanbox/cmiyc/tstscrpt/code/mutualinfo 4 Reading symbols from shared object read from target memory...done. Loaded system supplied DSO at 0x16b000 terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc Program received signal SIGABRT, Aborted. 0x0016b402 in __kernel_vsyscall () (gdb) bt #0 0x0016b402 in __kernel_vsyscall () #1 0x002791f8 in raise () from /lib/libc.so.6 #2 0x0027a948 in abort () from /lib/libc.so.6 #3 0x006a5a64 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6 #4 0x006a36d1 in __gxx_personality_v0 () from /usr/lib/libstdc++.so.6 #5 0x006a3706 in std::terminate () from /usr/lib/libstdc++.so.6 #6 0x006a383a in __cxa_throw () from /usr/lib/libstdc++.so.6 #7 0x006a3c51 in operator new () from /usr/lib/libstdc++.so.6 #8 0x006a3d0d in operator new[] () from /usr/lib/libstdc++.so.6 #9 0x0804bf7f in blitz::MemoryBlock<float>::allocate (this=0x9ba3008, length=533794816) at /usr/local/include/blitz/memblock.cc:44 #10 0x0804bfc3 in MemoryBlock (this=0x9ba3008, items=533794816) at /usr/local/include/blitz/memblock.h:75 #11 0x0804c019 in blitz::MemoryBlockReference<float>::newBlock (this=0x8054920, items=533794816) at /usr/local/include/blitz/memblock.h:340 #12 0x0804dfdc in blitz::Array<float, 4>::setupStorage (this=0x8054920, lastRankInitialized=3) at /usr/local/include/blitz/array/methods.cc:258 #13 0x0804e0d1 in Array (this=0x8054920, length0=152, length1=152, length2=152, length3=152, storage=@0xbfcb0730) at /usr/local/include/blitz/array-impl.h:203 #14 0x0804a8f2 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at main.c:51 #15 0x0804a9a3 in global constructors keyed to ford () at main.c:557 #16 0x08052c3e in __do_global_ctors_aux () #17 0x080488d9 in _init () #18 0x08052bea in __libc_csu_init () #19 0x00265d83 in __libc_start_main () from /lib/libc.so.6 #20 0x08048abd in _start () (gdb) |