From nobody@FreeBSD.org  Thu May  8 20:18:10 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 14FE2E7E
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 May 2014 20:18:10 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id DCFA4EA8
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 May 2014 20:18:09 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s48KI99i083880
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 8 May 2014 20:18:09 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s48KI9tl083877;
	Thu, 8 May 2014 20:18:09 GMT
	(envelope-from nobody)
Message-Id: <201405082018.s48KI9tl083877@cgiserv.freebsd.org>
Date: Thu, 8 May 2014 20:18:09 GMT
From: Marcus Breese <marcus@breese.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sysutils/modules segfaults when adding a new path
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: hokan@me.umn.edu

>Number:         189484
>Category:       ports
>Synopsis:       sysutils/modules segfaults when adding a new path
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 08 20:20:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Thu May  8 20:30:01 UTC 2014
>Originator:     Marcus Breese
>Release:        10
>Organization:
Stanford University
>Environment:
FreeBSD cabiopeds-s1 10.0-RELEASE-p2 FreeBSD 10.0-RELEASE-p2 #0: Tue Apr 29 17:06:01 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
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.

>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...).

>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.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu May 8 20:20:05 UTC 2014 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=189484 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: hokan@me.umn.edu
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/189484: sysutils/modules segfaults when adding a new path
Date: Thu, 8 May 2014 20:20:04 UT

 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
>Unformatted:
