Bug 524475

Summary: segmentation fault in /usr/bin/modulecmd
Product: [Fedora] Fedora Reporter: Dominik 'Rathann' Mierzejewski <dominik>
Component: environment-modulesAssignee: Orion Poplawski <orion>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: orion
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 3.2.7b-2.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-14 01:40:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dominik 'Rathann' Mierzejewski 2009-09-20 17:11:06 UTC
Description of problem:
modulecmd aborts with segmentation fault if run directly without parameters. I know that this is not the intended usage, but it still shouldn't segfault. In this case, the code is calling strcmp on a NULL pointer.

Version-Release number of selected component (if applicable):
environment-modules-3.2.6-7.fc11.x86_64

How reproducible:
Always

Steps to Reproduce:
1. run /usr/bin/modulecmd without parameters
  
Actual results:
$ gdb /usr/bin/modulecmd
GNU gdb (GDB) Fedora (6.8.50.20090302-38.fc11)
...
(gdb) run
Starting program: /usr/bin/modulecmd 
init.c(294):ERROR:11: Usage is '/usr/bin/modulecmd shellname'

Program received signal SIGSEGV, Segmentation fault.
0x0000000000411c7e in OutputExit () at utility.c:3007
3007		if( !strcmp( shell_derelict, "csh")) {
(gdb) bt
#0  0x0000000000411c7e in OutputExit () at utility.c:3007
#1  0x0000000000414cb6 in main (argc=1, argv=0x7fffffffe298, environ=<value optimized out>) at main.c:358
(gdb) disp shell_derelict 
1: shell_derelict = 0x0

Expected results:
It should just exit with an error message without segfaulting.

Comment 1 Orion Poplawski 2009-09-21 16:10:32 UTC
This appears to be fixed in 3.2.7.  I'll try to get an update out soon.

Comment 2 Fedora Update System 2009-09-21 17:19:56 UTC
environment-modules-3.2.7-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/environment-modules-3.2.7-1.fc11

Comment 3 Fedora Update System 2009-09-23 21:29:39 UTC
environment-modules-3.2.7b-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/environment-modules-3.2.7b-2.fc11

Comment 4 Fedora Update System 2009-09-25 20:12:49 UTC
environment-modules-3.2.7b-2.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update environment-modules'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9947

Comment 5 Fedora Update System 2009-10-14 01:40:42 UTC
environment-modules-3.2.7b-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.