27652, "jabraham17", "[Bug]: Building GASNet with GCC inside homebrew formula results in segfaults", "2025-08-14T21:10:17Z"
We recently added support for building our homebrew package with GASNet (udp and smp). However, we ran into some issues with our nightly testing after merging this to main.
Specifically, when building on an Ubuntu 22 machine with GCC 11, the following occurs with CHPL_TARGET_COMPILER=gnu and CHPL_COMM=gasnet (either udp or smp)
== Actual Test Output (raw, with verbose) ==
/home/linuxbrew/.linuxbrew/Cellar/chapel/2.6/libexec/third-party/gasnet/install/linux64-x86_64-native-llvm-none/substrate-udp/seg-everything/bin/amudprun -np 4 /var/tmp/chapel-test-20250814-83551-66340j/.chpl/chapel-test-dGFZXV/hello6-taskpar-dist_real -nl4 --printLocaleName=false -v
*** Caught a fatal signal (proc 1): SIGSEGV(11)
*** Caught a fatal signal (proc 2): SIGSEGV(11)
*** Caught a fatal signal (proc 3): SIGSEGV(11)
*** Caught a fatal signal (proc 0): SIGSEGV(11)
*** NOTICE (proc 2): Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace.
*** NOTICE (proc 3): Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace.
*** NOTICE (proc 2): We recommend linking the debug version of GASNet to assist you in resolving this application issue.
*** NOTICE (proc 0): Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace.
*** NOTICE (proc 1): Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace.
*** NOTICE (proc 3): We recommend linking the debug version of GASNet to assist you in resolving this application issue.
*** NOTICE (proc 0): We recommend linking the debug version of GASNet to assist you in resolving this application issue.
*** NOTICE (proc 1): We recommend linking the debug version of GASNet to assist you in resolving this application issue.
When I tried to debug this by setting CHPL_DEVELOPER=1 when building Chapel (and also specifying Env.O0 to tell Homebrew not to optimize, without this GASNet debug builds would fail), everything went back to working.
This hinted to me that maybe GASNet was mis-compiling with GCC 11 with optimizations enabled, but outside of the homebrew environment I could not replicate this.