Bug 189484 - sysutils/modules segfaults when adding a new path
Summary: sysutils/modules segfaults when adding a new path
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-08 21:20 UTC by Marcus Breese
Modified: 2014-10-05 21:58 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Breese 2014-05-08 21:20:00 UTC
Environment modules is used to selectively choose which version of programs to load into the environment. It is commonly used on HPC clusters. It is included in ports as sysutils/modules

The stock installation of sysutils/modules includes a configuration file: /usr/local/Modules/3.1.6/init/.modulespath

This is what is in the file:

#
#  @(#).modulespath.in	1.3\t95/08/06  
#  Module version 3.1.6
#
#  Modulepath initial setup
#  ========================
#
#  This file defines the initial setup for the module files search path.
#  Comments may be added anywhere. The begin on # and continue until the 
#     end of the line
#  Each line containing a single path will be added to the MODULEPATH
#     environment variable. You may add as many as you want - just
#     limited by the variable size of your shell.
#

/usr/local/Modules/versions					# location of version files
/usr/local/Modules/$MODULE_VERSION/modulefiles		# Module pkg modulefiles
/usr/local/lib/					# General module files
# /usr/local/Modules/3.1.6/your_contribs			# Edit for your requirements


If you try to add a new path to the list (at the bottom), the program segfaults and dumps a core in the current directory.

Fix: 

The problem is that /usr/local/lib is getting added as a location for possible new module definitions. Something in the parsing of /usr/local/lib is causing the program to segfault.

Commenting out /usr/local/lib solves the problem.
How-To-Repeat: Install sysutils/modules, add a new path to the end of the .modulepath file. Run 'module avail'. (Modules is usually setup as part of a shell function, to test it directly, run '/usr/local/Modules/3.1.6/bin/modulecmd bash avail` (or zsh, or tcsh, etc...).
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-08 21:20:04 UTC
Maintainer of sysutils/modules,

Please note that PR ports/189484 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/189484

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-08 21:20:05 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 John Marino freebsd_committer freebsd_triage 2014-06-18 22:59:09 UTC
CC maintainer again, lost in conversion

hokan, please respond...
Comment 4 John Marino freebsd_committer freebsd_triage 2014-07-26 13:26:06 UTC
marcus, note that hokan has lost his maintainership due to not providing stage support for the port.  Therefore it is going to be removed by the end of August unless that is fixed.  I'm telling you in case you want to save the port by providing a patch to make it support stage.
Comment 5 John Marino freebsd_committer freebsd_triage 2014-10-05 21:58:18 UTC
port version was updated so this PR is obsolete (as well as having submitter feedback timeout), closing.