Skip to content
Tcl Source Code History Of Ticket 8f5e7a2633ca1b92
Login

History Of Ticket 8f5e7a2633ca1b92

Artifacts Associated With Ticket 8f5e7a2633ca1b92

  1. Ticket change [ac0dcde24c] (rid 248132) by jan.nijtmans on 2025-11-13 10:27:13:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      This is what's happening in Tk 9.1 right now.
      
      I suspect [a165eede1d22d847|this] commit is the coolpit.
      
      <pre>
      safe.test
      
      
      ==== safe-1.2 Safe Tk loading into an interpreter FAILED
      ==== Contents of test case:
      
          safe::interpCreate a
          safe::loadTk a
          lsort [interp hidden a]
      
      ---- Result was:
      bell cd clipboard clock encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source tcl:clock:add tcl:clock:format tcl:clock:scan tcl:encoding:dirs tcl:encoding:system tcl:file:atime tcl:file:attributes tcl:file:copy tcl:file:delete tcl:file:dirname tcl:file:executable tcl:file:exists tcl:file:extension tcl:file:home tcl:file:isdirectory tcl:file:isfile tcl:file:link tcl:file:lstat tcl:file:mkdir tcl:file:mtime tcl:file:nativename tcl:file:normalize tcl:file:owned tcl:file:readable tcl:file:readlink tcl:file:rename tcl:file:rootname tcl:file:size tcl:file:stat tcl:file:tail tcl:file:tempdir tcl:file:tempfile tcl:file:tildeexpand tcl:file:type tcl:file:volumes tcl:file:writable tcl:info:cmdtype tcl:info:nameofexecutable tcl:process:autopurge tcl:process:list tcl:process:purge tcl:process:status tcl:unsupported:disassemble tcl:unsupported:getbytecode tcl:unsupported:loadIcu tcl:unsupported:representation tcl:zipfs:canonical tcl:zipfs:exists tcl:zipfs:info tcl:zipfs:list tcl:zipfs:lmkimg tcl:zipfs:lmkzip tcl:zipfs:mkimg tcl:zipfs:mkkey tcl:zipfs:mkzip tcl:zipfs:mount tcl:zipfs:mountdata tcl:zipfs:root tcl:zipfs:unmount tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel unload wm zipfs
      ---- Result should have been (exact matching):
      bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source tcl:encoding:dirs tcl:encoding:system tcl:file:atime tcl:file:attributes tcl:file:copy tcl:file:delete tcl:file:dirname tcl:file:executable tcl:file:exists tcl:file:extension tcl:file:home tcl:file:isdirectory tcl:file:isfile tcl:file:link tcl:file:lstat tcl:file:mkdir tcl:file:mtime tcl:file:nativename tcl:file:normalize tcl:file:owned tcl:file:readable tcl:file:readlink tcl:file:rename tcl:file:rootname tcl:file:size tcl:file:stat tcl:file:tail tcl:file:tempdir tcl:file:tempfile tcl:file:tildeexpand tcl:file:type tcl:file:volumes tcl:file:writable tcl:info:cmdtype tcl:info:nameofexecutable tcl:process:autopurge tcl:process:list tcl:process:purge tcl:process:status tcl:zipfs:canonical tcl:zipfs:exists tcl:zipfs:info tcl:zipfs:list tcl:zipfs:lmkimg tcl:zipfs:lmkzip tcl:zipfs:mkimg tcl:zipfs:mkkey tcl:zipfs:mkzip tcl:zipfs:mount tcl:zipfs:mountdata tcl:zipfs:root tcl:zipfs:unmount tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel unload wm zipfs
      ==== safe-1.2 FAILED
      
      
      </pre>
      
    5. foundin initialized to: "9.1"
    6. is_private initialized to: "0"
    7. login: "jan.nijtmans"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0c50e5320704d174412e57b873d8932de15303e0"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "jan.nijtmans"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to: "Tk build for 9.1 failing in safe-1.2 testcase"
    16. type initialized to: "Bug"
  2. Ticket change [8f8226e55d] (rid 248133) by jan.nijtmans on 2025-11-13 10:28:08:

    1. assignee changed to: "dkf"
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  3. Ticket change [7e07d8a73f] (rid 248164) by jan.nijtmans on 2025-11-13 19:34:19:

    1. icomment:
      Let's analyse the difference.
      
      Tcl 9.1 has the following unsafe commands, which Tcl 9.0 hasn't: clock, tcl:clock:add, tcl:clock:format, tcl:clock:scan, tcl:unsupported:disassemble, tcl:unsupported:getbytecode, tcl:unsupported:loadIcu, tcl:unsupported:representation.
      
      I think 'clock' is a mistake in this list. It should be usable in safe interpreters. The tcl:unsupported:* commands are correct, they should be considered unsafe in Tcl 9.0 too (backport??)
      
      So, what about tcl:clock:add, tcl:clock:format, tcl:clock:scan. @sebres, can you give advise?
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  4. Ticket change [f0fa2fef1a] (rid 248237) by dkf on 2025-11-14 13:07:23:

    1. icomment:
      The `clock` implementation has unsafe pieces, but the API is safe. The overall command is only unsafe for legacy reasons, and we can probably just discharge those ourselves.
      
      NB: there's a comment by the `clock` definition that says:
      ```
          // TODO: Sort out why setup of [clock] is so weird
      ```
      
      I think this bug might be the time to do that!
      
      ----
      
      The `unsupported` commands are generally not assessed for safety, but it wouldn't surprise me at all if they were problems. To whit, `disassemble` reports raw addresses, it and `getbytecode` allow probing of command types, and `representation` reports raw addresses.
      
      
      `loadIcu` probably should never be used in a safe interpreter at all; it's purely an implementation feature. It's table declaration entry bears this comment:
      ```
       // TODO: Is this supposed to be callable from safe interps?
      ```
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  5. Ticket change [8314a45510] (rid 248238) by dkf on 2025-11-14 13:16:17:

    1. icomment:
      Also, when it comes to ensembles they're all _technically_ safe in themselves (their subcommands may not be). `TclHideUnsafeCommands()` in respect of this bears this comment in respect of ensembles not marked as safe:
      
      ```
          /*
           * Hide a main command (for compatibility).
           */
      ```
      
      The problem is working out what to do about existing code that uses a safe interpreter.
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  6. Ticket change [8ab5b6a0ec] (rid 248239) by dkf on 2025-11-14 13:18:36:

    1. icomment:
      The _most_ irritating part of this is that I missed this because I don't habitually test Tk (as it's annoying on this machine).
      
      Sorry for the inconvenience.
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  7. Ticket change [39df2731a9] (rid 248241) by dkf on 2025-11-14 14:04:48:

    1. login: "dkf"
    2. mimetype: "text/plain"
    3. priority changed to: "9 Immediate"
    4. severity changed to: "Severe"
    5. subsystem changed to: "06. Time Measurement"
  8. Ticket change [90abf52fc7] (rid 248251) by jan.nijtmans on 2025-11-14 14:28:55:

    1. icomment:
      > Sorry for the inconvenience
      
      No problem. Thanks for looking at it now.
      
      For the "unsupported" commands, easiest is to backport those parts to 9.0, since I agree with your analysis: They shouldn't be in the safe set.
      
      On the "clock"-related commands, maybe @sebres can provide help. He is the "clock" expert.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [f7e72cc8b7] (rid 248259) by dkf on 2025-11-14 14:59:11:

    1. icomment:
      With `clock`, we're really talking about a change of policy: it's regarded as being a _safe_ command that happens to use unsafe features in its implementation, and only of _some_ of its subcommands (they need a context that can pull message catalogs and timezone info, and they already check that the locale and TZ names are valid). That means it's best marked as safe and aliases installed for its technically unsafe subcommands, rather than aliasing the lot.
      
      I've got a branch that does that (and fixes up the tests that fail because of it).
      
      We need to do some work about sorting out Tk though. The issue there looks like the test is fragile in the face of changes to the list of hidden subcommands and/or aliases managed by Tcl, things that shouldn't really matter to Safe Tk. Perhaps the test needs to be rewritten to filter out the baseline stuff from Tcl instead?
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  10. Ticket change [1b660d27fd] (rid 248262) by dkf on 2025-11-14 15:41:36:

    1. icomment:
      The _original_ strangeness was that `clock` was a lazily-defined ensemble. Which was all very well to start with, but became really untenable when sebres added compilation of the timer readers (otherwise a good idea). That in turn left an overhang of weird hacks that were irrelevant; my reorg of the initialisation removed some of the sticking plasters but I missed some.
      
      On the Tk side, we should adjust the tests to not care what Tcl has defined in its safe base; Tk shouldn't be testing Tcl.
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  11. Ticket change [5019d19700] (rid 248263) by dkf on 2025-11-14 15:53:37:

    1. icomment:
      Try [tk:29ca32e223954a3b|29ca32] for what I think is the fix on the Tk side.
      
    2. login: "dkf"
    3. mimetype: "text/x-fossil-wiki"
  12. Ticket change [d3cf4f86d8] (rid 248272) by jan.nijtmans on 2025-11-14 17:32:53:

    1. icomment:
      > Try 29ca32 for what I think is the fix on the Tk side.
      
      Looks good to me. Thanks! +1 for core-9-0-branch and trunk (and 8.6, if you like, but not really necessary)
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  13. Ticket change [27616f7ee6] (rid 248870) by jan.nijtmans on 2025-11-27 21:07:38:

    1. icomment:
      @dkf, you added the comment "Approach right, details not, source branch not right either" to the commit. What do you need to make progress?
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  14. Ticket change [9b2e0ce911] (rid 251971) by jan.nijtmans on 2026-03-09 07:40:39:

    1. icomment: "ping"
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  15. Ticket change [2c279ec646] (rid 252008) by jan.nijtmans on 2026-03-11 09:44:31:

    1. icomment:
      @dkf, what's the status of the "bug-8f5e7a2633" branch?
      
      I now re-enabled the testcase in Tk, the problem described in this ticket is gone. Thanks for your prototype doing this (which I finished)!
      
      However, keeping it "Pending", in case you want to work further on improving the "clock" initialization.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"