Skip to content
Tcl Source Code History Of Ticket 219196
Login

History Of Ticket 219196

Artifacts Associated With Ticket 219196

  1. Ticket change [4d8d0ef312] (rid 127072) by nobody on 2000-10-26 05:03:25:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 2715 Bug
      Version: 8.2
      SubmitDate: '1999-09-10'
      LastModified: '2000-04-03'
      Severity: SER
      Status: Assigned
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Digital Unix
      OSVersion: 4.0f
      Machine: Other
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name: Wolfgang S. Kechel
      
      ReproducibleScript:
      Many warnings and inconsistencies when compiling tcl8.2 with gcc-2.95
          under Compaq True Unix 4.0f (no threads).
          The problems are all related to 64/32 bit problems when allocating
          memory.
          All allocation problems should use long int for the size parameter.
          Additionally, stdio.h should be included in some different lines in some
          headers
          to make gcc-2.95 happy with varargs. Here is a summary of changes:
          
          generic/tclInt.h: move <tt>include <stdio.h></tt> behind the include
          command for tcl.h (some 5 lines down).
          
          generic/tcl.h: move <tt>include <stdio.h></tt> behind the include
          command for stdarg.h/varargs.h to avoid compilation warnings on some
          platforms
          (namely Compaq True Unix 4.0f with gcc-2.95).
          
          generic/tclCkalloc.c and generic/tclDecls.h: Change the
          prototype/signature for Tcl_Alloc and Tcl_Realloc to use <tt>unsigned
          long</tt> instead of <tt>unsigned int</tt>.
          
          generic/tclalloc.c and generic/tclIntDecls.h: Change the
          prototype/signature for TclpAlloc and TclpRealloc to use <tt>unsigned
          long</tt> instead of <tt>unsigned int</tt>.
          
          generic/tclAlloc.c, generic/tclInt.h: Change the if that checks aginat a
          returned NULL pointer to check against a malloced size of 0 as well and
          signal an error only when a NULL pointer is returned for a block of
          memory that is of non-zero size:<br> <tt>if (result == NULL &&
          size)</tt><br>This is around line 800 in the file.
      
      DesiredBehavior:
      Should compile with gcc-2.95 and -Wall -Wconversion without 
          warnings.
      
      Patch:
      diff tclInt.h /dv10/wke/g40/tcl8.2.0/generic
      30,31d29
      < #include <stdio.h>
      < 
      35a34,35
      > #include <stdio.h>
      > 
      1697c1697
      < EXTERN char *         TclpAlloc _ANSI_ARGS_((unsigned int size));
      ---
      > EXTERN char *         TclpAlloc _ANSI_ARGS_((unsigned long size));
      1742c1742
      <                           unsigned int size));
      ---
      >                           unsigned long size));
      118% diff tcl.h /dv10/wke/g40/tcl8.2.0/generic
      177,180d176
      < #ifndef BUFSIZ
      < #include <stdio.h>
      < #endif
      < 
      208a205,208
      > #endif
      > 
      > #ifndef BUFSIZ
      > #include <stdio.h>
      119% diff tclCkalloc.c /dv10/wke/g40/tcl8.2.0/generic
      566c566,567
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      >     unsigned long size; /* changed by wke */
      581c582,583
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      > unsigned long size; /* changed by wke */
      797c799,800
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      >     unsigned long size; /* changed by wke */
      802c805
      <         if (result == NULL) 
      ---
      >         if (result == NULL && size) 
      839c842,843
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      >     unsigned long size; /* changed by wke */
      120% diff tclAlloc.c /dv10/wke/g40/tcl8.2.0/generic
      246c246
      <     unsigned int nbytes;      /* Number of bytes to allocate. */
      ---
      >     unsigned long nbytes;     /* Number of bytes to allocate. */
      492c492
      <     unsigned int nbytes;      /* New size of memory. */
      ---
      >     unsigned long nbytes;     /* New size of memory. */
      664c664
      <     unsigned int nbytes;      /* Number of bytes to allocate. */
      ---
      >     unsigned long nbytes;     /* Number of bytes to allocate. */
      712c712
      <     unsigned int nbytes;      /* New size of memory. */
      ---
      >     unsigned long nbytes;     /* New size of memory. */
      121%
      
      PatchFiles:
      tclInt.h,tcl.h,tclCkalloc.c,tclAlloc.c
      
      
      
      The problem with alloc'ing 0 bytes was fixed in 8.2.1.  The other
      changes can't be made as provided, as they only apply to a small
      subset of platforms.  We may need to parameterize this. 
      -- 10/19/1999 hobbs
      
      This should really be using size_t's.  This may be a problem for
      non-ansi compilers if we change the headers in this way. 
      -- 04/03/2000 hobbs
      
    4. foundin initialized to: "obsolete: 8.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "75. Tutorial"
    10. title initialized to:
      Compilation problems of tcl8.2 under Compaq True Unix 4.0f w
      
    11. type initialized to: "Bug"
  2. Ticket change [9c26ae8d8a] (rid 111235) by dgp on 2001-04-05 06:52:46:

    1. subsystem changed to: "53. Configuration and Build Tools"
  3. Ticket change [363f0e5a66] (rid 107080) by andreas_kupries on 2001-09-08 06:28:52:

    1. assignee changed to: "dkf"
  4. Ticket change [ca2ab1a19d] (rid 122418) by dkf on 2001-12-14 18:22:41:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Not the time to sort this out properly, but SunOS4.1.4
      system headers (*definitely* not ANSI, not with those ioctl
      definitions!) define both size_t and caddr_t if you include
      sys/types.h.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [785463f57b] (rid 89943) by dkf on 2001-12-18 22:34:28:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Configure includes a helpful macro, AC_TYPE_SIZE_T, that
      should solve this.  Only problem then is to go through all
      the places that should use it; experience suggests that it
      is best to limit this to just the primary memory allocation
      macros to prevent massive cross-contamination trouble...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [18bce3ea2f] (rid 122711) by dkf on 2002-04-25 19:18:06:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      See also Bug #443938
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Ticket change [4ceedb1f87] (rid 126978) by dkf on 2002-07-31 17:29:35:

    1. priority changed to: "7 High"
  8. Ticket change [7cd9208296] (rid 97148) by dkf on 2003-02-10 20:47:49:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Some (all?) of these problems should be addressed as part 
      of TIP#115
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. resolution changed to: "Later"
    5. username: "dkf"
  9. Ticket change [d19cce9984] (rid 113386) by dkf on 2004-06-16 17:49:26:

    1. title changed to: "size_t != unsigned int"
  10. Ticket change [ce0293b067] (rid 95984) by dgp on 2009-01-09 21:55:48:

    1. icomment:
      
      Issue is cropping up again in
      Tcl Bug 2494093.
      
      Since we can't fix the API, seems
      there needs to be an audit of
      all the memory allocation callers
      to check whether they permit
      too large requests to be attempted
      that get silently overflowed as
      part of type casting.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  11. Ticket change [4ed41ebdc6] (rid 125709) by dkf on 2009-03-24 23:21:31:

    1. icomment:
      I won't take any action on this until 9.0 because it is extremely disruptive to both APIs and ABIs on 64-bit platforms.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  12. Ticket change [f0df76c44b] (rid 109272) by dkf on 2012-11-20 19:18:50:

    1. icomment:
      Fix in progress on novem-64bit-sizes branch; has a *heavy* impact on the C interface. https://core.tcl.tk/tcl/timeline?r=novem-64bit-sizes
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  13. Ticket change [0f96bfcdaa] (rid 133399) by dkf on 2013-08-21 09:59:49:

    1. closer changed to: "nobody"
    2. comment changed to:
      OriginalBugID: 2715 Bug
      Version: 8.2
      SubmitDate: '1999-09-10'
      LastModified: '2000-04-03'
      Severity: SER
      Status: Assigned
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Digital Unix
      OSVersion: 4.0f
      Machine: Other
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name: Wolfgang S. Kechel
      
      ReproducibleScript:
      Many warnings and inconsistencies when compiling tcl8.2 with gcc-2.95
          under Compaq True Unix 4.0f (no threads).
          The problems are all related to 64/32 bit problems when allocating
          memory.
          All allocation problems should use long int for the size parameter.
          Additionally, stdio.h should be included in some different lines in some
          headers
          to make gcc-2.95 happy with varargs. Here is a summary of changes:
          
          generic/tclInt.h: move <tt>include <stdio.h></tt> behind the include
          command for tcl.h (some 5 lines down).
          
          generic/tcl.h: move <tt>include <stdio.h></tt> behind the include
          command for stdarg.h/varargs.h to avoid compilation warnings on some
          platforms
          (namely Compaq True Unix 4.0f with gcc-2.95).
          
          generic/tclCkalloc.c and generic/tclDecls.h: Change the
          prototype/signature for Tcl_Alloc and Tcl_Realloc to use <tt>unsigned
          long</tt> instead of <tt>unsigned int</tt>.
          
          generic/tclalloc.c and generic/tclIntDecls.h: Change the
          prototype/signature for TclpAlloc and TclpRealloc to use <tt>unsigned
          long</tt> instead of <tt>unsigned int</tt>.
          
          generic/tclAlloc.c, generic/tclInt.h: Change the if that checks aginat a
          returned NULL pointer to check against a malloced size of 0 as well and
          signal an error only when a NULL pointer is returned for a block of
          memory that is of non-zero size:<br> <tt>if (result == NULL &&
          size)</tt><br>This is around line 800 in the file.
      
      DesiredBehavior:
      Should compile with gcc-2.95 and -Wall -Wconversion without 
          warnings.
      
      Patch:
      diff tclInt.h /dv10/wke/g40/tcl8.2.0/generic
      30,31d29
      < #include <stdio.h>
      < 
      35a34,35
      > #include <stdio.h>
      > 
      1697c1697
      < EXTERN char *         TclpAlloc _ANSI_ARGS_((unsigned int size));
      ---
      > EXTERN char *         TclpAlloc _ANSI_ARGS_((unsigned long size));
      1742c1742
      <                           unsigned int size));
      ---
      >                           unsigned long size));
      118% diff tcl.h /dv10/wke/g40/tcl8.2.0/generic
      177,180d176
      < #ifndef BUFSIZ
      < #include <stdio.h>
      < #endif
      < 
      208a205,208
      > #endif
      > 
      > #ifndef BUFSIZ
      > #include <stdio.h>
      119% diff tclCkalloc.c /dv10/wke/g40/tcl8.2.0/generic
      566c566,567
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      >     unsigned long size; /* changed by wke */
      581c582,583
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      > unsigned long size; /* changed by wke */
      797c799,800
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      >     unsigned long size; /* changed by wke */
      802c805
      <         if (result == NULL) 
      ---
      >         if (result == NULL && size) 
      839c842,843
      <     unsigned int size;
      ---
      > /*    unsigned int size;*/
      >     unsigned long size; /* changed by wke */
      120% diff tclAlloc.c /dv10/wke/g40/tcl8.2.0/generic
      246c246
      <     unsigned int nbytes;      /* Number of bytes to allocate. */
      ---
      >     unsigned long nbytes;     /* Number of bytes to allocate. */
      492c492
      <     unsigned int nbytes;      /* New size of memory. */
      ---
      >     unsigned long nbytes;     /* New size of memory. */
      664c664
      <     unsigned int nbytes;      /* Number of bytes to allocate. */
      ---
      >     unsigned long nbytes;     /* Number of bytes to allocate. */
      712c712
      <     unsigned int nbytes;      /* New size of memory. */
      ---
      >     unsigned long nbytes;     /* New size of memory. */
      121%
      
      PatchFiles:
      tclInt.h,tcl.h,tclCkalloc.c,tclAlloc.c
      
      
      
      The problem with alloc'ing 0 bytes was fixed in 8.2.1.  The other
      changes can't be made as provided, as they only apply to a small
      subset of platforms.  We may need to parameterize this. 
      -- 10/19/1999 hobbs
      
      This should really be using size_t's.  This may be a problem for
      non-ansi compilers if we change the headers in this way. 
      -- 04/03/2000 hobbs
      
    3. icomment:
      Formally, this isn't part of any particular subsystem; it's a cross-cutting issue.
      
    4. login: "dkf"
    5. mimetype: "text/x-fossil-wiki"
    6. priority changed to: "8"
    7. severity changed to: "Minor"
    8. subsystem changed to: "None"
    9. username: "dkf"
  14. Ticket change [68e527b040] (rid 226672) by dkf on 2024-05-25 12:54:35:

    1. closedate changed to: "2460456.03791112"
    2. closer changed to: "dkf"
    3. icomment:
      Fixed in 9.0, at least to the standard required by this issue.
      
    4. login: "dkf"
    5. mimetype: "text/x-markdown"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"