# New Issue: \[Bug\]: Building GASNet with GCC inside homebrew formula results in segfaults

**URL:** <https://chapel.discourse.group/t/new-issue-bug-building-gasnet-with-gcc-inside-homebrew-formula-results-in-segfaults/44469>\
**Category:** Issues\
**Created:** [August 14, 2025, 9:11pm UTC](https://chapel.discourse.group/t/new-issue-bug-building-gasnet-with-gcc-inside-homebrew-formula-results-in-segfaults/44469 "2025-08-14T21:11:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jabraham17](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@jabraham17](https://chapel.discourse.group/u/jabraham17)\
**Post date:** [August 14, 2025, 9:11pm UTC](https://chapel.discourse.group/t/new-issue-bug-building-gasnet-with-gcc-inside-homebrew-formula-results-in-segfaults/44469/1 "2025-08-14T21:11:36Z")

</div>

27652, "jabraham17", "[Bug]: Building GASNet with GCC inside homebrew formula results in segfaults", "2025-08-14T21:10:17Z"

> <https://github.com/chapel-lang/chapel/issues/27652>
>
> We \[recently added support for building our homebrew package with GASNet (udp an…d smp)\](https://github.com/chapel-lang/chapel/pull/27564). 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.

We [recently added support for building our homebrew package with GASNet (udp and smp)](https://github.com/chapel-lang/chapel/pull/27564). 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)

```Chapel
== 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.
