Skip to content
Tcl Source Code History Of Ticket 154f0982f2f701a1
Login

History Of Ticket 154f0982f2f701a1

Artifacts Associated With Ticket 154f0982f2f701a1

  1. Ticket change [be3d1cdb92] (rid 141936) by dgp on 2015-05-27 12:52:32:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
          Tcl_Object 
          Tcl_NewObjectInstance(interp, class, name, nsName, objc, objv, skip) 
      
      ...
      
      const char *nsName (in)
          The name of the namespace to create for the object's private use, or NULL if a new unused name is to be automatically selected. 
      
      ...
      
      If the nsName value passed in names an existing namespace, T_NOI() does
      not raise an error, nor does it use the named namespace.  It silently
      falls back to behaving as if nsName==NULL was passed in, and generates
      a new namespace.
      
      This should at least be made more clear in the documentation.
      
      Itcl 4 suffers from this.  See http://core.tcl.tk/itcl/tktview?name=f3a2e7407c
      
    5. foundin initialized to: "trunk"
    6. is_private initialized to: "0"
    7. login: "dgp"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "35. TclOO Package"
    14. title initialized to:
      Tcl_NewObjectInstance() silently ignores existing namespace argument
      
    15. type initialized to: "Bug"
  2. Ticket change [60e25da793] (rid 141937) by dgp on 2015-05-27 12:52:49:

    1. assignee changed to: "dkf"
    2. login: "dgp"
    3. mimetype: "text/plain"
  3. Ticket change [58f2a66b8a] (rid 141951) by mistachkin on 2015-05-28 01:35:27:

    1. icomment:
      It appears that the TclNRNewObjectInstance function duplicates some (or all?)
      of the code involved as well.
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
  4. Ticket change [7e6913c96e] (rid 143460) by jan.nijtmans on 2015-10-07 13:48:04:

    1. icomment: "ping ... status?"
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  5. Ticket change [8fbf401a9a] (rid 143475) by dgp on 2015-10-08 12:58:52:

    1. icomment:
      
      My (mild) preference is to leave this unresolved until I
      can get back to and complete my experiments in Itcl 4 dealing
      with the implications of this interface restriction.
      
      dkf is welcome to comment on any necessities behind it.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  6. Ticket change [f2b43e5d98] (rid 143565) by dkf on 2015-10-19 14:09:13:

    1. icomment:
      Documented that the namespace should not already exist.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  7. Ticket change [2e75cd72db] (rid 226501) by dkf on 2024-05-23 11:38:58:

    1. icomment:
      To reiterate, TclOO ***must*** create the namespace; it's going to attach its primary object metadata to the namespace (via the NS's `clientData`) and the only time it is safe to do that is at creation. An existing namespace probably ought to be an error, at least when using the Tcl script level API. C API users can be more careful.
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  8. Ticket change [78e42e4f20] (rid 226511) by dkf on 2024-05-23 12:47:48:

    1. icomment:
      There are two ways we could vary things from how they are now:
      
      1. Make `AllocObject()` return `NULL` in this case and not reset the result (so the underlying error in `Tcl_CreateNamespace()` can shine through, or we can generate our own error; we've definitely got a valid `interp` at that point. `TclNewObjectInstanceCommon()` can then pass the failure out (that function already has failure semantics in place so we don't need to check its callers).
      2. Make `AllocObject()` call `Tcl_Panic()` if it can't allocate the named namespace. I'm not keen on this option as I suspect it would make the panic definitely reachable from Tcl scripts.
      
      There are other users of `AllocObject()` but they all pass `NULL` for `nsNamePtr`; they won't go down this code path. This is a *total* audit of callers of `AllocObject()` as that was, is, and always will be internal to `tclOO.c`; the other callers are in the function that sets up the base of the object hierarchy.
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  9. Ticket change [ff07493cdd] (rid 226520) by dkf on 2024-05-23 13:27:27:

    1. icomment:
      I don't like the panic option at all. The error option is in the [bug-154f0982f2](https://core.tcl-lang.org/tcl/timeline?r=bug-154f0982f2); it's technically a public API change, but one that I think nobody will notice and care about. A review of the C documentation made me think no alteration was required there.
      
      If you want this change, merge the branch and close the issue.
      
    2. login: "dkf"
    3. mimetype: "text/x-markdown"
  10. Ticket change [3aa60f3084] (rid 226521) by dkf on 2024-05-23 13:27:48:

    1. assignee changed to: "dgp"
    2. login: "dkf"
    3. mimetype: "text/plain"
  11. Ticket change [0a1d809c4c] (rid 226525) by oehhar on 2024-05-23 13:46:34:

    1. icomment:
      Donal,
      thank you for the great fix.
      
      The decision to merge or not should be done.
      
      Please post your opinion here.
      
      I will merge in one week (31th of May) if no strong objections.
      I will also write a message on the core list.
      
      Thank you and take care,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  12. Ticket change [f27e02c7aa] (rid 229814) by dkf on 2024-08-06 11:16:14:

    1. closedate changed to: "2460528.96961799"
    2. closer changed to: "dkf"
    3. icomment: "Merged."
    4. login: "dkf"
    5. mimetype: "text/x-markdown"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
  13. Ticket change [d6c6b7d281] (rid 233044) by dgp on 2024-09-03 21:10:06:

    1. closedate changed to: "2460557.38201498"
    2. closer changed to: "dgp"
    3. icomment:
      
      I am sorry that my assessment is not timely, but this change
      broke the trunk of Itcl. It creates multiple test suite
      failures.
      
      Since this change was put into both the 8.6 and 9.0 branches,
      the issue is blocking releases until it is decided which must
      change and how.
      
      None of our auto-testing systems cover Itcl?  Can that be right?
      
    4. login: "dgp"
    5. mimetype: "text/plain"
  14. Ticket change [f9a469af54] (rid 233047) by dgp on 2024-09-04 18:46:33:

    1. closedate changed to: "2460558.28232981"
    2. icomment:
      
      To be more concrete, here are two of the simple test failures
      in the Itcl test suite:
      
      ==== fossil-9.0 d0126511d9 FAILED
      ==== Contents of test case:
      
          itcl::class N {}
      
      ---- Test generated error; Return code was: 1
      ---- Return code should have been one of: 0 2
      ---- errorInfo: can't create namespace "N": already existsITCL: cannot create Tcl_NewObjectInstance for class "::N"
          while executing
      "itcl::class N {}"
          ("uplevel" body line 2)
          invoked from within
      "uplevel 1 $script"
      ---- errorCode: TCL OPERATION NAMESPACE CREATEEXISTING
      ---- Test cleanup failed:
      class "N" not found in context "::"
      ---- errorInfo(cleanup): class "N" not found in context "::"
          while executing
      "itcl::delete class N::B N"
          ("uplevel" body line 2)
          invoked from within
      "uplevel 1 $cleanup"
      ---- errorCode(cleanup): NONE
      ==== fossil-9.0 FAILED
      
      
      
      ==== fossil-9.1 d0126511d9 FAILED
      ==== Contents of test case:
      
          itcl::class N {}
      
      ---- Test setup failed:
      class "N::B" already exists
      ---- errorInfo(setup): class "N::B" already exists
          while executing
      "itcl::class N::B {}"
          ("uplevel" body line 2)
          invoked from within
      "uplevel 1 $setup"
      ---- errorCode(setup): NONE
      ---- Test cleanup failed:
      class "N" not found in context "::"
      ---- errorInfo(cleanup): class "N" not found in context "::"
          while executing
      "itcl::delete class N"
          ("uplevel" body line 2)
          invoked from within
      "uplevel 1 $cleanup"
      ---- errorCode(cleanup): NONE
      ==== fossil-9.1 FAILED
      
      These tests were created when the issue in this ticket was
      first addressed back in 2015 to detect if it would ever come back.
      Should not really be a surprise this change makes them fail.
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  15. Ticket change [20a325ea9d] (rid 233048) by dgp on 2024-09-04 18:47:46:

    1. closedate changed to: "2460558.28317715"
    2. icomment:
      
      "it's technically a public API change, but one that I think nobody will notice and care about."
      
      I don't see how that can be said when Itcl's expectations were what
      raised the question in the first place, and testing Itcl immediately
      shows the breakage.
      
      The issues here are difficult and beyond what I can solve quickly.
      But shouldn't we at least keep this breaking change out of 8.6.15?
      As is, the release candidate of Tcl 8.6.15 breaks the released Itcl 4.2.5
      as well as the latest sources poised to become Itcl 4.2.6.
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  16. Ticket change [58c6690bc0] (rid 233049) by dgp on 2024-09-04 18:52:41:

    1. closedate changed to: "2460558.28659502"
    2. icomment:
      I do not possess a strong knowledge of what other codebases
      make use of the TclOO C API and might also be upset by this.
      How can we find out?
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  17. Ticket change [43c953ed92] (rid 233050) by dgp on 2024-09-04 20:06:55:

    1. closedate changed to: "2460558.3381373"
    2. icomment:
      
      While I am not able to solve these issues quickly, I was able
      to hack in a workaround in Itcl.  Review and comment would
      be helpful.
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  18. Ticket change [c56d88474a] (rid 233281) by oehhar on 2024-09-09 08:57:01:

    1. closedate changed to: "2460562.8729351"
    2. closer changed to: "oehhar"
    3. icomment:
      The workaround is here: [https://core.tcl-lang.org/itcl/info/46272cca4dc657b3]
      
      The TTT sees this as solved. Reverting on 8.6 would also be possible but this patch is also ok.
      
      Thanks for all,
      Harald
      
    4. login: "oehhar"
    5. mimetype: "text/x-fossil-wiki"
    6. username: "oehhar"