Tcl Library Source Code

View Ticket
Login
Ticket UUID: d679822510fac5859ab3cf093527cc1ad5b93210
Title: uuid (illegally) accesses an uplevel variable
Type: Bug Version: 1.15
Submitter: anonymous Created on: 2014-06-27 06:03:57
Subsystem: uuid Assigned To: aku
Priority: 7 High Severity: Important
Status: Closed Last Modified: 2014-06-30 18:15:20
Resolution: Fixed Closed By: aku
    Closed on: 2014-06-30 18:15:20
Description:
Repeat with:

#!/usr/bin/tclsh
array set e {any words to demonstrate the problem}
package require uuid
puts stdout "uuid = [::uuid::uuid generate]"
User Comments: aku added on 2014-06-30 18:15:20:
Thank you very much for the report. The final result of the review was that 6 packages were affected by this, including uuid. 14 other packages were not affected. Details in the commit.

Fixed in revision [64c68f3380].
Committed.
Pushed.

uuid      :: Bumped to 1.0.4.
sha1      :: Bumped to 1.1.1.
md4       :: Bumped to 1.0.6.
ripemd128 :: Bumped to 1.0.5.
ripemd160 :: Bumped to 1.0.5.
crc32     :: Bumped to 1.3.2.

aku added on 2014-06-27 06:15:50:
Confirmed. Thank you for the report.

Ah. This particular type of problem has the name

    "creative writing (of a global variable)".

Due to a missing 'variable' declaration for X the core's var resolution is in the global namespace when it finally comes to the creation of the variable X.

Given that we have more Tcllib packages than just "uuid" using the LoadAccelerator pattern to detect and choose among multiple implementations of their functionality this means we may have more instances of this problem lurking. Review of all places in Tcllib with this will be required.