From: Dan Bonachea (bonachea_at_cs_dot_berkeley_dot_edu)
Date: Thu Oct 20 2005 - 00:54:25 PDT
Hi Christian - thanks for writing.. We see two bugs in your attached code (tracked down by our developer Paul Hargrove), both of which are probably triggered by poor documentation on our part in bupc_extern.h. 1) bupc_extern_free() has essentially the same semantics as upc_free(), and as such should only be called by a single thread per allocation. Ie, in UPC, all threads collectively call upc_all_alloc, but only one may call the (non-collective) upc_free. This is one probable cause of the crash. 2) In the .upc file the code calls bupc_local_to_shared, but ignores the return value which provides the restored pointer-to-shared. This leads to an overrun (because it uses the local pointer rather than the shared pointer) of allocated memory, which is the second probable cause for the crash upon free. We've improved our documentation comments in bupc_extern.h, and a new version is attached for your convenience. Thanks for your patience... Dan At 03:51 PM 10/19/2005, Christian Terboven wrote: >Hi all. > >I got a SIGSEV when calling bupc_extern_free: > >=> upcrun -n 1 test01.exe >UPCR: UPC thread 0 of 1 on linuxoc01.rz.RWTH-Aachen.DE (process 0 of 1, >pid=29966) >I would like to be alone ... >I am 0 out of 1 ... >I am alone again ... > >=> upcrun -n 2 test01.exe >UPCR: UPC threads 0..1 of 2 on linuxoc01.rz.RWTH-Aachen.DE (process 0 of 1, >pid=29974) >I would like to be alone ... >I am 0 out of 2 ... >I am 1 out of 2 ... >I am alone again ... >*** Caught a fatal signal: SIGSEGV(11) on node 0/1 >zsh: segmentation fault (core dumped) upcrun -n 2 test01.exe > >I am using Berkeley-UPC 2.2.0 on an Opteron Linux 2.6.12#smp (Fedora Core 3). >I attached a reduced version of my code � is this a problem in there or what? > > > >Regards, >Christian > >