cea-hpc / modules

Environment Modules: provides dynamic modification of a user's environment
http://modules.sourceforge.net/
GNU General Public License v2.0
668 stars 102 forks source link

error when loading module with a specific color palette #455

Closed xdelaruelle closed 2 years ago

xdelaruelle commented 2 years ago

On version 5.1.0, with a specific color palette configuration with no entry for the hi color element, for instance:

module config colors foo=42

Load or unload of a module crashes:

ERROR: can't read "::g_colors(hi)": no such element in array
      while executing
  "append sgrcode $::g_colors(hi)"
      (procedure "sgr" line 96)
      invoked from within
  "sgr $eltsgrlist $elt $himatchmap $tagsgrlist"
      (procedure "formatListEltToDisplay" line 21)
      invoked from within
  "formatListEltToDisplay $moddesig {} {} {} {} 0 0 $taglist $showtags $vrlist $vrsgr 1 $himatchmap"
      (procedure "getModuleDesignation" line 52)
      invoked from within
  "getModuleDesignation $msgrecid {} 2"
      (procedure "cmdModuleLoad" line 312)
      invoked from within
  "cmdModuleLoad load 1 $tag_list {*}$args"
      (procedure "module" line 125)
      invoked from within
  "{*}$execcmdlist"
  Please report this issue at https://github.com/cea-hpc/modules/issues

Crash occurs during the making of the module designation.