clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
17 stars 5 forks source link

SEGV while running shared variable initialization code #9

Closed gary-funck closed 11 years ago

gary-funck commented 11 years ago

Three of the intrepid tests fail with a segmentation fault.

./test18 -n 8
test: test18 opt: -O0 threads: dynamic elapsed: 0.102 user: 0.000 sys: 0.000
thread 0 terminated with signal: 'Segmentation fault'
failed: status = 143
--
./test25 -n 8
test: test25 opt: -O0 threads: dynamic elapsed: 0.102 user: 0.000 sys: 0.001
thread 1 terminated with signal: 'Segmentation fault'
failed: status = 143
--
./test29 -n 8
test: test29 opt: -O0 threads: dynamic elapsed: 0.103 user: 0.001 sys: 0.002
thread 0 terminated with signal: 'Segmentation fault'
failed: status = 143

These tests fail on an x86_64 system running FC18. We have seen this failure with GUPC on a recent version of SUSE. The fix we made was to no longer locate the initialization code into its own .upc_init linker section. This change was made in the following GUPC commit.

Author: nenadv
Date: Sat Oct 27 19:37:34 2012
New Revision: 192880

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192880 [^]
Log:
        Place shared initialization code into the .text
        section instead of a separate .upc_init section.
        * gcc/defaults.h (UPC_INIT_SECTION_NAME): Delete.
        (UPC_INIT_BEGIN_NAME): Delete.
        (UPC_INIT_END_NAME): Delete.
        * gcc/doc/tm.texi.in: Ditto.
        * gcc/doc/tm.texi: Ditto.
        * gcc/upc/upc-act.c (upc_build_init_func): Remove settings
        of the section for shared initialization code.
        * libgupc/config/default/upc-crt-config.h (UPC_INIT_SECTION_BEGIN):
        Delete.
        (UPC_INIT_SECTION_END): Delete.
        * libgupc/config/darwin/upc-crt-config.h: Ditto.
        * libgupc/upc-crtstuff.c: Remove declarations for .upc_init
        section start/end.
gary-funck commented 11 years ago

make clang-test fails:

FAIL: Clang :: CodeGenUPC/init-shared-int.upc (2200 of 4612)
******************** TEST 'Clang :: CodeGenUPC/init-shared-int.upc' FAILED ****
****************
Script:
--
/eng/upc/dev/gary/clang/bld/bin/./clang -cc1 -internal-isystem /eng/upc/dev/gar
y/clang/bld/bin/../lib/clang/3.1/include /eng/upc/dev/gary/clang/src/llvm/tools
/clang/test/CodeGenUPC/init-shared-int.upc -emit-llvm -triple x86_64-pc-linux -
fupc-threads 4 -o - | FileCheck /eng/upc/dev/gary/clang/src/llvm/tools/clang/te
st/CodeGenUPC/init-shared-int.upc
--
Exit Code: 1
Command Output (stderr):
--
/eng/upc/dev/gary/clang/src/llvm/tools/clang/test/CodeGenUPC/init-shared-int.up
c:4:11: error: expected string not found in input
// CHECK: define internal void @__upc_global_var_init() nounwind section "upc_i
nit"
          ^
:1:1: note: scanning from here
; ModuleID = '/eng/upc/dev/gary/clang/src/llvm/tools/clang/test/CodeGenUPC/init
-shared-int.upc'
^
:14:1: note: possible intended match here
[...]
gary-funck commented 11 years ago

Confirmed closed: passes the internal test suite and the separate clang upc test suite.