- changed component to Tests
-
assigned issue to
delete_array aborts the program
Issue #67
resolved
I have a simple program that sigaborts on delete_array().
#include <upcxx/upcxx.hpp>
using namespace upcxx;
#define DSIZE 128
global_ptr<int> my_data;
int main () {
int ldata[DSIZE];
upcxx::init();
my_data = new_array<int>(DSIZE);
{
future<> f = rput (ldata, my_data, sizeof(ldata));
while (!f.ready())
progress();
}
barrier ();
delete_array (my_data);
finalize();
}
(gdb) where
#0 0x00007ffff6d8ea28 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1 0x00007ffff6d9062a in __GI_abort () at abort.c:89
#2 0x00000000004111a5 in mspace_free ()
#3 0x000000000040572a in upcxx::delete_array<int> (gptr=...)
at /eng/upc/dev/nenad/upcxx/bld/upcxx/upcxx.O3.gasnet1_seq.smp/include/upcxx/allocate.hpp:193
#4 0x0000000000404d57 in main () at del_array.cpp:18
Comments (2)
-
-
reporter - changed status to resolved
Yes. I keep forgetting the typed interface.
- Log in to comment
This program has a buffer overrun - the rput argument should be
sizeof(ldata)/sizeof(int)
.See if that fixes the crash.