External Issue: Unexpected error message issued: 'Encountered corrupt string metadata'

16702, “tmacd8”, “Unexpected error message issued: ‘Encountered corrupt string metadata’”, “2020-11-13T20:04:46Z”

Summary of Problem

The following source code compiles but causes an unexpected runtime error during execution.

Steps to Reproduce

Source Code:

module X {
 private use Sys;
 private use FileSystem;
 private use Random;
 private use Time;
 private use List;
 private use IO;
 private use SysCTypes;

 type str = string;
 config const a:int = -1;

 var MSG: str = "";

  // directory creation returns true or false.
 inline proc mdir(const ref dpath: str, const perms: int): bool {
   try { mkdir(dpath, perms); } catch { return false; }
   return true;
 }  // mdir

 proc make_dir() {
   var val: c_string;
   var st: c_int = sys_getenv("TMP", val);
   if st != 1 {
     st = sys_getenv("DOCUMENT_ROOT", val);
     if st == 1 { val = ".."; }
   }
   const tmp: str = if (st == 1) then val else "/tmp";
   const pth: str = tmp + "/loc";

   try {
     // need a TMP directory (default is /tmp)
     if (exists(tmp) || !mdir(tmp, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)) &&
         !isDir(tmp) {
       if a < 0 {
         halt("Cannot create a tmp path: '", tmp, "'");
       } else {
         MSG += "| ERROR: Cannot create a tmp path: '" + tmp + "'";
         exit(0);
       }
     }
   } catch {
     if a < 0 {
       halt("Unknown error creating a dir path: '", pth, "'");
     } else {
       MSG += "| ERROR: Unknown error creating a dir path: '" + pth + "'";
       exit(0);
     }
   }
 }

 proc main() {
  make_dir();
 }
}

Compile command:
chpl x.chpl

Execution command:
./x
x.chpl:33: error: halt reached - Encountered corrupt string metadata

Configuration Information

  • Output of chpl --version:
    chpl version 1.23.0

  • Output of $CHPL_HOME/util/printchplenv --anonymize:
    CHPL_TARGET_PLATFORM: linux64
    CHPL_TARGET_COMPILER: gnu
    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: none
    CHPL_HWLOC: hwloc
    CHPL_REGEXP: re2
    CHPL_LLVM: none
    CHPL_AUX_FILESYS: none

  • Back-end compiler and version, e.g. gcc --version or clang --version:
    gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0