Overview
| Artifact ID: | e05145214f8980b7293acb7982de5c559d466c8c |
|---|---|
| Ticket: | f3ee78aedbda6d61900893fe7f83cf0478ff1844
Env variables unset in slave appear to be defined but are not accessible by master |
| User & Date: | kevin.bowen on 2014-04-04 19:51:46 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
One of our engineers encountered this issue a while ago on version 8.4.6 and worked around it with the following patch. We are submitting the fix back to the user community. The patch has been updated to reference version 8.6.1. ----- Patch ----- atlgar-vdi0952[kbowen](~/workspace_remote/tcl8.6.1/generic)$ diff -du tclEnv.c.orig tclEnv.c --- tclEnv.c.orig 2013-09-19 15:04:14.000000000 -0400 +++ tclEnv.c 2014-04-04 15:35:00.851155000 -0400 @@ -565,6 +565,7 @@ const char *value = TclGetEnv(name2, &valueString); if (value == NULL) { + Tcl_UnsetVar2(interp, name1, name2, 0); return (char *) "no such variable"; } Tcl_SetVar2(interp, name1, name2, value, 0); ----- Reproduction Script ----- #! /bin/env tclsh set testEnvName USER set slave [interp create] puts "TCL Version = $tcl_version" puts "Defined to start - $testEnvName = $env($testEnvName)" # Execute a slave interp to unsetenv the variable $slave eval unset env($testEnvName) if { [info exists env($testEnvName)] == 1 } { # This will execute even when the environment variable has been unset. # This causes a de-reference error. puts "Still defined? - $testEnvName = $env($testEnvName)" } else { puts "Not defined - $testEnvName" } ----- Reproduction Output ----- atlgar-vdi0952[kbowen](~/workspace_remote)$ ./tcl_problem TCL Version = 8.4 Defined to start - USER = kbowen can't read "env(USER)": no such variable while executing "puts "Still defined? - $testEnvName = $env($testEnvName)"" invoked from within "if { [info exists env($testEnvName)] == 1 } { # This will execute even when the environment variable has been unset. # This causes a de-refere..." (file "../../tcl_problem" line 13) - foundin changed to: "8.6.1"
- is_private changed to: "0"
- login: "kevin.bowen"
- priority changed to: "5 Medium"
- private_contact changed to: "00ad10b7c04c674401b80f9628892d9486e49d6e"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "kevin.bowen"
- subsystem changed to: "08. Environment Variables"
- title changed to:
Env variables unset in slave appear to be defined but are not accessible by master
- type changed to: "Bug"