Skip to content
Tcl Source Code History Of Ticket 1366195fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1366195fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1366195fffffffffffffffffffffffffffffffff

  1. Ticket change [83dec42e62] (rid 117446) by afredd on 2005-11-25 10:40:37:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      A nice easy one...
      
      On windows, if you redefine TCL_DSTRING_STATIC_SIZE to 
      be small (4!) then it crashes in 
      TclpGetEncodingNameFromEnvironment because it assumes 
      the DString buffer is large enough. I've not seen 
      anything stating a minimum size for this so assume 
      this is 'allowed'.
      
      Something like:
      
      TclpGetEncodingNameFromEnvironment(bufPtr)
          Tcl_DString *bufPtr;
      {
          Tcl_DStringInit(bufPtr);
      +#define MIN_DSTRING_LEN   (3 + TCL_INTEGER_SPACE)
      +#if TCL_DSTRING_STATIC_SIZE < MIN_DSTRING_LEN
      +    Tcl_DStringSetLength(bufPtr, MIN_DSTRING_LEN);
      +#endif
          wsprintfA(Tcl_DStringValue(bufPtr), "cp%d", GetACP
      ());
          return Tcl_DStringValue(bufPtr);
      }
      
      seems like the simplest fix, as not many people are 
      going to hit this problem.
      
      After hittng this problem i had a quick look for any 
      other potentially similar problems and saw this in 
      tclWinDde.c:
      
      #line 367
      Tcl_DStringSetLength(&dString,
       offset + TCL_INTEGER_SPACE);
      
      I think this should be:
      
      Tcl_DStringSetLength(&dString,
       Tcl_DStringLength(&dString) + offset + 
      TCL_INTEGER_SPACE);
      
      
      ...but again it's only a problem if 
      TCL_DSTRING_STATIC_SIZE is small.
      
    4. foundin initialized to: "obsolete: 8.5a3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "afredd"
    9. subsystem initialized to: "None"
    10. title initialized to: "win: if TCL_DSTRING_STATIC_SIZE is small => crash"
    11. type initialized to: "RFE"
  2. Ticket change [35820cd20c] (rid 106950) by dkf on 2005-11-25 23:06:42:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      I'm not quite sure what to do about this given that the
      submitter is changing a fundamental constant...
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. subsystem changed to: "10. Objects"
    6. username: "dkf"
  3. Ticket change [9743e8dc0b] (rid 106475) by dgp on 2005-11-27 09:13:31:

    1. assignee changed to: "dkf"
    2. foundin changed to: "None"
    3. icomment:
      
      
      data_type - 360894
      
      Logged In: YES 
      user_id=80530
      
      
      Submitter is correct that
      since we have a symbolic
      value, it would be better to
      use it than to assume we know
      what its value is.  Doing so
      would allow source hackers to
      try different values with less
      worry about breaking stuff.
      
      That said, supporting source
      hackers is fairly low on our
      To Do list; they can take
      care of themselves for the
      most part.
      
      I could have left this as a
      low priority bug report, but
      I'm switching it to a feature
      request.  There's nothing really
      buggy here, since tweaking these
      values isn't something we really
      support.  
      
      The change is something that
      ought to be done, but unless
      a contributed patch comes in,
      the usual maintainers probably
      will work on more pressing matters.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. priority changed to: "2"
    7. subsystem changed to: "10. Objects"
    8. title changed to:
      Use TCL_DSTRING_STATIC_SIZE rather than assume size
      
    9. username: "dgp"
  4. Ticket change [fb44cabf26] (rid 92027) by afredd on 2006-03-31 20:28:12:

    1. icomment:
      Logged In: YES 
      user_id=1386588
      
      Here's the requested patch.
      
      
    2. login: "afredd"
    3. mimetype: "text/plain"
    4. username: "afredd"
  5. Add attachment "tclWinInit.c-1.69-patch" [63b7d8c3f3] (rid 92629) by afredd on 2006-03-31 20:28:12.

  6. Ticket change [e0c319ce32] (rid 87335) by afredd on 2006-03-31 20:28:19:

    1. icomment:
      
      
      File Added - 172901: tclWinInit.c-1.69-patch
      
      
      
    2. login: "afredd"
    3. mimetype: "text/plain"
    4. username: "afredd"
  7. Ticket change [7e24cdd620] (rid 97355) by dgp on 2006-03-31 23:35:31:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      thanks for the patch.
      
      Looking it over, I see it
      would catch any problems
      with a source hacker trying
      to make TCL_DSTRING_STATIC_SIZE
      smaller than Tcl assumes it is.
      
      The patch I'd rather have is
      changes to Tcl so it stops making
      assumptions about how large
      the value is.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [576b967621] (rid 94486) by afredd on 2006-04-04 00:20:15:

    1. icomment:
      Logged In: YES 
      user_id=1386588
      
      dgp:
      >The patch I'd rather have is changes to Tcl so it
      >stops making assumptions about how large the value is.
      
      The patch fixes the only case i can find of the core
      assuming a certain size for TCL_DSTRING_STATIC_SIZE.
      
      Or do you mean that, for example, a core compiled with
      TDSS==300, should support an extension compiled with
      TDSS==100? ie. DStringInit would need to pass in its
      static buffer buffer size which would probably be needed
      to be stored in the DString struct.
      Sounds like it would break a lot of binary interfaces...
      and not for a lot of gain. (So probably this isn't what
      you meant ;-)
      
      
      
    2. login: "afredd"
    3. mimetype: "text/plain"
    4. username: "afredd"
  9. Ticket change [109a8b0ccf] (rid 94997) by dgp on 2006-04-04 00:55:46:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      No, all users of
      TCL_DSTRING_STATIC_SIZE
      ought to use the value
      given to them in tcl.h.
      
      Because we specify a
      value publicly, we would
      have to think carefully
      before ever changing it, in
      case some extensions use of
      the value in an old header
      conflcts with the new value
      we would want in a new header.
      
      So, making any change to
      this value makes sense only
      in very narrow circumstances,
      like someone customizing Tcl
      for their own specialized needs
      (low-memory environment?) and
      maintaining enough control to
      not run into the "old extension"
      problem.
      
      The change that would help them
      a bit would be to patch Tcl's
      source code so that it did not
      assume a value of 
      TCL_DSTRING_STATIC_SIZE, but
      just used whatever value the
      header provided.
      
      The patch submitted did the
      opposite, setting a limit
      on what value of 
      TCL_DSTRING_STATIC_SIZE can
      get set.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [d70c6ce1aa] (rid 123910) by afredd on 2006-04-04 15:50:41:

    1. icomment:
      Logged In: YES 
      user_id=1386588
      
      >The change that would help them a bit would be
      >to patch Tcl's source code so that it did not
      >assume a value of TCL_DSTRING_STATIC_SIZE, but
      >just used whatever value the header provided.
      >
      
      ie. replace TDSS with literal "200"'s in the core?
      
      >The patch submitted did the opposite, setting a
      >limit on what value of TCL_DSTRING_STATIC_SIZE
      >can get set.
      
      You mean an extension comiled with TDSS==4 using
      Tcl_GetEncodingNameFromEnvironment linked to a core
      with a regular TDSS==200 wouldn't have it DString
      lengthened, and would still crash.
      Good point - i hadn't thought of that.
      The fix would be to remove the #if-ery, and just always:
      
      Tcl_DStringSetLength(bufPtr,(2*(3+TCL_INTEGER_SPACE)));
      
      My patch was only intended to allow TDSS to be set low and
      not cause a stack corruption. Allowing for varying
      values of TDSS between extensions and the core is a whole
      different ball game. My opinion is that it is merely
      a documentation issue - caveat programmor.
      
      
      
      
    2. login: "afredd"
    3. mimetype: "text/plain"
    4. username: "afredd"
  11. Ticket change [80f74f5331] (rid 116956) by dgp on 2006-04-05 00:46:46:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      looking again at the original
      report, the code in
      tclWinDde.c looks fine to me,
      and looks like the right
      way to fix the problem with
      TclpGetEncodingNameFromEnvironment().
      Patch coming soon.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [b5f537ca14] (rid 125340) by dgp on 2006-04-05 02:05:44:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      waiting for cvs...
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. username: "dgp"
  13. Add attachment "1366195.patch" [e4af162dad] (rid 87998) by dgp on 2006-04-05 22:57:25.

  14. Ticket change [82e1cb507f] (rid 117303) by dgp on 2006-04-05 22:57:25:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      here's a patch that corrects
      these problems and updates
      some overlooked version number
      bumps as well.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  15. Ticket change [06da09089d] (rid 89283) by dgp on 2006-04-05 22:57:26:

    1. icomment:
      
      
      File Added - 173519: 1366195.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  16. Ticket change [6422335cbe] (rid 92709) by dgp on 2006-04-05 23:53:30:

    1. closedate changed to: "2006-04-05T16:53:30"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      committed
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Accepted"
    7. status changed to: "Closed"
    8. username: "dgp"