New Issue: Internal error with linked-list-like data structure

18183, "bmcdonald3", "Internal error with linked-list-like data structure", "2021-08-09T16:45:11Z"

Summary of Problem

While working to get the Apache Arrow header files working with c2chapel, I was hitting an internal error with the below snippet of code. I explored the error a bit with @bradcray, and we observed that it seemed to be happening due to a AST node being replaced, but we were unable to figure out if that should be happening/what was causing the error.

Steps to Reproduce

Source Code:

use SysCTypes;
use CPtr;

extern record _GHook {
  var next : c_ptr(GHook);
}

extern type GHook = _GHook;

Compiling this program (using CHPL_LLVM=none) with chpl ghook.chpl ghook.chpl:8: internal error: assertion error [resolution/postFold.cpp:105]`

Commenting out line 5 resolves the error.

Configuration Information

  • Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: darwin
CHPL_TARGET_COMPILER: clang
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: bundled
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: none *
CHPL_AUX_FILESYS: none
  • Back-end compiler and version, e.g. gcc --version or clang --version:
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.3.0
Thread model: posix