Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-22
17:19 • Ticket [1787911fff] array search of env status still Closed with 3 other cha... artifact: a10ec60565 user: serhiy.storchaka
2026-10-21
10:03 • Closed ticket [1787911fff]. artifact: 8011cb6fc0 user: serhiy.storchaka
09:58 • Closed ticket [2889257fff]: array startsearch and friends do not work on env</... artifact: 5a9a674d5d user: serhiy.storchaka
2009-05-01
08:24 • Ticket [1787911fff] array search of env status still Open with 1 other chang... artifact: 66ef572f38 user: msofer
2007-10-28
00:11 • Ticket [1787911fff]: 4 changes artifact: 5c038de29a user: msofer
2007-09-05
02:09 • Ticket [1787911fff]: 4 changes artifact: 2056f467fa user: msofer
2007-09-04
16:43 • New ticket [1787911fff]. artifact: c8dbda013a user: dgp

array search of env

Closed / Fixed1787911fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 41 days ago
Descriptionplain2007-09-04 16:43:12
Noted on the chat:

% set a [array startsearch env]
s-1-env
% array anymore env $a
couldn't find search "s-1-env"
Referenced by1
  • 5a9a674d5dClosed ticket [2889257fff]: [array startsearch] and friends do not work on env plus 4 other changes ticket2026-10-21 09:58:25
msoferplain2007-09-05 02:09:48
Logged In: YES 
user_id=148712
Originator: NO

Same result on 8.34, 8.4.14, 8.5a6 (pre varReform), HEAD.
msoferplain2007-10-28 00:11:49
Logged In: YES 
user_id=148712
Originator: NO

The problem is with the way EnvTraceProc works: for array traces it calls TclSetupEnv, which in turns first deletes the env variable and then recreates it. The deletion cancels all searches.

What this means is that the env array cannot be searched at all. This should be either fixed or documented. 

Wary to muck with this stuff, especially since:
(a) the bug is prehistoric, raised few complaints, no tests available
(b) the bug combines two touchy issues (array searches and env), a fix may introduce subtle new bugs

Requesting comments.
msofer Ticket [1787911fff]: 1 change [History diff]2009-05-01 08:24:18
serhiy.storchakawiki2026-10-21 10:03:37

Fixed in 8.6.2 by [afaff33553] (ticket [219226]): env is no longer unset and recreated on array access, so [array startsearch env], anymore and nextelement work.

serhiy.storchaka Ticket [1787911fff]: 3 changes [History diff]2026-10-22 17:19:30
Log in (anonymous is fine) to add a comment.