From 2ccfc854ef16c06d86f75376ae363a88917f13d9 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 24 Aug 2012 08:31:16 -0600 Subject: [PATCH] Add patch to fix segfault from Tcl RexExp handling (bug 834580) --- environment-modules-regex.patch | 34 +++++++++++++++++++++++++++++++++ environment-modules.spec | 9 ++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 environment-modules-regex.patch diff --git a/environment-modules-regex.patch b/environment-modules-regex.patch new file mode 100644 index 0000000..af2c9aa --- /dev/null +++ b/environment-modules-regex.patch @@ -0,0 +1,34 @@ +diff -ur modules-3.2.9.orig/cmdXResource.c modules-3.2.9/cmdXResource.c +--- modules-3.2.9.orig/cmdXResource.c 2010-11-11 19:23:18.000000000 +0100 ++++ modules-3.2.9/cmdXResource.c 2012-08-24 13:49:48.717499074 +0200 +@@ -446,7 +446,6 @@ + ** is a constant regexp! + **/ + +- if( !res_exp) + res_exp = Tcl_RegExpCompile(interp, + "^[ \t]*([^ \t]*)[ \t]*:[ \t]*(.*)[ \t]*$"); + +diff -ur modules-3.2.9.orig/utility.c modules-3.2.9/utility.c +--- modules-3.2.9.orig/utility.c 2011-11-28 22:27:13.000000000 +0100 ++++ modules-3.2.9/utility.c 2012-08-24 13:50:13.455735765 +0200 +@@ -3061,16 +3061,13 @@ + tstr = (const char *) TCL_RESULT(interp); + + /* compile regular expression the first time through */ +- if (!exit__expPtr) +- exit__expPtr = Tcl_RegExpCompile(interp, "^EXIT ([0-9]*)"); ++ exit__expPtr = Tcl_RegExpCompile(interp, "^EXIT ([0-9]*)"); + + /* result = "invoked \"break\" outside of a loop" */ +- if (!break_expPtr) +- break_expPtr = Tcl_RegExpCompile(interp, ".*\"break\".*"); ++ break_expPtr = Tcl_RegExpCompile(interp, ".*\"break\".*"); + + /* result = "invoked \"continue\" outside of a loop" */ +- if (!continue_expPtr) +- continue_expPtr = Tcl_RegExpCompile(interp, ".*\"continue\".*"); ++ continue_expPtr = Tcl_RegExpCompile(interp, ".*\"continue\".*"); + + /* intercept any "EXIT N" first */ + if(tstr && *tstr && 0 < Tcl_RegExpExec(interp, exit__expPtr, diff --git a/environment-modules.spec b/environment-modules.spec index b655f0f..8fa085e 100644 --- a/environment-modules.spec +++ b/environment-modules.spec @@ -1,6 +1,6 @@ Name: environment-modules Version: 3.2.9c -Release: 3%{?dist} +Release: 4%{?dist} Summary: Provides dynamic modification of a user's environment Group: System Environment/Base @@ -10,6 +10,9 @@ Source0: http://downloads.sourceforge.net/modules/modules-%{version}.tar. Source1: modules.sh Source2: createmodule.sh Patch0: environment-modules-3.2.7-bindir.patch +# Patch to fix segfault in module unload due to Tcl RegExp handling +# https://bugzilla.redhat.com/show_bug.cgi?id=834580 +Patch1: environment-modules-regex.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: tcl-devel, tclx-devel, libX11-devel @@ -46,6 +49,7 @@ have access to the module alias. %prep %setup -q -n modules-3.2.9 %patch0 -p1 -b .bindir +%patch1 -p1 -b .regex %build @@ -93,6 +97,9 @@ make test %changelog +* Fri Aug 24 2012 Orion Poplawski - 3.2.9c-4 +- Add patch to fix segfault from Tcl RexExp handling (bug 834580) + * Wed Jul 18 2012 Fedora Release Engineering - 3.2.9c-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild