Menu

#87 tkdiff crashes on startup with a 4.3 .tkdiff

V5.5
closed-fixed
None
3
2022-08-19
2022-08-18
Duncan Roe
No

This is what happens:

Error in startup script: can't unset "4.3": no such variable
    while executing
"unset $prefsFileVersion"
    invoked from within
"if {[file exists $g(rcfile)]} {
    if {[catch {source $g(rcfile)} error]} {
        set startupError [join [list "There was an error in processing yo..."
    (file "/usr/bin/tkdiff" line 894)
1 Attachments

Discussion

  • Duncan Roe

    Duncan Roe - 2022-08-18

    The patch actually fixes 2 errors:

    --- tkdiff      2022/08/15 03:29:49     1.1
    +++ tkdiff      2022/08/17 10:36:46
    @@ -930,7 +930,7 @@
     #           (maintaining the evolutionary chain)
         if {[info exists "prefsFileVersion"]} {
             set opts(prefsVrsn)   $prefsFileVersion
    -        unset $prefsFileVersion
    +        unset prefsFileVersion
         }
    
     # 3rd   (PERMANENT location of the 'File Version')
    @@ -953,7 +953,9 @@
                 #    "ignoreRegexLn" and "ignoreEmptyLn" became bit-Based booleans.
                 # 4. "diffcmd" is now DERIVED (as opposed to user-SET) thus will be
                 # rewritten internally (later), requiring no further action.
    -            lappend opts(egnSrchCmd) {*}$opts(fRecurs)
    +            if {[info exists opts(fRecurs)]} {
    +                lappend opts(egnSrchCmd) {*}$opts(fRecurs)
    +            }
                 if {$opts(ignoreEmptyLn)} { set opts(ignoreEmptyLn) 8 }
                 if {$opAfterts(ignoreRegexLn)} { set opts(ignoreRegexLn) 4 }
                 if {$opts(ignoreblanks)}  { set opts(ignSuprs)      2 }
    

    After fixing the unset, lappend would fail because there was no opts(fRecurs).
    I don't know under what circumstances there ever would be an opts(fRecurs) but I left the statement there, guarded by if {[info exists.
    So you can try stuff for yourself, I've attached the RCS file for .tkdiffrc. You'll have to rename the attachment to re-insert the leading dot - I couldn't get the Browse dialogue to show me "hidden" files.
    Revisions 1.1 to 1.3 are 4.3 files

     
  • michael-m

    michael-m - 2022-08-19
    • status: open --> accepted
    • assigned_to: michael-m
    • Priority: 5 --> 3
     
  • michael-m

    michael-m - 2022-08-19

    Good catch!
    Obviously the "unset" should have been to the variable - NOT its interpolated value; that was just plain brain-dead typing!

    Regarding the oversight of 'opts(fRecurs)' your fix is dead-on. I neglected to take into account the introduction of a "once-upon-a-time" Pref variable creation in the evolution of intermediate versions, for which the PRESENT conversion may (or may not) have actually passed thru (which is where it would have been created). Adding the existence check allows EITHER possibility, which is the correct action.

    Because these cause a CRASH to occur (if your prior environment is of a sensitive vintage), I think a point-release is in order. Once again, thanks for not only the problem catch but the recommended fix as well. Be on the lookout for V5.5.1, coming shortly.

     
  • michael-m

    michael-m - 2022-08-19
    • status: accepted --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.