# config

name: css
value:
  body {
      margin: 0 auto;
      min-width: 800px;
      padding: 0px 20px;
      background-color: white;
      font-family: sans-serif;
      font-size:14pt;
      -moz-text-size-adjust: none;
      -webkit-text-size-adjust: none;
      -mx-text-size-adjust: none;
  }

  a {
      color: #4183C4;
      text-decoration: none;
  }
  a:hover {
      color: #4183C4;
      text-decoration: underline;
  }

  hr {
      color: #eee;
  }

  .title {
      color: #4183C4;
      float:left;
      padding-top: 30px;
      padding-bottom: 10px;
  }
  .title h1 {
      display:inline;
  }
  .title h1:after {
      content: " / ";
      color: #777;
      font-weight: normal;
  }

  .content h1 {
      font-size: 1.25em;
  }
  .content h2 {
      font-size: 1.15em;
  }
  .content h3 {
      font-size: 1.05em;
      font-weight: bold;
  }

  .section {
      font-size: 1em;
      font-weight: bold;
      background-color: #f5f5f5;
      border: 1px solid #d8d8d8;
      border-radius: 3px 3px 0 0;
      padding: 9px 10px 10px;
      margin: 10px 0;
  }

  .sectionmenu {
      border: 1px solid #d8d8d8;
      border-radius: 0 0 3px 3px;
      border-top: 0;
      margin-top: -10px;
      margin-bottom: 10px;
      padding: 10px;
  }
  .sectionmenu a {
      display: inline-block;
      margin-right: 1em;
  }

  .status {
      float:right;
      font-size:.7em;
      padding-top:50px;
  }

  .mainmenu {
      font-size:.8em;
      clear:both;
      padding:10px;
      background:#eaeaea linear-gradient(#fafafa, #eaeaea) repeat-x;
      border:1px solid #eaeaea;
      border-radius:5px;
  }

  .mainmenu a {
      padding: 10px 20px;
      text-decoration:none;
      color: #777;
      border-right:1px solid #eaeaea;
  }
  .mainmenu a.active,
  .mainmenu a:hover {
      color: #000;
      border-bottom:2px solid #D26911;
  }

  .submenu {
      font-size: .7em;
      margin-top: 10px;
      padding: 10px;
      border-bottom: 1px solid #ccc;
  }

  .submenu a, .submenu label {
      padding: 10px 11px;
      text-decoration:none;
      color: #777;
  }

  .submenu a:hover, .submenu label:hover {
      padding: 6px 10px;
      border: 1px solid #ccc;
      border-radius: 5px;
      color: #000;
  }

  .content {
      padding-top: 10px;
      font-size:.8em;
      color: #444;
  }

  .udiff, .sbsdiff {
      font-size: .85em !important;
      overflow: auto;
      border: 1px solid #ccc;
      border-radius: 5px;
  }
  .content blockquote {
      padding: 0 15px;
  }

  table.report {
      cursor: auto;
      border-radius: 5px;
      border: 1px solid #ccc;
      margin: 1em 0;
  }
  .report td, .report th {
     border: 0;
     font-size: .8em;
     padding: 10px;
  }
  .report td:first-child {
      border-top-left-radius: 5px;
  }
  .report tbody tr:last-child td:first-child {
      border-bottom-left-radius: 5px;
  }
  .report td:last-child {
      border-top-right-radius: 5px;
  }
  .report tbody tr:last-child {
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;
  }
  .report tbody tr:last-child td:last-child {
      border-bottom-right-radius: 5px;
  }
  .report th {
      cursor: pointer;
  }
  .report thead+tbody tr:hover {
      background-color: #f5f9fc !important;
  }

  td.tktDspLabel {
      width: 70px;
      text-align: right;
      overflow: hidden;
  }
  td.tktDspValue {
      text-align: left;
      vertical-align: top;
      background-color: #f8f8f8;
      border: 1px solid #ccc;
  }
  td.tktDspValue pre {
      white-space: pre-wrap;
  }

  span.timelineDetail {
      font-size: 90%;
  }

  .footer {
      border-top: 1px solid #ccc;
      padding: 10px;
      font-size:.7em;
      margin-top: 10px;
      color: #ccc;
  }
  div.timelineDate {
      font-weight: bold;
      white-space: nowrap;
  }
  span.submenuctrl, span.submenuctrl input, select.submenuctrl {
    color: #777;
  }


name: header
value:
  <div class="header">
    <div class="title"><h1>$<project_name></h1>$<title></div>
      <div class="status"><th1>
   if {[info exists login]} {
     html "$login — <a href='$home/login'>Logout</a>\n"
   } else {
     html "<a href='$home/login'>Login</a>\n"
   }
      </th1></div>
  </div>
  <div class="mainmenu">
  <th1>
  proc menulink {url name} {
    upvar current_page current
    upvar home home
    if {[string range $url 0 [string length $current]] eq "/$current"} {
      html "<a href='$home$url' class='active'>$name</a>\n"
    } else {
      html "<a href='$home$url'>$name</a>\n"
    }
  }
  html "<a href='//core.tcl.tk'>Core <img src='//core.tcl.tk/images/ext.png'></a>"
  menulink $index_page Home
  if {[anycap jor]} {
    menulink /timeline Timeline
  }
  if {[hascap oh]} {
    menulink /dir?ci=tip Files
  }
  if {[hascap o]} {
    menulink  /brlist Branches
    menulink  /taglist Tags
  }
  if {[hascap r]} {
    menulink /ticket Tickets
  }
  if {[hascap j]} {
    menulink /wiki Wiki
  }
  if {[hascap s]} {
    menulink /setup Admin
  } elseif {[hascap a]} {
    menulink /setup_ulist Users
  }
  </th1></div>


name: footer
value:
  <div class="footer">
  This page was generated in about
  <th1>puts [expr {([utime]+[stime]+1000)/1000*0.001}]</th1>s by
  Fossil $release_version $manifest_version $manifest_date
  </div>


name: details
value:
  timeline-arrowheads:        1
  timeline-circle-nodes:      1
  timeline-color-graph-lines: 1
  white-foreground:           0


name: adunit
value:
  <div style="width: 640px; margin: 12px auto;">
    <img style="float: left; width: 32px; height: 32px; padding-right: 10px;"
         src="https://avatars3.githubusercontent.com/u/319421?v=3&s=200">
    <a href="https://github.com/flightaware/Tcl-bounties">Bounty program</a>
    for improvements to Tcl and certain Tcl packages.
  </div>
  <div style="width: 640px; margin: 12px auto;">
    <a href="https://www.tcl.tk/community/tcl2019/">Tcl 2019 Conference,
  Houston/TX, US, Nov 4-8</a><br>
    Send your abstracts to <a href="mailto:tclconference@googlegroups.com">
  tclconference@googlegroups.com</a><br> or submit via the
  <a href="http://tcl.tk/community/tcl2019/submit_form.html">online form</a>
  by Sep 9.
  </div>


name: ticket-editpage
value:
  <th1>
    if {![info exists mutype]} {set mutype {[links only]}}
    if {![info exists icomment]} {set icomment {}}
    if {![info exists username]} {set username $login}
    if {[info exists submit]} {
      if {$mutype eq "Wiki"} {
        set mimetype text/x-fossil-wiki
      } elseif {$mutype eq "HTML"} {
        set mimetype text/html
      } elseif {$mutype eq {[links only]}} {
        set mimetype text/x-fossil-plain
      } else {
        set mimetype text/plain
      }
      submit_ticket
      set preview 1
    }
  </th1>
  <table cellpadding="5">
  <tr><td class="tktDspLabel">Title:</td><td>
  <input type="text" name="title" value="$<title>" size="60" />
  </td></tr>

  <tr><td class="tktDspLabel">Status:</td><td>
  <th1>combobox status $status_choices 1</th1>
  </td></tr>

  <tr><td class="tktDspLabel">Type:</td><td>
  <th1>combobox type $type_choices 1</th1>
  </td></tr>

  <tr><td class="tktDspLabel">Severity:</td><td>
  <th1>combobox severity $severity_choices 1</th1>
  </td></tr>

  <tr><td class="tktDspLabel">Priority:</td><td>
  <th1>combobox priority $priority_choices 1</th1>
  </td></tr>

  <tr><td class="tktDspLabel">Resolution:</td><td>
  <th1>combobox resolution $resolution_choices 1</th1>
  </td></tr>

  <tr><td class="tktDspLabel">Subsystem:</td><td>
  <th1>combobox subsystem $subsystem_choices 1</th1>
  </td></tr>

  <th1>enable_output [hascap e]</th1>
    <tr><td class="tktDspLabel">Contact:</td><td>
    <input type="text" name="private_contact" size="40"
     value="$<private_contact>" />
    </td></tr>
  <th1>enable_output 1</th1>

  <tr><td class="tktDspLabel">Version&nbsp;Found&nbsp;In:</td><td>
  <input type="text" name="foundin" size="50" value="$<foundin>" />
  </td></tr>

  <tr><td colspan="2">
    Append Remark with format
    <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
    from
    <input type="text" name="username" value="$<username>" size="30" />:<br />
    <textarea name="icomment" cols="80" rows="15"
     wrap="virtual" class="wikiedit">$<icomment></textarea>
  </td></tr>

  <th1>enable_output [info exists preview]</th1>
  <tr><td colspan="2">
  Description Preview:<br><hr>
  <th1>
  if {$mutype eq "Wiki"} {
    wiki $icomment
  } elseif {$mutype eq "Plain Text"} {
    set r [randhex]
    wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>"
  } elseif {$mutype eq {[links only]}} {
    set r [randhex]
    wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>"
  } else {
    wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>"
  }
  </th1>
  <hr>
  </td></tr>

  <th1>enable_output 1</th1>
  <tr>
  <td align="right">
  <input type="submit" name="preview" value="Preview" />
  </td>
  <td align="left">See how the description will appear after formatting.</td>
  </tr>

  <th1>enable_output 1</th1>
  <tr>
  <td align="right">
  <input type="submit" name="submit" value="Submit" />
  </td>
  <td align="left">Apply the changes shown above</td>
  </tr>
  <th1>enable_output 1</th1>

  <tr>
  <td align="right">
  <input type="submit" name="cancel" value="Cancel" />
  </td>
  <td>Abandon this edit</td>
  </tr>

  </table>


# reportfmt

title: All Tickets
cols:
  #ffffff Key:
  #f2dcdc Active
  #e8e8e8 Review
  #cfe8bd Fixed
  #bde5d6 Tested
  #cacae5 Deferred
  #c8c8c8 Closed

sqlcode:
  SELECT
    CASE WHEN status IN ('Open','Verified') THEN '#f2dcdc'
         WHEN status='Review' THEN '#e8e8e8'
         WHEN status='Fixed' THEN '#cfe8bd'
         WHEN status='Tested' THEN '#bde5d6'
         WHEN status='Deferred' THEN '#cacae5'
         ELSE '#c8c8c8' END AS 'bgcolor',
    substr(tkt_uuid,1,10) AS '#',
    datetime(tkt_mtime) AS 'mtime',
    type,
    status,
    subsystem,
    title
  FROM ticket


# event

type: ci
user: escoffon
comment:
  - added setting of EXPORT to DLLEXPORT if we are building the itcl lib.
  - use EXTERN instead of extern for Itcl_Assert


type: ci
user: stanton
comment:
  changed to reflect new CompiledLocal structure
  changed to reflect changes in resolver api
  changed to use TclInitCompiledLocals interface


type: ci
user: redman
comment:
  Applied patches from David Gravereaux to update Itcl and Itk to
  use Tcl/Tk 8.1 stubs and provide it's own stubs interface, on
  Windows only.

  Changes have not been made to support I18N (if needed) or MT-safety.

  Version number has been changed to 3.1.0 (from 3.0.1) by
  David to coincide with the shift to Tcl/Tk 8.1.

  Building of itclsh31.exe and iwish31.exe have been disabled
  until someone else makes them work properly.  Test suites
  have been modified to work with tclsh81.exe instead.


type: ci
user: redman
comment:
  Fix the makefile and configure files, etc., for Unix
  in order to compile with Tcl/Tk 8.1 with stubs.

  Builds itclsh and itkwish properly.


type: ci
user: redman
comment:
  Fixed the use of Tcl & Tk stubs on Windows.

  Now the extra shells (itclsh31.exe and itkwish31.exe) are being
  created and run properly.


type: ci
user: wart
comment:
  TEA changes.  Itcl now uses the same Makefiles and configure scripts for
  both Windows and Unix.

  Note that static shells are not yet done in this TEA implementation.


type: ci
user: wart
comment:
  configure now searches for tclsh82 shell in exec-prefix, then prefix, then
  relative to tclConfig.sh, then in the users path.


type: ci
user: wart
comment:
  Look for tclsh82d.exe before tclsh82.exe.

  configure scripts for itcl and itk now use the tcl.m4 macro SC_PROG_TCLSH.


type: ci
user: wart
comment:
  Removed Makefiles rules to regenerate the configure scripts.  This was
  causing problems when building on Windows and Unix simultaneoulsy.


type: ci
user: wart
comment:
  Fixed installation of pkgIndex.tcl file.  We have to install a pre-made
  pkgIndex.tcl file since pkg_mkIndex can't seem to make a usable one.


type: ci
user: wart
comment:
  tcl.m4:  Updated to reflect recent TEA changes

  */configure:  Regnereated with new tcl.m4

  iwidgets2.2.0/Makefile.in:  Don't copy nonexistent files


type: ci
user: csmith
comment:
  Patch by Mo Dejong to fix a Windows NT/95 crashing problem where you can
  build with debugging on, load the Itcl package, and press the X in the
  upper right corner.  Note that I'm unable to test this on Windows and
  that this patch introduces a compiler warning.


type: ci
user: csmith
comment:
  Patch submitted by Mo Dejong needed so Itcl will link to the Tcl libs
  when Tcl is compiled with debugging on.


type: ci
user: csmith
comment:
  Patch submitted by Mo Dejong: needed to add "-force" option to the
  namespace import command so fix a bug with 'make test'.


type: ci
user: csmith
comment:
  Duuuuhhhh....

  This is the patch from Mo Dejong regarding the Windows NT/95 crashing
  problem.  My previous checkin of itcl_parse.c did not include all of
  the patch - got in a hurry.  Disregard the compiler warning mentioned
  in my previous checkin.


type: ci
user: csmith
comment:
  Patch for Ticket 4111, submitted by David Cuthbert:

  *** itcl3.1.0/itcl/generic/itcl_cmds.c.orig     Tue Feb  1 16:37:53 2000
  --- itcl3.1.0/itcl/generic/itcl_cmds.c.new      Tue Feb  1
  16:38:06 2000
              ***************
              *** 94,100 ****
                static char safeInitScript[] =
                "proc ::itcl::local {class name args} {\n\
              !     set ptr [uplevel eval [list $class $name] $args]\n\
                    uplevel [list set itcl-local-$ptr $ptr]\n\
                    set cmd [uplevel namespace which -command $ptr]\n\
                    uplevel [list trace variable itcl-local-$ptr u \"::itcl::delete object $cmd; list\"]\n\

              --- 94,100 ----
                static char safeInitScript[] =
                "proc ::itcl::local {class name args} {\n\
              !     set ptr [uplevel [list $class $name] $args]\n\
                    uplevel [list set itcl-local-$ptr $ptr]\n\
                    set cmd [uplevel namespace which -command $ptr]\n\
                    uplevel [list trace variable itcl-local-$ptr u \"::itcl::delete object $cmd; list\"]\n\


type: ci
user: csmith
comment:
  Patch for ticket 4111, submitted by David Cuthbert:

  *** itcl3.1.0/itcl/library/itcl.tcl.orig        Tue Feb  1 16:38:24 2000
  --- itcl3.1.0/itcl/library/itcl.tcl.new Tue Feb  1 16:38:30 2000
              ***************
              *** 27,33 ****
                #  alive until a procedure exits.
                # ----------------------------------------------------------------------
                proc ::itcl::local {class name args} {
              !     set ptr [uplevel eval [list $class $name] $args]
                    uplevel [list set itcl-local-$ptr $ptr]
                    set cmd [uplevel namespace which -command $ptr]
                    uplevel [list trace variable itcl-local-$ptr u \

              --- 27,33 ----
                #  alive until a procedure exits.
                # ----------------------------------------------------------------------
                proc ::itcl::local {class name args} {
              !     set ptr [uplevel [list $class $name] $args]
                    uplevel [list set itcl-local-$ptr $ptr]
                    set cmd [uplevel namespace which -command $ptr]
                    uplevel [list trace variable itcl-local-$ptr u \


type: ci
user: matt
comment:
  Moved #ifndef NDEBUG inside Itcl_Assert routine otherwise it may not get inclued
  BUT it is specified in the Stubs Table.....


type: ci
user: mmc
comment:
  6/26/00 (bug fix)
    Fixed Itcl_ClassVarResolver so that the formal parameters in a
    method/proc take precedence over class data members.

  6/30/00 (bug fix)
    Fixed all itcl/itk/iwidgets3.0.0 tests to run cleanly with the new
    tcltest package.

  7/1/00 (bug fix)
    Fixed "itk_component delete" so that the composite option list is
    cleaned up whenever a component is deleted.  For example, suppose
    a component is the sole contributor of -font.  When that component
    is removed via "itk_component delete", the -font option goes away
    as well.  Also fixed the handling of the itk-delete-* binding for
    the component.  When the component is removed, the binding tag
    is also removed by itk::remove_destroy_hook.

  7/5/00 (bug fix)
    Fixed the check done during object creation to avoid clobbering
    existing commands.  Previously, itcl would look for any command--
    in the local *and* global namespace--that might be clobbered.
    Now, it looks for commands only in the local namespace, since
    those are the only ones that could truly be clobbered.

  7/5/00 (cleanup)
    Removed obsolete Makefile/configure files in the various "unix"
    directories.  Makefiles and configure files now reside one level
    above, in the standard TEA place.


type: ci
user: csmith
comment:
  patch submitted by David Cuthbert, 7/7/00 to fix segfault caused by the
  following code:

      itcl::class X { }
      namespace eval X { info class }


type: ci
user: wart
comment:
  Use INSTALL_PROGRAM instead of INSTALL_DATA to install libraries so
  they get execute permission on HPUX


type: ci
user: welch
comment:
  Added Itcl_InitStubs to the main Itcl library as well as the stubs
  library for those applications (like Itk) that call Itcl_InitStub
  but are linked against the main library.


type: ci
user: davidg
comment:
  Tcl_InitStubs was using the TCL_VERSION macro set by the tcl.h header.
  Changed it to be "8.1" instead as it doesn't matter unless Itcl needs
  special/new features of the core it's header is from.  But it doesn't..  so hard
  code it for an 8.1 minimum.


type: ci
user: davidg
comment:
  9/22/00 (stubs cleanup) <davygrvy@ajubasolutions.com>
    Itcl_InitStub prototype in itcl/generic/itcl.h was getting name mangled
    by c++ compilers.  Fixed with an 'extern "C"' appropriately applied.


type: ci
user: davygrvy
comment:
  4/07/01 (bug fix) <davygrvy@pobox.com>
    Tcl's internal header, tclInt.h, in 8.4a2 got a small change in the Command
    structure that needed 2 changes in Itcl to resolve.  1) #if/#else/#endif blocks
    added in itcl_class.c and itc_ensemble.c allowing Itcl to compile. 2) added
    a global variable called itclCompatFlags that's sets a flag in Itcl_Init()
    that will modify the logic around access to cmdPtr->flags/deleted.  This
    way, any core compile will yeild a fully forward/backward compatible
    binary (correct logic set at runtime).


type: ci
user: davygrvy
comment:
  Added mutex locking around the ItclPreservedList global hash table.  This
  appears to be the only work needed to support multithreading.


type: ci
user: andreas_kupries
comment:
  2001-05-11  Andreas Kupries  <a.kupries@westend.com>

  * itk/generic/itk_archetype.c: Fixed bug 227824 (and several duplicates).


type: ci
user: davygrvy
comment:
  Removing of old cruft.  itclshXX.exe is no longer needed as itclXX.dll is a
  pure extension and loads in a vanilla shell just fine.


type: ci
user: davygrvy
comment:
  Fix for Itcl_ClassCmdResolver() not being of type Tcl_ResolveCmdProc with
  the CONST type added to param 2 in the lastest headers.  I haven't tested
  this with an older tcl.h yet.  Hopefully, this won't get messy.


type: ci
user: davygrvy
comment:
  Fix for Tcl_GetCommandName() now returning a CONST char *
  from the changes Kevein Kenny is doing to the HEAD tcl code.
  This hasn't been tested with older header files, yet.


type: ci
user: davygrvy
comment:
  changed RESOURCE_INCLUDED to RC_INVOKED. The windows resource
  compiler to preset to define this already.


type: ci
user: davygrvy
comment:
  removed #include "tclCompile.h"!
  It wasn't needed.  Those source files made no reference to anything in it.


type: ci
user: davygrvy
comment:
  fixed include paths to make sure paths to itcl.h and itk.h in the source tree
  are mentioned first to avoid a possible bug during building.


type: ci
user: andreas_kupries
comment:
  2001-05-28  Andreas Kupries <andreas_kupries@users.sourceforge.net>

  	* itcl/Makefile.in:
  	* itk/Makefile.in:
  	* iwidgets/Makefile.in: Fixed installation of manpages, added
  	  invocations of "basename" to create the correct paths into the
  	  installation directories. Fixes [#427118].


type: ci
user: davygrvy
comment:
  	* itcl/generic/itcl.h:
  	* itcl/generic/itclDecls.h:
  	* itcl/generic/itclInt.h:
  	* itcl/generic/itclIntDecls.h:
  	* itk/generic/itk.h:
  	* itk/generic/itkDecls.h:  EXTERN macro changed to support TIP#60
  	in draft form.  [Incr Tcl] will be the "successful implementation"
  	part of the TIP.


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_cmds.c (Itcl_FindObjectsCmd): fixed potential
  	crash where cmdName was never initialized


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_ensemble.c (CreateEnsemble, AddEnsemblePart):
  	made the <8.4 Tcl header version changes easier in the code.


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_methods.c (Itcl_GetMemberFuncUsage): corrected
  	casting of CONST char * to prevent compile warnings.


type: ci
user: hobbs
comment:
  	* configure:
  	* itcl/configure:
  	* itk/configure: regen'ed
  	* tcl.m4: changed MSSDK cygpath check to use pipe instead of
  	subshell to only occur at the right point.


type: ci
user: davygrvy
comment:
  	* itcl/generic/itcl.h:
  	* itcl/generic/itclDecls.h:
  	* itcl/generic/itclIntDecls.h:
  	* itk/generic/itk.h:
  	* itk/generic/itkDecls.h:
  	* itk/generic/itk.decls:  Changed redefining the macro EXTERN to making
  	a new macro called TCL_EXTERN to get this Borland problem squashed without
  	breaking all headers included after itcl.h that use the EXTERN macro.


type: ci
user: davygrvy
comment:
  	* itcl/generic/itcl_cmds.c (Itcl_FindObjectsCmd, Itcl_FindClassesCmd):
  	optimized use of Tcl_Objs to remove creation of a new ones that ended
  	just being set to the interp's result.  Let it use the result obj
  	instead.  Changed a few Tcl_GetStringFromObj() calls to Tcl_GetString()
  	when a length int* isn't used.


type: ci
user: andreas_kupries
comment:
  	* itcl/Makefile.in:
  	* itcl/generic/itclInt.decls:
  	* itcl/generic/itcl_bicmds.c:
  	* itcl/generic/itcl_class.c:
  	* itcl/generic/itcl_ensemble.c:
  	* itcl/generic/itcl_methods.c:
  	* itcl/generic/itcl_objects.c:
  	* itcl/generic/itcl_obsolete.c:
  	* itcl/generic/itcl_parse.c:
  	* itcl/generic/itcl_util.c:
  	* itk/Makefile.in:
  	* itk/generic/itk.decls:
  	* itk/generic/itk_archetype.c:
  	* itk/generic/itk_option.c: Applied SF patch #511035 (provided by
  	  Don Porter <dgp@users.sourceforge.net>) to remove warnings
  	  related to TIP 27.


type: ci
user: hobbs
comment:
          * configure:
          * tcl.m4: corrected pointer to ldAix to use Tcl version and add
          -lc for AIX builds

          * itcl/configure:
          * itcl/configure.in:
          * itk/configure:
          * itk/configure.in: corrected to use SHLIB_LD_LIBS instead of
          TCL_SHLIB_LD_LIBS.


type: ci
user: hobbs
comment:
  	* configure:
  	* configure.in:
  	* tcl.m4:
  	* itcl/Makefile.in:
  	* itcl/configure:
  	* itcl/configure.in:
  	* itcl/itclConfig.sh.in:
  	* itcl/pkgIndex.tcl.in:
  	* itcl/generic/itclStubLib.c:
  	* itcl/tests/all.tcl:
  	* itk/Makefile.in:
  	* itk/configure:
  	* itk/configure.in:
  	* itk/pkgIndex.tcl.in:
  	* itk/tests/all.tcl:
  	* config/installFile.tcl (removed):
  	* config/mkinstalldirs (removed): Massive overhaul (and
  	simplification) of the build framework to adapt to TEA 2002
  	specs.  Dynamic libraries now install in the pkglibdir (before it
  	was libdir), itclConfig.sh is properly generated and itk uses it.
  	Stubs libraries are now correctly generated and used.  You can now
  	build and test itcl/itk against built but not installed Tcl/Tk.


type: ci
user: hobbs
comment:
  	* itcl/configure:
  	* itcl/configure.in:
  	* itk/configure:
  	* itk/configure.in: redid generation of itclConfig.sh (making it
  	work on Windows broke Unix).  Retested so that it is happy on
  	Windows and Unix (calls ${CYGPATH} only when necessary).


type: ci
user: hobbs
comment:
  	* itcl/Makefile.in (install-lib-binaries):
  	* itk/Makefile.in (install-lib-binaries): ensure that dynamic
  	library is installed executable


type: ci
user: hobbs
comment:
  	* itcl/Makefile.in:
  	* itk/Makefile.in: updated to use DESTDIR for install everywhere
  	and added shell and gdb targets


type: ci
user: hobbs
comment:
  	* */configure: regend
  	* configure.in: removed prefix default calls
  	* itcl/configure.in:
  	* itk/configure.in:
  	* tcl.m4: updated of TEA base


type: ci
user: hobbs
comment:
  	* itcl/configure:
  	* itk/configure:
  	* tcl.m4: Enabled COFF as well as CV style debug info with
  	--enable-symbols to allow Dr. Watson users to see function info.
  	More info on debugging levels can be obtained at:
  	http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp


type: ci
user: davygrvy
comment:
  Added the itcl::is command from Brett Schwarz.
  Untested by me, but looks great.
  [Patch 546343 546344 546345 546346]


type: ci
user: hobbs
comment:
  	* itcl/itclConfig.sh.in: dupped vars to have both itcl_* and
  	ITCL_* to support apps that used old-style itclConfig.sh.


type: ci
user: davygrvy
comment:
  	* itcl/generic/itclDecls.h:
  	* itcl/generic/itclIntDecls.h:
  	* itcl/generic/itclStubInit.c:  Re-gen from modified genStubs.tcl
  	for the special TCL_EXTERN macro changes that Itcl has.


type: ci
user: davygrvy
comment:
  	* itcl/generic/itcl_class.c (Itcl_ClassVarResolver,
  		Itcl_ClassCompiledVarResolver):
  	* itcl/generic/itcl_object.c (Itcl_ScopedVarResolver,
  		ItclTraceThisVar):
  	* itcl/generic/itcl_parse.c (Itcl_ParseVarResolver):
  	* itcl/generic/itclInt.decls:
  	Signiture changes to match 8.4b2 CONST'ification of the
  	Tcl_ResolveVarProc typedef. Stubs slot positions nor sizes
  	have changed -- just the sigs.


type: ci
user: davygrvy
comment:
  	* itcl/generic/itcl_obsolete.c (deleted):
  	* itcl/generic/itcl_cmds.c:  Removed old [itcl_class] command
  	and old backward support that came with it.


type: ci
user: davygrvy
comment:
  	* itcl/win/makefile.vc:
  	* itcl/Makefile.in: Removed itcl_obsolete.c from the build
  	instructions.


type: ci
user: andreas_kupries
comment:
  	* itcl/generic/itcl_class.c (ItclDestroyClassNamesp): Applied itcl
  	  patch 593112 provided by Reinhard Max
  	  <rmax@users.sourceforge.net>. This fixes the segfault in itcl
  	  bug 577719, reported by Simon White
  	  <s_a_white@users.sourceforge.net>.


type: ci
user: andreas_kupries
comment:
  	* itk/configure.in:
  	* itcl/configure.in: Changed to propagate an initial CFLAGS value
  	  to the final definition. A TEA condition (SHARED_BUILD == 1)
  	  squashed it, causing it the build system to loose the
  	  +DAportable we specify for the AS PA-RISC2.2 build host. This is
  	  a problem for _all_ TEA and TEA 2 based configure files.


type: ci
user: hobbs
comment:
  	* tcl.m4:
  	* itcl/configure:
  	* itcl/configure.in:
  	* itk/configure:
  	* itk/configure.in: move the CFLAGS definition into TEA_ENABLE_SHARED
  	and make it pick up the env CFLAGS at configure time.


type: ci
user: andreas_kupries
comment:
  	* itcl/configure.in:
  	* itk/configure.in:
  	* tclconfig/tcl.m4: Updated to newest tcl.m4, regenerated
  	  configure's.


type: ci
user: davygrvy
comment:
  full brain dump.  All CONST issues fixed except for
  Itcl_DecodeScopedCommand.  Will address this next.


type: ci
user: davygrvy
comment:
  Because the Tcl_Namespace APIs in Tcl have moved to the public space
  in 8.5, the stub slots have shifted.  This now causes Itcl when built against
  8.5 to core when loaded into 8.4.  What genius you developers!  The
  absolute first rule with Stubs is not to EVER move the slots, but now you did.
  Previously, one could build Itcl against 8.4 and load into any core 8.1+.  Now
  we can't do this.  Gee, thank you all for the support...

  Now, what we compile against is the lowest we can load into.. Sorry!  send
  heated complaints to tcl-core@lists.sf.net


type: ci
user: davygrvy
comment:
  Now builds against Tcl 8.0!  Unbeleivable, but true :)  Tcl bug #803489
  now suppressed with grotesque macros in itclInt.h


type: ci
user: davygrvy
comment:
  Uses new features of nmakehlp to get the version strings from header files
  without the use of hardcoded values.


type: ci
user: hobbs
comment:
  	* itcl/mac/MW_ItclHeader.pch (removed)       Removed Mac Classic
  	* itcl/mac/itclMacApplication.r (removed)    sources.  There were
  	* itcl/mac/itclMacLibrary.r (removed)        no longer maintained,
  	* itcl/mac/itclMacResource.r (removed)       and Tcl has dropped
  	* itcl/mac/itclMacTclCode.r (removed)        ongoing Mac Classic
  	* itcl/mac/itclStaticApplication.r (removed) support as well (in
  	* itcl/mac/pkgIndex.tcl (removed)            favor of OS X).
  	* itk/mac/MW_ItkHeader.pch (removed)
  	* itk/mac/itkMacApplication.r (removed)
  	* itk/mac/itkMacLibrary.r (removed)
  	* itk/mac/itkMacResource.r (removed)
  	* itk/mac/itkMacTclCode.r (removed)
  	* itk/mac/itkStaticApplication.r (removed)
  	* itk/mac/pkgIndex.tcl (removed)
  	* itk/mac/tclIndex (removed)


type: ci
user: hobbs
comment:
  	* Makefile.in, configure, configure.in: Update to TEA 3.1
  	* tcl.m4 (removed):              cleanup build system to only
  	* config/config.guess (removed): provide the parts that are
  	* config/config.sub (removed):   necessary to itcl and itk.
  	* config/install-sh (removed):   Update to 3.3.0 as version
  	* tclconfig/install-sh (added):  throughout.
  	* tclconfig/tcl.m4 (added):
  	* itcl/generic/itcl.h:
  	* itcl/Makefile.in, itcl/aclocal.m4, itcl/configure:
  	* itcl/configure.in, itcl/itclConfig.sh.in, itcl/pkgIndex.tcl.in:
  	* itk/Makefile.in, itk/aclocal.m4, itk/configure, itk/configure.in:
  	* itk/itkConfig.sh.in, itk/pkgIndex.tcl.in, itk/generic/itk.h:


type: ci
user: hobbs
comment:
  	* */Makefile.in (VPATH): move $(srcdir)/unix to front (unused) to
  	get around bug in autoconf that strips $(srcdir) from first
  	element when building in the source directory.


type: ci
user: hobbs
comment:
  	* itcl/itclConfig.sh.in:            must be absolute path to
  	* itcl/configure.in (itcl_SRC_DIR): configure in the srcdir.
  	* itcl/configure:                   [Bug 582951]


type: ci
user: davygrvy
comment:
  Updated code examples to use the fully qualified Itcl command names.  A
  few references to the itcl namespace command are still there and need to
  be changed at some point.


type: ci
user: davygrvy
comment:
  Tree name for commands changed from "[Incr Tcl]" to [Incr Tcl] Commands".
  Started to add exported API docs under the new "[Incr Tcl] Library
  Procedures" tree.


type: ci
user: davygrvy
comment:
  * itcl/generic/itcl_cmds.c:  Fix for [Bug 1047544]  Forward loading
  * itcl/generic/itcl_util.c:  from an 8.4 build loading into in 8.5
  is not possible at this time.


type: ci
user: davygrvy
comment:
  better fix for the bug without an ID that was never properly added to the bugDB on SF that relates to object commands created with namespace prefixes not returning the prefix


type: ci
user: hobbs
comment:
  	* itcl/configure, itk/configure: update to TEA 3.1 r1.54, removes
  	* configure, tclconfig/tcl.m4:   DBGX, updates default opt levels


type: ci
user: hobbs
comment:
  	* itcl/generic/itclInt.h:      [Bug 1115085] (dejong) Fix crash
  	* itcl/generic/itcl_bicmds.c:  with TclInitCompiledLocals reliance
  	* itcl/generic/itcl_methods.c: on bytecode ptr type


type: ci
user: hobbs
comment:
  	* itcl/Makefile.in, itk/Makefile.in (AR): use @AR@
  	* tclconfig/tcl.m4, itcl/configure, itk/configure: update to TEA 3.2


type: ci
user: dgp
comment:
  Updates to the itcl module so that it can be configured/built
  independent of the other modules in the incrTcl project.
  Includes TEA updates.


type: ci
user: hobbs
comment:
  	* Makefile.in:                           OS X patches from Steffen
  	* itcl/generic/itcl_cmds.c (initScript):
  	* itk/generic/itk_cmds.c (initScript):


type: ci
user: hobbs
comment:
  	* itcl/tests/methods.test (method-2.1):
  	* itcl/generic/itcl_methods.c (Itcl_DeleteMemberCode): free any
  	compiled local in the no arguments list case.


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_cmds.c (Initialize): remove the exactness
  	requirement on the TCL_VERSION in Tcl_PkgRequire/Tcl_InitStubs.
  	[AS Bug 67068]


type: ci
user: hobbs
comment:
  	* configure, configure.in, itcl/configure, itcl/configure.in:
  	* itk/configure, itk/configure.in, tclconfig/tcl.m4: TEA 3.6 update


type: ci
user: hobbs
comment:
  	* README, itcl/configure, itcl/configure.in: updated to 3.3.1
  	* itcl/generic/itcl.h, itcl/generic/itclInt.decls:
  	* itcl/generic/itclInt.h, itcl/generic/itclIntDecls.h:
  	* itcl/generic/itcl_bicmds.c, itcl/generic/itcl_class.c:
  	* itcl/generic/itcl_cmds.c, itcl/generic/itcl_methods.c:
  	* itcl/generic/itcl_migrate.c, itcl/generic/itcl_objects.c:
  	* itcl/generic/itcl_parse.c, itcl/generic/itcl_util.c:
  	* itk/configure, itk/configure.in, itk/generic/itk.h:
  	* itk/generic/itk_archetype.c, itk/generic/itk_option.c: Fix itcl
  	use of Tcl_CallFrame to allow itcl compiled with pre-8.5 core to
  	work in Tcl 8.5.  [Bug 1725219]


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_bicmds.c, itcl/generic/itcl_class.c:
  	* itcl/generic/itcl_cmds.c, itcl/generic/itcl_ensemble.c:
  	* itcl/generic/itcl_methods.c, itcl/generic/itcl_objects.c:
  	* itcl/generic/itcl_parse.c, itcl/generic/itcl_util.c:
  	* itk/generic/itk_archetype.c, itk/generic/itk_cmds.c:
  	* itk/generic/itk_option.c: Reduce use of potentially dangerous
  	Tcl_AppendStringsToObj for possibly shared interp result obj.
  	[Bug 227814, 1468370]


type: ci
user: hobbs
comment:
  	* README, configure, configure.in:
  	* itcl/configure, itcl/configure.in, itcl/generic/itcl.h:
  	* itk/configure, itk/configure.in, itk/generic/itk.h: updated to
  	3.4 as itcl handles M.m more cleanly


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_class.c (Itcl_FindClassNamespace): harden the
  	lookup to use short-circuit. [Bug 1156352]


type: ci
user: hobbs
comment:
  	* itcl/tests/basic.test:
  	* itcl/generic/itcl_parse.c (Itcl_ClassCmd): handle "" class name
  	properly. [Bug 1156343] (dejong)


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_class.c, itcl/generic/itcl_cmds.c: code cleanup
  	* itcl/generic/itcl_methods.c, itcl/tests/basic.test: [Bug 1156326]


type: ci
user: hobbs
comment:
  	* itcl/library/itcl.tcl: fix for itcl's tclIndex file generation
  	to include "imported" itcl commands, like configbody. (allaert)


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_class.c (Itcl_HandleClass): Make #auto handling
  	* itcl/tests/basic.test:                        code unicode-aware.


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_cmds.c (Initialize):              Resolve
  	* itcl/generic/itcl_util.c (Itcl_DiscardInterpState): [Bug 1047544]
  	(Itcl_RestoreInterpState, Itcl_SaveInterpState):      with fix that
  	* itcl/generic/itclInt.h: has late-8.4 support for stubs x-version
  	support of the state APIs.


type: ci
user: msofer
comment:
  	* itcl/generic/itcl_parse.c (Itcl_ClassCommonCmd): plug leak
  	of pre-existing variables being declared as common


type: ci
user: msofer
comment:
  	* itcl/generic/itclInt.h:
  	* itcl/generic/itcl_class.c:
  	* itcl/generic/itcl_cmds.c:
  	* itcl/generic/itcl_methods.c:
  	* itcl/generic/itcl_migrate.c:
  	* itcl/generic/itcl_objects.c:
  	* itcl/generic/itcl_parse.c:
  	* itcl/generic/itcl_util.c:  Adaptation to Tcl's VarReform. When
  	compiled against 8.4 headers, itcl/itk will also run under 8.5.
  	Patch from [Bug 1766617]


type: ci
user: davygrvy
comment:
  Small change to how compiler flag are built-up.  Stubs library doesn't
  have stuff it doesn't need and now take $(OPTDEFINES) from the top
  rules.vc


type: ci
user: hobbs
comment:
  	* itcl/library/itcl.tcl (itcl_class, itcl_info): create auto_index
  	fallbacks of classic itcl v2 itcl_class and itcl_info calls.  This
  	handles the public/protected change in itcl::class definitions.


type: ci
user: hobbs
comment:
  	* itcl/library/itcl.tcl (::itcl::itcl_class): correct compat
  	definition to use right declaration for public/protected variable.


type: ci
user: hobbs
comment:
  	* itcl/generic/itcl_methods.c (Itcl_CreateMemberCode): ensure that
  	we init all Command structure to 0 for version struct variance.


type: ci
user: msofer
comment:
  	* itcl/library/itcl.tcl: patch Tcl's ::unknown at load time, as
  	Tcl removed the special handling that we need for [namespace code]
  	[Patch 2040295]


type: ci
user: msofer
comment:
  	* itcl/generic/itcl_bicmds.c: replace interp->result with
  	Tcl_GetStringResult (thanks apw)

  Also added missing ChangeLog entry for older commit.


type: ci
user: hobbs
comment:
  	* itcl/library/itcl.tcl (::unknown): correct unknown redefinition
  	to support pre-8.5 interps. [Bug #2040295]


type: ci
user: andreas_kupries
comment:
  	* itcl/generic/itcl_cmds.c: Handle TIP#336 addition of API to access
  	* itcl/generic/itcl_ensemble.c: interp->errorLine.
  	* itcl/generic/itclInt.h:
  	* itcl/generic/itcl_methods.c:
  	* itcl/generic/itcl_parse.c:


type: ci
user: hobbs
comment:
          * itcl/Makefile.in, itcl/configure, itcl/configure.in:
          * itk/Makefile.in, itk/configure, itk/configure.in:
          * configure, configure.in: update to TEA 3.9, regen with ac-2.59


type: ci
user: hobbs
comment:
          * itcl/Makefile.in, itk/Makefile.in (TCL_TOP_DIR_NATIVE): no longer
          necessary for private header builds


type: ci
user: hobbs
ecomment:
  	* itcl/generic/itcl_ensemble.c (HandleEnsemble): fix mem leak in
  	itcl ensemble handling. [AS Bug 86108, SF Bug 1503328]

comment:
  	* itcl/generic/itcl_ensemble.c (HandleEnsemble): fix mem leak in
  	itcl ensemble handling. [AS Bug 86108, SF Bug 1503328]


type: ci
user: wiede
comment:
  fixes for use of tclooConfig.sh (which I have built at the moment by hand). Will ask dkf to provide one


type: ci
user: wiede
comment:
  bracket use of CallFrame resolvers and fix in ensemble WrongNumArgs with #ifdef ITCL_USE_MODIFIED_TCL_H


type: ci
user: wiede
comment:
  removal of some no longer needed functions. Intergration of the last script parts. Again some beautifying. Changing interp.test back to original version, without script files in the package, the changes are no longer needed.


type: ci
user: wiede
comment:
  code for freeing of structures for classes (fixing memory leaks) additional code as well as some beautifying


type: ci
user: wiede
comment:
  new commands ::itcl::struct, ::itcl::nwidget, ::itcl::addoption and ::itcl::addcomponent
  restructuring of some functions for options to be able to use them without ItclWidget package
  these are now also used in ::itcl::struct and ::itcl::nwidget
  ::itcl::struct and ::itcl::nwidget build the base for a prototype implementation
  of NexTk based on megaimage etc. from George Peter Staplin using itcl without using Tk


type: ci
user: wiede
comment:
  rename :.itcl::struct to ::itcl::eclass (extended class). renaming if _IS_ defines to names without _IS_. Fixes for ItclMapProcCmd to use Itcl_ParseNamespPath for correct working.


type: ci
user: wiede
comment:
  fixing of special configure and chain method problems caused by use of Itcl_ParseNamespPath in the fix of yesterday


type: ci
user: wiede
comment:
  use itcl_options instead of options for storing all options of a eclass class.
  a lot of changes to *Configure *Cget and itclObject.c to make that work


type: ci
user: wiede
comment:
  some fixes for configure and cget. Renamed ItclWidgetConfigure to ItclExtendedConfigure,
  ItclWidgetCget to ItclExtendedCget and ::itcl::eclass to ::itcl::extendedclass


type: ci
user: wiede
comment:
  make itcl specific info exists command, set object name before constructor
  so that can be used in the constructor already (needed for nktWidget)


type: ci
user: wiede
comment:
  fix for direct execution of class procs without object and fixes for making tests with new Tcl HEAD working


type: ci
user: wiede
comment:
  fixes for use of less Migrate2Tcl stuff and a fix for calling overloaded functions, with special access handling


type: ci
user: wiede
comment:
  changes for use of ::itcl::intrnal::infos variables. That makes it easy to place all the stuff into a different namespace if necessary without even the need of recompiling.
  That could also be used for having additionally a mostly compatible version to the original itcl syntax.


type: ci
user: wiede
comment:
  changes for use of ::itcl::internal::infos::* variables for initializing the namespaces used and new code for destructor, constructor etc.


type: ci
user: wiede
comment:
  some streamlining for delaying deletion of class/object namespace as long as they are used and code for itcl::body handling (changeClassMemberFunc)


type: ci
user: wiede
comment:
  This is the first NRE enabled version of itcl-ng with TclOO integrated into
  Tcl core.
  It is about revision 8.6.2a of Tcl core.


type: ci
user: wiede
comment:
  reordering in itcl.decls, new files itclResolve2.c itclVCInt.h itclVarsAndCmds.c itclVarsAndCmds.h for NEW_PROTOTYPE_RESOLVER, a lot of small fixes


type: ci
user: wiede
comment:
  remove -DUSE_NON_CONST in CFLAGS, not needed as this will not be compiled against Tcl 8.3 headers. This avoids need for using CONST84 macro.


type: ci
user: wiede
comment:
   fixed C++ style comments, fixes for stubs uses (thanks to Paul Obermeier) in itclBase.c And a lot of changes and new code for ::itcl::type


type: ci
user: wiede
comment:
  rename of hullinstall to installhull and componentinstall to installcomponent
  adding flag fro handling of ITCL_WIDGETADAPTOR and some code for support
  of ::itcl::widgetadaptor


type: ci
user: wiede
comment:
  renaming of hullinstall to install hull and componentinstall to installcomponent
  new code and fixes for ::itcl::widgetadaptor


type: ci
user: wiede
comment:
  again a lot of fixes and new code for ::itcl::widget and ::itcl::widgetadaptor
  to make additional tests running.


type: ci
user: wiede
comment:
  again fixes and new code for making additional tests for :.itcl::widget
  and ::itcl::widgetadaptor running.


type: ci
user: wiede
comment:
  rearranging of tests and now hijacking of object name in widgetadaptors
  works correctly, so no longer a workaround necessary


type: ci
user: wiede
comment:
  fixes and a lot of new code for implementing the first part of the info
  commands for ::itcl::type, ::itcl::widget and ::itcl::widgetadaptor
  (the ones taken over from snit).


type: ci
user: wiede
comment:
  fix for executing uplevel 1 destroy ... if the class has no destroy command.
  This is necessary as itk expects to execute ::destroy when destroy is called.
  So the builtin destroy command cannot be used here but only for snit widgets.


type: ci
user: wiede
comment:
  fixes for making some of the failing tests running in info and handling
  of caching methods, which have succeeded in being called when delegated
  with * delegation.


type: ci
user: wiede
comment:
  new code for instrumention for checking releasing of classes and objects
  as weel as variables, functions, options etc.
  A lot of fixes for cleaning up of classes and objects at the end of their
  life time (first round of memory leak business).


type: ci
user: wiede
comment:
  removed some debugging stuff and added a cleaup call to delete the ensemble
  at the end in ensemble.test


type: ci
user: wiede
comment:
  set namespace for ItclExtendedConfigure validatemethod and check for
  filled stackTrace var in itclParse.c errorMessage output


type: ci
user: wiede
comment:
  new commands createhull and setupcomponent. Moved ::itcl::widget and
  ::itcl::widgetadaptor to itcl from itclWidget using new library file
  library/itclWidget.tcl to initialize package itclWidget.
  Maybe in the long range itclWidget can disappear completely and be
  implemented in library/itclWidget.tcl only.
  New file library/itclHullCmds.tcl for use in itcl::extendedclass
  to support createhull and setupcomponent commands.


type: ci
user: wiede
comment:
  new command keepcomponentoption a la keep command in itk when using
  itk_component add. Needed for itclWidgets package.


type: ci
user: wiede
comment:
  new command widgetDeleted use vi a comamnd trace when the itcl_hull widget
  is destroyed, to delete the appropriate object


type: ci
user: wiede
comment:
  renamed iwidgets strings to itcl::widgets and options don't include clientdata
  in itcl-ng, so the number options is 39 instead of 40


type: ci
user: wiede
comment:
  add constraints to tests which either need a frq implemented in Tcl
  or are failing because of a bug in TclOO


type: ci
user: wiede
comment:
  renamed some test names from basic to delete, make constraints for one test
  which uses a feature only in itcl3.4 (after deletion of object data stays)


type: ci
user: wiede
comment:
  added tests for info method, info typemethod, info typevariable
  info delegated method info delegated typemethod


type: ci
user: wiede
comment:
  fully implemented info method, info typemethod, info typevars,
  info typevariable, info delegated method and info delegated typemethod


type: ci
user: wiede
comment:
  use the objects class for resolving only for the this variable!!
  otherwise use the classes variable for the case that the variable
  is named identical ind different classes of the class hierarchy


type: ci
user: wiede
comment:
  added proc autoload to test 2.5 as test 2.4 is not used because of a constraint
  so there is no proc autoload in that case. Also added bug number to the
  constraint of test 2.4


type: ci
user: dgp
comment:
  Presence of ::tcltest namespace does not imply that ::tcltest::test has
  been [namespace import]ed into ::.  The whole cultish prelude is out
  of date.  Modernizing...


type: ci
user: wiede
comment:
  cleanup constructor stack in case of failure otherwise the next object is
  using these entries additionally with structures no longer existant!!


type: ci
user: wiede
comment:
  split up some code in extended configure to built an own function
  and fixes for plain configure for ::itcl::extendedclass handling
  fix in extendedcget


type: ci
user: wiede
comment:
  finally found the right place to fix a segfault which happened onyly with
  itclWidgets modules when the destructor of an object was called twice,
  which cannot be prevented. There was no correct check on the right place.
  The check on the wrong place is now removed and the correct check on the right
  place is no done.

  fixed some error message texts for traced variables


type: ci
user: wiede
comment:
  check for existance of object when writing to trace vars. In itclWidgets
  there are some places where there is an after idle and sometimes the object
  on a fast machine is already destroyed in a test, when the after idle
  code is executed


type: ci
user: wiede
comment:
  use only the tail of the class name as clas for the widget.
  Try to create itcl_hull and itcl_interior, if not existant.
  That does not yet work because of itclResolve does no more lookup
  for variables it can not determine at compile time.


type: ci
user: wiede
comment:
  added datarootdir = @datarootdir@ and datadir = @datadir@ to Makefile.in
  to satisfy autoconf 2.61 and therefore a new configure


type: ci
user: wiede
comment:
  cannot remove variables from class or object when they are unset. They
  can only be removed when tearing down class or object, otherwise there is
  for example a problem when unsetting an array and using it afterwards again
  as the variable is then no longer known in the class/object.


type: ci
user: wiede
comment:
  at the moment we have to catch setting the options, as the info command
  returns all options and not only the class specific ones


type: ci
user: davygrvy
comment:
  	* win/makefile.vc:     Itcl 4.0 is now closer to building
  	* win/nmakehlp.c:     but the work isn't finished. the
  	* win/rules.vc (new): source apparently has export
  	* win/itcl.rc (new):     collisions with internal declarations
  	* win/rc/itcl.rc (deleted) of the same name.


type: ci
user: davygrvy
comment:
  	* generic/itclBase.c:
  	* generic/itclBuiltin.c:
  	* generic/itclClass.c:
  	* generic/itclCmd.c:
  	* generic/itclEnsemble.c:
  	* generic/itclHelpers.c:
  	* generic/itclInfo.c:
  	* generic/itclMethod.c:
  	* generic/itclMigrate2TclCore.c:
  	* generic/itclObject.c:
  	* generic/itclParse.c:
  	* generic/itclResolve.c
  	* generic/itclStubs.c
  	* generic/itclTclIntStubsFcn.c:
  	* win/makefile.vc:
  		Changes to allow compiling on windows with
  		MSVC++.  Double declaration of internal
  		functions not yet repaired.  DOESN'T
  		BUILD YET with makefile.vc.


type: ci
user: davygrvy
comment:
  	* generic/itclMigrate2TclCore.h:    All build errors squashed
  	* generic/itclStubLib.c:
  	* generic/itclTclIntStubFcn.h:
  	* win/makefile.vc:


type: ci
user: davygrvy
comment:
  	* generic/itcl2TclOO.h:  More cleanups changing the last of the
  	* generic/itclClass.c:     'EXTERN' macros to just be 'extern' as we
  	* win/.cvsignore:       aren't importing the declaration, just sharing it
  	* win/itcl.rc:           internally.  This caused warnings on windows during
  	* win/makefile.vc:   the link stage as it was getting confused about 'why
  	* win/nmakehlp.c:   are you importing an internal function?'
  	* win/rules.vc:


type: ci
user: wiede
comment:
  added dummy functions Itcl_BiInfoHullTypesCmd, Itcl_BiInfoWidgetsCmd,
  Itcl_BiInfoWidgetclassesCmd and Itcl_BiInfoWidgetadaptorsCmd, which are
  overwritten when itclWidget.tcl is sourced when necessary.


type: ci
user: wiede
comment:
  added ItclSetHullWindowName and ItclCheckSetItclHull, needed for final
  integration of itclWidget package. Added dicts variables for use by
  itclWidget classes and for future replacement of itclInfo.c by a tcl script.
  Added a HashTable for the class types.


type: ci
user: wiede
comment:
  this is for adding the missing comments for the last commit.
  Removed ItclWidgetInfo typedef and the function pointers. These are no
  longer necessary as the itclWidget package is now fully integrated.
  New definitions of the *Dict*Info functions for setting the according
  dictionary variables


type: ci
user: wiede
comment:
  added function for setting of dict variables to be used by itclWidget
  classes and in the future for being able to replace itclInfo.c by
  a Tcl script


type: ci
user: wiede
comment:
  added calls to Dict*Info functions for use by itclWidget classes and
  future use by a scripted version (in Tcl) of itclInfo.c
  Added genericclass command to allow easier parsing of a class definition
  in the future (maybe by a scripted version)


type: ci
user: wiede
comment:
  replaced calls to itclWidget packaged by calls to the scripted functions
  in itclWidget.tcl. ItclWidget package is no longer needed.


type: ci
user: wiede
comment:
  itclWidget.tcl has been filled with functions that replace the itclWidget
  package where they where written in C. Therefor the itclWidget package is no
  longer needed.
  itclHullCmds.tcl has similar functions as in itclWidget.tcl but to be used
  by ::itcl::extendedclass, which will be used for a modified version of
  Iwidgets called itclWidgets, which is completely written with itcl-ng
  without the need to use itk.


type: ci
user: wiede
comment:
  bracket include of malloc.h with #ifdef ITCL_PRESERVE_DEBUG, as it is only used
  for debugging and does not work on OSX. Have to find a portable solution
  in the future using memory.h, but I first have to learn how to use that.
  Using #ifdef ITCL_PRESERVE_DEBUG I can again use the malloc and free calls
  in the debugging stuff to not conflict with ckalloc and ckfree, which is
  check in these functions


type: ci
user: davygrvy
comment:
  2009-05-09  David Gravereaux <davygrvy@pobox.com>

  	* generic/itclDecls.h:   Better C++ support.
  	* generic/itclStubLib.c: #define USE_TCL_STUBS is required


type: ci
user: das
comment:
  	* configure.in:		check for intptr_t type and include sys/types.h
  	* generic/itclInt.h:	to make INT2PTR & PTR2INT macros actually work.
  	* itclng/generic/itclngInt.h:


type: ci
user: wiede
comment:
  added Itcl_GetUplevelCallFrame and Itcl_ActivateCallFrame functions
  same as in Itcl3.4. They are needed to call the itk_component command
  with the suitable call frame as this is needed for access to the
  proc local vars. This was the fix for SF bug #2840994


type: ci
user: wiede
comment:
  fixed bug which prevented correct error reporting when there was a problem
  when creating an object, also fixed to use correct NRE calling


type: ci
user: wiede
comment:
  if during call of constructor, when building an object there were multiple
  recursive calls on CallItclObjectCmd and errors have not been propagated. Now
  hadConstructorError field in ItclObject struct is used for that purpose.


type: ci
user: wiede
comment:
  undo initializing startClsPtr, is initialized from caller and makes
  problems, if initialized a second time.


type: ci
user: wiede
comment:
  again a place where a constructor error was not reported.
  allow call of delegated methods in constructor for ::itcl::extendedclass


type: ci
user: wiede
comment:
  call ItclInitExtendedClassOptions a second time after construtor call
  only for extendedclass relevant


type: ci
user: wiede
comment:
  iintegrated patches prepared  by Reinhard Max and a fix for info complete also reported by Reinhard Max


type: ci
user: dgp
comment:
          * itclTclIntStubsFcn.c: Remove attempt to return value from
                                  Itcl_ResetRewriteEnsemle() which is declared
                                  as returning (void).  Thanks to Andreas
                                  Kupried for reporting the compiler errors.


type: ci
user: dgp
comment:
          * itclInt.h:            Add #ifdef guards to attempt inclusion of
                                  a unistd.h header file only where one exists.


type: ci
user: wiede
comment:
  fixes for incr tcl bug #2983809 and better error message for cases like:
  use of public mthod ... instead of public method ... etc.


type: ci
user: msofer
ecomment:
  	* itcl/generic/itcl2TclOO.c (Itcl_NRRunCallbacks):
  	Tcl's [Patch 3072080] (a saner NRE): TclNRRunCallbacks lost one
  	argument.

comment:
  	* itcl/generic/itcl2TclOO.c (Itcl_NRRunCallbacks):
  	Tcl's [Patch 3072080] (a saner NRE): TclNRRunCallbacks lost one
  	argument.


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  Restore compatibility with the latest TEA 3.9 revisions.
  Make ensemble-1.11 test flexible enough to pass with Tcl 8.4 and 8.5.


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  3357720 - Prevent body sharing of the "initialization code" of constructors.
  This satisfies the requirements of TclProcCompileProc.  Failure to do that
  has been making tests chain-2.* fail in Tcl 8.6 interps.


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  Add protection in package index script to prevent [package require Itcl]
  from attempting to [load] into a Tcl interp that has Tcl version too old
  for Itcl_Init() to accept.


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  3358283 Rewrite of trickery needed to support Tcl changes to its internal
  *CallFrame structs from version to version.


type: ci
user: jan.nijtmans
comment:
  Make stub table symbols and pointers const
  Remove Itcl_(Safe)Init from Stub table
  Remove unnecessary includes, and consistent use of include <file> resp include "file"


type: ci
bgcolor: #c0c0f0
user: jan.nijtmans
comment:
  Fix for bug [ incrtcl-Bugs-3398008 ] incrtcl-Bugs-3398008 Seg. fault accessing itcl var. which name is a proc


type: t
user: wiede
brief: Fixed ticket [36577626c340ad59|36577626c3].
comment:
  Fixed ticket [36577626c340ad59|36577626c3]: <i>can not create objects inside class namespace</i> plus 3 other changes


type: ci
user: arnulf
comment:
  Fix for allowing access to protected class variables not only from top level context.
  Reported by rene zaumseil for his itk emulation.


type: t
user: wiede
brief: Fixed ticket [d4ee728817f951d0|d4ee728817].
comment:
  Fixed ticket [d4ee728817f951d0|d4ee728817]: <i>Problems on info command from inside itcl code</i> plus 3 other changes


type: t
user: wiede
brief: Ticket [5775d7979aba9a76|5775d7979a]: 3 changes
comment:
  Ticket [5775d7979aba9a76|5775d7979a] <i>IWidget dateentry Calender appears off screen</i> status still Open with 3 other changes


type: ci
user: arnulf
comment:
  make the info command call in clazzUnknownBody a list to avoid problems with class names
  containing spaces


type: ci
bgcolor: #c0c0f0
user: andreask
ecomment:
  Fix heap corruption when an itcl method or proc is replaced by a Tcl proc, by nulling the reference to the removed itcl access command instead of leaving a dangling pointer behind.

comment:
  Fix heap corruption when an itcl method or proc is replaced by a Tcl proc, by nulling the refeence to the removed itcl access command instead of leaving a dangling pointer behind.


type: ci
user: jan.nijtmans
comment:
  remove macro, which would prevent Itcl-extensions (like Itk/Iwidgets) to run with any other Itcl version. This was meant only for the Beta period.


type: t
user: arnulf
brief: Ticket [900dc81e3a567bae|900dc81e3a]: 3 changes
comment:
  Ticket [900dc81e3a567bae|900dc81e3a] <i>itcl chain does not work</i> status still Open with 3 other changes


type: ci
user: jan.nijtmans
comment:
  update to latest TEA (configure script not re-generated yet). 
  Eliminate deprecated Tcl_DStringTrunc calls.


type: ci
user: jan.nijtmans
comment:
  Add support for UnixWare in itclWidgets.
  Don't let itclWidgets 4.0.0 depend on Itcl 4.0.1 only, it should work with Itcl 4.0.0 too.
  In pkgIndex.tcl, check for Tcl8.6/Tk8.6/Itcl4.0 before trying to load itclWidgets shared library.


type: ci
user: dgp
comment:
  Fix remaining segfaults.  Now the lingering question is whether these
  changes have created (new) memory leaks?


type: ci
user: dgp
comment:
  Work in progress tracking down lifetime management issues with
  ProcedureMethods, etc as used by Itcl.


type: ci
user: dgp
comment:
  Add Preserve/Release protections so that ItclFreeClass isn't called before
  the needs of ItclDeleteFunction are satisfied.  Stops many of the segfaults
  observed in a mem-debug build.


type: ci
user: arnulf
comment:
  Removed unused code, added some code for BiInitOptionsCmd also that code seems to be no
  longer used instead a Tcl implementation of that code is used at least on some places.


type: ci
user: jan.nijtmans
comment:
  Add functions to the (internal) stub table which are used in itclWidgets: First step to make itclWidgets compilable using stubs.


type: ci
user: arnulf
comment:
  changed code to avoid some compiler warnings. Added code for extendedclass variable itcl_option_components.


type: ci
user: arnulf
comment:
  Changed code to avoid some compiler warnings.
  Added code for extendedclass variable itcl_option_components.


type: ci
user: arnulf
comment:
  Fixes for compiler warnings. Added 3 internal builtin commands addoptioncomponent,
  removeoptioncomponent, renameoptioncomponent for extendedclass.


type: ci
user: arnulf
comment:
  Fixes for compiler warnings. Added 3 internal  builtin commands addoptioncomponent,
  removeoptioncomponent, renameoptioncomponent for extendedclass.


type: ci
user: arnulf
comment:
  renaming of removecomponentoption to ignorekomponentoption, removing of addcomponentoption
  move code for keepcomponentoption from itclBuiltin.c as Tcl code to itclHullCmds.tcl.


type: ci
user: arnulf
comment:
  moved keepcomponentoption from itclBuiltin.c to here as Tcl code. renaming of removecomponentoption to ignorekomponentoption


type: ci
user: jan.nijtmans
comment:
  Call the public function Itcl_GetInstanceVar() in stead of the private ItclGetInstanceVar() everywhere, as the latter is not exported from Itcl's stub table


type: t
user: jan.nijtmans
brief: New ticket [91511d630dfc41e8|91511d630d].
comment:
  New ticket [91511d630dfc41e8|91511d630d] <i>Itcl 4.0 compiled with Tcl 8.6.1 headers doesn&#39;t run in Tcl8.6.0</i>.


type: ci
user: jan.nijtmans
comment:
  Workaround for [http://sourceforge.net/p/mingw/bugs/2065/|MinGW bug #2065]: "gcc --shared" links with libgcc_s_dw2-1.dll when using 64-bit division in C


type: t
user: jan.nijtmans
brief: Closed ticket [91511d630dfc41e8|91511d630d].
comment:
  Closed ticket [91511d630dfc41e8|91511d630d]: <i>Itcl 4.0 compiled with Tcl 8.6.1 headers doesn&#39;t run in Tcl8.6.0</i> plus 5 other changes


type: ci
user: jan.nijtmans
ecomment:
  Update to latest TEA.
  Eliminate use of EXTERN and TCL_STORAGE_CLASS: A tiny step directed at making Itcl compile/run with "novem" (not complete yet)

comment:
  Update to latest TEA.
  Eliminate use of EXTERN and TCL_STORAGE_CLASS: A tiny step directed at maing Itcl compile/run with "novem" (not complete yet)


type: t
user: jan.nijtmans
brief: Ticket [9a1bd507bd25a28c|9a1bd507bd]: 7 changes
comment:
  Ticket [9a1bd507bd25a28c|9a1bd507bd] <i>Itcl built with --disable-shared is broken</i> status still Open with 7 other changes


type: t
user: jan.nijtmans
brief: Closed ticket [9a1bd507bd25a28c|9a1bd507bd].
comment:
  Closed ticket [9a1bd507bd25a28c|9a1bd507bd]: <i>Itcl built with --disable-shared is broken</i> plus 3 other changes


type: t
user: jan.nijtmans
brief: Ticket [9a1bd507bd25a28c|9a1bd507bd]: 3 changes
comment:
  Ticket [9a1bd507bd25a28c|9a1bd507bd] <i>Itcl built with --disable-shared is broken</i> status still Closed with 3 other changes


type: ci
user: jan.nijtmans
comment:
  Fix [http://core.tcl.tk/tcl/info/426679ef7d|426679ef7d]: Having man.macros after .TH breaks rendering on OpenBSD and possibly others.


type: ci
user: jan.nijtmans
comment:
  Make itclStubsPtr and itclIntStubsPtr in the Itcl stub-library MODULE_SCOPE, so they will not be re-exported when linked into a DLL.


type: ci
user: jan.nijtmans
comment:
  Put extern "C" guard around stub table definition: In C++, calling convention on functions through function pointers might be influcenced by that. See for example: [http://en.wikipedia.org/wiki/Compatibility_of_C_and_C++]
  On SUN's C++ compiler this might generate the warning:  Warning (Anachronism): Formal argument fn_ptr of type ..... in call to ... is being passed ....


type: t
user: wiede
brief: Closed ticket [36577626c340ad59|36577626c3].
comment:
  Closed ticket [36577626c340ad59|36577626c3]: <i>can not create objects inside class namespace</i> plus 3 other changes


type: t
user: wiede
brief: Closed ticket [d4ee728817f951d0|d4ee728817].
comment:
  Closed ticket [d4ee728817f951d0|d4ee728817]: <i>Problems on info command from inside itcl code</i> plus 3 other changes


type: t
user: wiede
brief: Closed ticket [5775d7979aba9a76|5775d7979a].
comment:
  Closed ticket [5775d7979aba9a76|5775d7979a]: <i>IWidget dateentry Calender appears off screen</i> plus 4 other changes


type: ci
user: jan.nijtmans
comment:
  Use Tcl_EvalEx() in stead of Tcl_Eval(). See: [http://core.tcl.tk/tcl/artifact/35f1f7e18a?ln=137-140]


type: ci
user: jan.nijtmans
comment:
  Allow (dummy) --enable-64bit on Cygwin64. Add --enable-threads (defaults to TRUE with Tcl 8.6 anyway)


type: ci
user: jan.nijtmans
comment:
  Revert [bb07fc6f1f408356], it causes crashes (bisected it, the result was this commit! No idea why! Help!). 
  With this revert all test-cases pass again, but I don't know the code good enough to judge what's really going on here.


type: ci
user: jan.nijtmans
comment:
  fix for SF bug #249: itclIntStubsPtr' : 'int' differs in levels of indirection from 'const ItclIntStubs *


type: ci
user: arnulf
comment:
  use different trace handlers for this, win, type, self and selfns.
  Therefor a lot of additional code and some fixes.


type: ci
user: dgp
comment:
  [SF Bug 261] Fix the new bug introduced by the commit made to fix Bug 244.
  Fix is achieved by backing out essentially all of that commit.  Other changes
  to Itcl since then have apparently fixed Bug 244 more properly without this
  additional damage.


type: ci
user: arnulf
comment:
  Added itclTestRegisterC.c its code is only included, if ITCL_DEBUG_C_INTERFACE is defined in Makefile!


type: t
user: arnulf
brief: Fixed ticket [2cd667f270b68ef6|2cd667f270].
comment:
  Fixed ticket [2cd667f270b68ef6|2cd667f270]: <i>SIGSEGV on invocation of private method</i> plus 5 other changes


type: ci
user: dgp
comment:
  Completely different fix for SF bug #243 that has the benefit of not
  completely breaking Itk and Iwidgets. :)


type: ci
user: dgp
comment:
  Restrict the workaround for TclOO 1.0.2 bug to only be used when it's
  detected we're actually working with TclOO 1.0.2.  Otherwise, use of
  the workaround when unwarranted leads to a mem leak.


type: t
user: dgp
brief: Ticket [be0a32b240c7e370|be0a32b240]: 5 changes
comment:
  Ticket [be0a32b240c7e370|be0a32b240] <i>myEnsembles hash table entries memleak</i> status still Open with 5 other changes


type: t
user: aku
brief: Ticket [be0a32b240c7e370|be0a32b240]: 3 changes
comment:
  Ticket [be0a32b240c7e370|be0a32b240] <i>myEnsembles hash table entries memleak</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [be0a32b240c7e370|be0a32b240].
comment:
  Closed ticket [be0a32b240c7e370|be0a32b240]: <i>myEnsembles hash table entries memleak</i> plus 3 other changes


type: t
user: dgp
brief: Ticket [be0a32b240c7e370|be0a32b240]: 3 changes
comment:
  Ticket [be0a32b240c7e370|be0a32b240] <i>myEnsembles hash table entries memleak</i> status still Closed with 3 other changes


type: ci
user: dgp
comment:
  Revised the new fix for bug 243 to something gentler and less potentially
  far-reaching.  Testing desired.


type: t
user: dgp
brief: Ticket [82f8d1c0d899793a|82f8d1c0d8]: 5 changes
comment:
  Ticket [82f8d1c0d899793a|82f8d1c0d8] <i>Itcl commit 0d11f378d8 breaks iwidgets</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [82f8d1c0d899793a|82f8d1c0d8]: 3 changes
comment:
  Ticket [82f8d1c0d899793a|82f8d1c0d8] <i>Itcl commit 0d11f378d8 breaks iwidgets</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [82f8d1c0d899793a|82f8d1c0d8].
comment:
  Closed ticket [82f8d1c0d899793a|82f8d1c0d8]: <i>Itcl commit 0d11f378d8 breaks iwidgets</i> plus 4 other changes


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  This patch fixes Bug e773fdd793 by revising the Itcl_ScopedVarResolver() so
  that it no longer finds variables that are in objects in the midst of tearing
  themselves apart.  This stops the segfault in the demo script, and seems more
  sensible, but I can have no idea who out there has code that this might break.


type: t
user: apnadkarni
brief: New ticket [a956a5d397c82977|a956a5d397].
comment:
  New ticket [a956a5d397c82977|a956a5d397] <i>info heritage returns class list based on where method is defined as opposed to object class</i>.


type: t
user: apnadkarni
brief: Ticket [a956a5d397c82977|a956a5d397]: 5 changes
comment:
  Ticket [a956a5d397c82977|a956a5d397] <i>info heritage returns class list based on where method is defined as opposed to object class</i> status still Open with 5 other changes


type: t
user: apnadkarni
brief: Ticket [a956a5d397c82977|a956a5d397]: 3 changes
comment:
  Ticket [a956a5d397c82977|a956a5d397] <i>info heritage returns class list based on where method is defined as opposed to object class</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [b062aa6a7faf53fc|b062aa6a7f].
comment:
  Closed ticket [b062aa6a7faf53fc|b062aa6a7f]: <i>compiler warning - uninitialized variable use</i> plus 5 other changes


type: t
user: dgp
brief: Closed ticket [2cd667f270b68ef6|2cd667f270].
comment:
  Closed ticket [2cd667f270b68ef6|2cd667f270]: <i>SIGSEGV on invocation of private method</i> plus 2 other changes


type: t
user: dgp
brief: Ticket [e773fdd7939b1f64|e773fdd793]: 5 changes
comment:
  Ticket [e773fdd7939b1f64|e773fdd793] <i>segfault in var traces</i> status still Open with 5 other changes


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  [e773fdd793] Don't resolve instance variable names in instances that are
  being torn down.  Solve segfault when unset variable traces bring back
  instances variables and traces.  Variable existence has to track with the
  data[] array lifetime.


type: ci
user: dgp
comment:
  This patch fixes the trouble reported in Bug a956a5d297.
  However it breaks tests info-4.2b, info-4.3b, inherit-4.4, and inherit-4.5.
  These tests are unchange from Itcl 3, so they ought to pass.  The new
  challenge is how to fix the cases covered by these tests without rebreaking
  the demos in the bug report.


type: t
user: dgp
brief: Closed ticket [283e5603a589f10c|283e5603a5].
comment:
  Closed ticket [283e5603a589f10c|283e5603a5]: <i>SF Tracker Bug 240 - protect-2.5 segfault</i> plus 4 other changes


type: t
user: dgp
brief: Closed ticket [e7aca0e4ceaa46f9|e7aca0e4ce].
comment:
  Closed ticket [e7aca0e4ceaa46f9|e7aca0e4ce]: <i>mem leak in Itcl_DecodeScopedCommand</i> plus 5 other changes


type: ci
user: dgp
comment:
  Approximate fix for [a956a5d397].  To remain consistent with Itcl 3 behavior
  of the "info" method, we have to distinguish the direct [info ...] calls
  from the [$obj info ...] calls, at least in the heritage and inherit
  subcommands.  In Itcl 4, the direct [info ...] calls get auto-transformed
  into [my info ...], so the temp approx fix is to check whether the command
  name is "my".  That will produce wrong results when literal [my info ...]
  code is written, I think.  Need a different signal to discriminate the cases.


type: t
user: dgp
brief: Closed ticket [a956a5d397c82977|a956a5d397].
comment:
  Closed ticket [a956a5d397c82977|a956a5d397]: <i>info heritage returns class list based on where method is defined as opposed to object class</i> plus 4 other changes


type: t
user: dgp
brief: Ticket [427ff95a382b394a|427ff95a38]: 5 changes
comment:
  Ticket [427ff95a382b394a|427ff95a38] <i>[namespace which] crashes Itcl 3.4</i> status still Open with 5 other changes


type: t
user: aku
brief: Ticket [427ff95a382b394a|427ff95a38]: 3 changes
comment:
  Ticket [427ff95a382b394a|427ff95a38] <i>[namespace which] crashes Itcl 3.4 (against Tcl trunk, i.e. 8.6+)</i> status still Open with 3 other changes


type: t
user: dgp
brief: Ticket [427ff95a382b394a|427ff95a38]: 3 changes
comment:
  Ticket [427ff95a382b394a|427ff95a38] <i>[namespace which] crashes Itcl 3.4.2 (against Tcl 8.5+)</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [427ff95a382b394a|427ff95a38].
comment:
  Closed ticket [427ff95a382b394a|427ff95a38]: <i>[namespace which] crashes Itcl 3.4.2 (against Tcl 8.5+)</i> plus 3 other changes


type: t
user: dgp
brief: New ticket [04470f9067064056|04470f9067].
comment:
  New ticket [04470f9067064056|04470f9067] <i>Itcl 4 object creation disastrously slower than Itcl 3</i>.


type: t
user: dgp
brief: Ticket [04470f9067064056|04470f9067]: 5 changes
comment:
  Ticket [04470f9067064056|04470f9067] <i>Itcl 4 object creation disastrously slower than Itcl 3</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [04470f9067064056|04470f9067]: 3 changes
comment:
  Ticket [04470f9067064056|04470f9067] <i>Itcl 4 object creation disastrously slower than Itcl 3</i> status still Open with 3 other changes


type: t
user: dgp
brief: Ticket [2e0e27de5f131a7c|2e0e27de5f]: 5 changes
comment:
  Ticket [2e0e27de5f131a7c|2e0e27de5f] <i>init statement of constructor gives a seg fault</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [2e0e27de5f131a7c|2e0e27de5f]: 3 changes
comment:
  Ticket [2e0e27de5f131a7c|2e0e27de5f] <i>init statement of constructor gives a seg fault</i> status still Open with 3 other changes


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  [2e0e27de5f] Test and fix for segfault in constructor init statements
  when using Tcl 8.6.  Itcl's intrusions into Tcl privates have to keep
  up to date.  It's a lie, but it works.


type: t
user: dgp
brief: Closed ticket [413fa18981fe2ff9|413fa18981].
comment:
  Closed ticket [413fa18981fe2ff9|413fa18981]: <i>itcl/itk windows native build</i> plus 5 other changes


type: t
user: dgp
brief: New ticket [ec215db90132f2d5|ec215db901].
comment:
  New ticket [ec215db90132f2d5|ec215db901] <i>constructor init statement and body should share scope ?</i>.


type: t
user: dgp
brief: Closed ticket [2e0e27de5f131a7c|2e0e27de5f].
comment:
  Closed ticket [2e0e27de5f131a7c|2e0e27de5f]: <i>init statement of constructor gives a seg fault</i> plus 4 other changes


type: t
user: dgp
brief: Ticket [ec215db90132f2d5|ec215db901]: 5 changes
comment:
  Ticket [ec215db90132f2d5|ec215db901] <i>constructor init statement and body should share scope ?</i> status still Open with 5 other changes


type: ci
user: dgp
comment:
  [04470f9067] Stop running a [find classes] for every object creation.
  Stop duplication and simplify namespace wrangling.
  Check command existence with [namespace which], *not* [info command].


type: ci
user: dgp
comment:
  Demo of the enormous object creation performance gains created
  when every object creation doesn't call on [itcl::find].


type: ci
user: dgp
comment:
  First conversion away from Itcl_Preserve/ReleaseData in favor of per-struct
  refCounting.  Should avoid pointless mutexing and linear searches.


type: t
user: dgp
brief: Closed ticket [04470f9067064056|04470f9067].
comment:
  Closed ticket [04470f9067064056|04470f9067]: <i>Itcl 4 object creation disastrously slower than Itcl 3</i> plus 4 other changes


type: t
user: dgp
brief: Closed ticket [bea5cd55b9d722a4|bea5cd55b9].
comment:
  Closed ticket [bea5cd55b9d722a4|bea5cd55b9]: <i>improper [eval] of cmd Name lurking</i> plus 5 other changes


type: ci
user: jan.nijtmans
comment:
  Fix [490ab8cfdc915a998e81c2a94249766216605a2e|490ab8cfdc91]: Itcl_RegisterC() passes wrong objc to called command.


type: t
user: jan.nijtmans
brief: Ticket [13f194d0616662c8|13f194d061]: 5 changes
comment:
  Ticket [13f194d0616662c8|13f194d061] <i>shared library symbols not exported</i> status still Open with 5 other changes


type: t
user: ralfixx
brief: Ticket [13f194d0616662c8|13f194d061]: 3 changes
comment:
  Ticket [13f194d0616662c8|13f194d061] <i>shared library symbols not exported</i> status still Open with 3 other changes


type: t
user: ralfixx
brief: New ticket [490ab8cfdc915a99|490ab8cfdc].
comment:
  New ticket [490ab8cfdc915a99|490ab8cfdc] <i>Itcl_RegisterC() passes wrong objc to called command</i>.


type: t
user: jan.nijtmans
brief: Closed ticket [13f194d0616662c8|13f194d061].
comment:
  Closed ticket [13f194d0616662c8|13f194d061]: <i>shared library symbols not exported</i> plus 4 other changes


type: ci
user: dgp
comment:
  Truly ugly hackery to work around crash brought on with Itk/Iwidgets.
  Still seeking better answers, but this appears effective.


type: t
user: jan.nijtmans
brief: Closed ticket [490ab8cfdc915a99|490ab8cfdc].
comment:
  Closed ticket [490ab8cfdc915a99|490ab8cfdc]: <i>Itcl_RegisterC() passes wrong objc to called command</i> plus 5 other changes


type: ci
user: dgp
comment:
  Segfault appears to occur because Itcl's resolvers are not attached to
  the namespace of the TclOO object.  Commit correction to that.  Not confident,
  and the patch only stops crashing; doesn't lead to correct function, so work
  committed to non-trunk branch.


type: ci
user: dgp
comment:
  Remove (buggy and ineffective) screen out of non-implemented methods.
  Don't want to do this anyway.
  Remove portion of "unknown" method handler that treats (ItclMemberFunc *)
  as (ItclDelegatedFunction *).


type: t
user: dgp
brief: Ticket [26a85fab58695323|26a85fab58]: 5 changes
comment:
  Ticket [26a85fab58695323|26a85fab58] <i>NRE support missing ([yieldto] panic)</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [26a85fab58695323|26a85fab58]: 3 changes
comment:
  Ticket [26a85fab58695323|26a85fab58] <i>NRE support missing ([yieldto] panic)</i> status still Open with 3 other changes


type: t
user: dgp
brief: Ticket [e251a4f77f5dfb59|e251a4f77f]: 5 changes
comment:
  Ticket [e251a4f77f5dfb59|e251a4f77f] <i>ItclMemberFunc flags confusion</i> status still Open with 5 other changes


type: ci
user: dgp
comment:
  Best I can tell, the condition on make only an implemented method known to
  the TclOO machinery -- leaving out those with no body yet defined -- is just
  an error.  TclOO needs to know about them in order to match them up with
  the itcl::body that later defines them or to trigger auto-loading of their
  bodies.


type: t
user: dgp
brief: Closed ticket [e251a4f77f5dfb59|e251a4f77f].
comment:
  Closed ticket [e251a4f77f5dfb59|e251a4f77f]: <i>ItclMemberFunc flags confusion</i> plus 4 other changes


type: t
user: dgp
brief: New ticket [d07590ce7dd0138c|d07590ce7d].
comment:
  New ticket [d07590ce7dd0138c|d07590ce7d] <i>segfault with tailcall and coroutines and Itcl method calls</i>.


type: t
user: dgp
brief: Ticket [d07590ce7dd0138c|d07590ce7d]: 5 changes
comment:
  Ticket [d07590ce7dd0138c|d07590ce7d] <i>segfault with tailcall and coroutines and Itcl method calls</i> status still Open with 5 other changes


type: ci
user: dgp
comment:
  Fix the "unknown" method of Itcl classes so that it is more selective,
  enabling the C++ declaration inspired syntax [$class $instance] without
  taking lots of missteps in the presence of unknown methods as well.
  Patch takes significant effort to preserve error messages, even when in
  my judgment they are sub-par, and better ones would be simpler, just for
  sake of compatibility.  This patch leaves test import-2.5 failing due
  to another bug [f3a2e7407c].


type: t
user: dgp
brief: Ticket [5ea6971709bc83c5|5ea6971709]: 5 changes
comment:
  Ticket [5ea6971709bc83c5|5ea6971709] <i>FinalizeCreateObject WTF?</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [5ea6971709bc83c5|5ea6971709]: 3 changes
comment:
  Ticket [5ea6971709bc83c5|5ea6971709] <i>FinalizeCreateObject WTF?</i> status still Open with 3 other changes


type: t
user: dgp
brief: Ticket [f3a2e7407cac8330|f3a2e7407c]: 5 changes
comment:
  Ticket [f3a2e7407cac8330|f3a2e7407c] <i>same name namespace breaks [itcl::is class]</i> status still Open with 5 other changes


type: ci
user: dgp
comment:
  The code to enable overwriting in the auto_import stub mechanism was too
  narrowly tailored to test import-2.5.  Added import-2.6 to demo and then
  made fix.


type: t
user: dgp
brief: Ticket [f3a2e7407cac8330|f3a2e7407c]: 3 changes
comment:
  Ticket [f3a2e7407cac8330|f3a2e7407c] <i>same name namespace breaks [itcl::is class]</i> status still Open with 3 other changes


type: ci
user: dgp
comment:
  Remove pointless legacy hashtable scan.

  In the beginning, items were not removed from the hash table on class teardown.
  Memory leaked.  It was bad.

  Then a dumb solution was added.  On each class destruction, scan the whole
  table looking for the class value stored in it, and remove what's found.

  Later the right answer was added.  Use the info about the class being destroyed,
  to lookup just the hash table entry that matters and remove that.

  But the dumb solution remained.  We kept scanning a hash table, looking
  for something that now we never find, because the right solution has already
  removed it.

  Until today.  Now finally the pointless dumb solution code is removed.

  This is the tale of the "namespaceClasses" table.  That's all I'm looking
  at today.  I presume very similar tales still lurk seeking their happy
  endings.


type: ci
user: dgp
comment:
  [5885edb242] Fix the "unknown" method of Itcl classes so that it is more selective, enabling the C++ declaration inspired syntax [$class $instance] without taking lots of missteps in the presence of unknown methods as well.


type: ci
user: dgp
comment:
  Replace the Preserve/ReleaseData management of (ItclClass *) values with
  a system of refcounting using a field in the struct itself.  With this new
  system remove those Preserve/Release operations not actually needed and in
  some cases not properly balanced.


type: ci
user: dgp
comment:
  [f3a2e7407c] Stop asking TclOO to have a new object use the class namespace
  of its class.  TclOO will not do this.  Going though the motion of asking just
  adds confusion.


type: t
user: dgp
brief: Ticket [2cd667f270b68ef6|2cd667f270]: 6 changes
comment:
  Ticket [2cd667f270b68ef6|2cd667f270] <i>private method name blocks instance name</i> status still Closed with 6 other changes


type: t
user: dgp
brief: Ticket [2cd667f270b68ef6|2cd667f270]: 3 changes
comment:
  Ticket [2cd667f270b68ef6|2cd667f270] <i>private method name blocks instance name</i> status still Closed with 3 other changes


type: ci
user: dgp
comment:
  We have a namespace lookup table.  Use it!  Don't scan and string-match
  over the table for class name lookups, assuming naming conventions.


type: t
user: dgp
brief: Ticket [f3a2e7407cac8330|f3a2e7407c]: 4 changes
comment:
  Ticket [f3a2e7407cac8330|f3a2e7407c] <i>same name namespace breaks class functioning</i> status still Open with 4 other changes


type: t
user: dgp
brief: Ticket [f3a2e7407cac8330|f3a2e7407c]: 3 changes
comment:
  Ticket [f3a2e7407cac8330|f3a2e7407c] <i>same name namespace breaks class functioning</i> status still Open with 3 other changes


type: ci
user: dgp
comment:
  Use metadata destruction callbacks to make sure both Itcl Class namespaces
  are removed from tables and torn down when two are forced to exist.


type: ci
user: dgp
comment:
  Stop Itcl extensions to [info args] breaking the original function.
  Commited to a branch for now, for a few reasons.
  1) Two tests fail due to changed error messages.  Have to consider
     relative merits.
  2) Could not merge forward the implementation from Itcl 3 because
     Itcl 4 is admirably intruding less into the Tcl internals.  This
     means a Tcl_Eval() fallback implementation, which suggests that
     a rewrite might be even better.


type: ci
user: dgp
comment:
  If we use namespace deletion callbacks, there's no need for phony commands
  like [__this] just for signalling.


type: ci
user: dgp
comment:
  Use our own namespace to class lookup table to determine access permissions.
  This takes away a dependence on an internal detail of how TclOO makes use
  of namespaces.


type: ci
bgcolor: #c0c0f0
user: dgp
comment:
  [SF 274] Don't let var resolver return variables never allocated.
  Segfault discovered chasing another bug.


type: ci
user: dgp
comment:
  Creation and routing through subcommand [::info itclinfo] serves no apparent
  purpose, and adds a layer of complexity and confusion.  Remove.


type: t
user: dgp
brief: Open ticket [2cd667f270b68ef6|2cd667f270].
comment:
  Open ticket [2cd667f270b68ef6|2cd667f270]: <i>private method name blocks instance name</i> plus 2 other changes


type: ci
user: dgp
comment:
  Re-implement the builtin [info] method with a direct route to the C
  implementation (Tcl_ObjCmdProc) of the itcl::builtin::Info ensemble.
  This avoids the proc-like method wrapping, which is what brought about
  the need for a [tailcall] to get the fallback frame correct.

  Now tests fail, because portions of the itcl::builtin::Info ensemble were
  written to account for the wrapped environment.  That needs correcting, but
  the final result should be better.


type: ci
user: dgp
comment:
  Prevent the class command resolver from acting on "info" so that
  itcl::class C {}
  itcl::class D {inherit C}
  namespace eval D namespace which info

  resolves to D::info and not to C::info.  This is needed so that
  [info class] has the right context to deliver the right answer.

  Also revised [info class] to the new non-proc-wrapped environment.


type: ci
user: dgp
comment:
  Scratch work commit.  Needs a lot of cleanup and commentary, but it
  proves the concept.  A major reworking of the "info" method support.
  Arrange for every Itcl class to have its own info method, rather than
  inheriting one from the base class.  This give each info call the context
  needed to return class-specific results reliably.  With that in place
  huge tracts of code complexity just fall away.


type: ci
user: dgp
comment:
  Must save and restore namespace around method invocation when a C implemented
  body is a possibility.


type: ci
user: dgp
comment:
  Some more cleanup plus mega-correction of broken error messages and
  mega-updating of relentless stringified result setting.  This ain't 1998 no more!


type: ci
user: dgp
comment:
  The [info] and [info::delegated] commands are implemented as Tcl ensembles.
  They are no longer Itcl ensembles.  They no longer make use of the @error
  mechanism, so there's no need to keep around the support for it.


type: ci
user: dgp
comment:
  Make sure method protection handles all class namespaces.
  Make sure builtin commands are imported into all class namespaces.
  Use the namespace to class map.


type: ci
user: dgp
comment:
  [f3a2e7407c] Reworkings so that Itcl classes stop completely failing when
  they are created over top of existing namespaces.


type: t
user: dgp
brief: Closed ticket [f3a2e7407cac8330|f3a2e7407c].
comment:
  Closed ticket [f3a2e7407cac8330|f3a2e7407c]: <i>same name namespace breaks class functioning</i> plus 4 other changes


type: ci
user: dgp
comment:
  Use a wrapping command around the itcl::builtin::Info ensemble so that
  we can get the verbose usage message we want when no subcommand argument
  is passed.  Works around failure of Tcl to implement RFE 1773103 at least
  for the builtin info command.


type: ci
user: dgp
comment:
  Stop the resolvers directly accessing the contextStack.  Use Itcl_GetContext().
  This brings back SF Bug 163 (born 2495261) -- and now there's a test for
  it in place that predictably fails.  The idea is that now we can fix
  Itcl_GetContext() to properly get its context from frames and not from an
  improvised stack that fails to properly represent changing contexts in
  the presence of both upvar and coroutines.


type: ci
user: dgp
comment:
  Reworked the Itcl context tracking so that it keys off CallFrame's and does
  not rely on a single interp-wide auxilliary stack, "contextStack", which 
  cannot get upvar and coroutine contexts right.  This re-fixes SF Bug 163
  and also fixes several of the problems noted in [26a85fab58].


type: ci
user: dgp
comment:
  Stop hiding current namespace context from C-coded method implementations.
  Use Itcl_GetContext to get Itcl context without mangling current namespace.
  Paves way to eliminate huge tracts of unnecessary uplevel shenanigans.


type: t
user: griffin
brief: New ticket [f8296373502df065|f829637350].
comment:
  New ticket [f8296373502df065|f829637350] <i>itcl::ensemble command overwrites Tk option command.</i>.


type: t
user: griffin
comment:
  Add attachment [/artifact/d463911669b0d55a|itcl_ensemble_option.patch] to ticket [f8296373502df065|f829637350]


type: t
user: dgp
brief: Ticket [f8296373502df065|f829637350]: 5 changes
comment:
  Ticket [f8296373502df065|f829637350] <i>itcl::ensemble command overwrites Tk option command.</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [f8296373502df065|f829637350]: 3 changes
comment:
  Ticket [f8296373502df065|f829637350] <i>itcl::ensemble command overwrites Tk option command.</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [f8296373502df065|f829637350].
comment:
  Closed ticket [f8296373502df065|f829637350]: <i>itcl::ensemble command overwrites Tk option command.</i> plus 4 other changes


type: ci
user: dgp
comment:
  [SF 265] First step fixing unworkable model for mapping instance variables
  to namespace variables. At least use FQ names.


type: t
user: dgp
brief: Ticket [abeae90b4c3c1a30|abeae90b4c]: 5 changes
comment:
  Ticket [abeae90b4c3c1a30|abeae90b4c] <i>itcl::widget basics lead to segfault</i> status still Open with 5 other changes


type: t
user: wish72
brief: New ticket [31ae36593fb081b1|31ae36593f].
comment:
  New ticket [31ae36593fb081b1|31ae36593f] <i>protected destructor in slave interpreter causes signal Aborted</i>.


type: t
user: ferrieux
brief: Ticket [31ae36593fb081b1|31ae36593f]: 5 changes
comment:
  Ticket [31ae36593fb081b1|31ae36593f] <i>protected destructor in slave interpreter causes signal Aborted</i> status still Open with 5 other changes


type: t
user: wish72
brief: Ticket [31ae36593fb081b1|31ae36593f]: 3 changes
comment:
  Ticket [31ae36593fb081b1|31ae36593f] <i>protected destructor in slave interpreter causes signal Aborted</i> status still Open with 3 other changes


type: t
user: dgp
brief: Ticket [7e3db761c905f6b6|7e3db761c9]: 5 changes
comment:
  Ticket [7e3db761c905f6b6|7e3db761c9] <i>double free/decrement in generic/itclObject.c</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [abeae90b4c3c1a30|abeae90b4c]: 3 changes
comment:
  Ticket [abeae90b4c3c1a30|abeae90b4c] <i>itcl::widget basics lead to segfault</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [31ae36593fb081b1|31ae36593f].
comment:
  Closed ticket [31ae36593fb081b1|31ae36593f]: <i>protected destructor in slave interpreter causes signal Aborted</i> plus 4 other changes


type: t
user: rlehfeld
brief: Ticket [7e3db761c905f6b6|7e3db761c9]: 3 changes
comment:
  Ticket [7e3db761c905f6b6|7e3db761c9] <i>double free/decrement in generic/itclObject.c</i> status still Open with 3 other changes


type: ci
user: dgp
comment:
  [abeae90b4c] Error in Itcl_ClassVarResolver where carelessness in repeated
  use of the "hPtr" variable led to an (ItclVarLookup *) getting used as
  a (Tcl_Var *), with the expected crash resulting.


type: t
user: dgp
brief: Closed ticket [7e3db761c905f6b6|7e3db761c9].
comment:
  Closed ticket [7e3db761c905f6b6|7e3db761c9]: <i>double free/decrement in generic/itclObject.c</i> plus 4 other changes


type: t
user: dgp
brief: Closed ticket [abeae90b4c3c1a30|abeae90b4c].
comment:
  Closed ticket [abeae90b4c3c1a30|abeae90b4c]: <i>itcl::widget basics lead to segfault</i> plus 4 other changes


type: ci
user: dgp
comment:
  [SF 272] At some point Tcl_InvokeClassProcedureMethod() was NRE-enabled
  without sufficient thought about what that meant regarding access to 
  stack variables.  Fixed now using dynamic allocation and a callback to free.
  It's conceivable this is too expensive a solution to stick with, and I don't
  see a reason the pmPtr->procPtr->cmdPtr isn't set and stored elsewhere for
  a longer lifetime.


type: ci
user: dgp
comment:
  [SF 270] Use fully qualified access command name to establish delete traces
  that do portions of class teardown.


type: ci
user: dgp
comment:
  [SF 273] More complete repair of the NRE-enabled memory management of
  structs associated with method invocation.


type: ci
user: dgp
comment:
  [SF 265] More complete reworking of map from (instance, class) name pairs to
  an internal namespace holding variables, taking care to use FQ names.  This
  is still very far from being a correct working system, but reduces the size
  of the failure set.  Test sfbugs-265.2 illustrates most obvious remaining bug.


type: t
user: dgp
brief: Closed ticket [a1fed9c87fe93e9a|a1fed9c87f].
comment:
  Closed ticket [a1fed9c87fe93e9a|a1fed9c87f]: <i>itcl::finish segfault (brain damage?)</i> plus 5 other changes


type: t
user: dgp
brief: Closed ticket [2cd667f270b68ef6|2cd667f270].
comment:
  Closed ticket [2cd667f270b68ef6|2cd667f270]: <i>private method name blocks instance name</i> plus 4 other changes


type: ci
user: dgp
comment:
  Restore the per-object unknown methods only where needed to override
  the unknown methods of itcl::type, etc. classes.  The proper fix is to
  get the inheritance tree right, so that these objects get their unknown
  from itcl::Root .  Come back for that later.


type: ci
user: dgp
comment:
  No longer have need for objectunknown command. Supress all callers.
  No longer need objectNames table.


type: ci
user: dgp
comment:
  [SF 265] Rework the ($object, $class) -> internal variables namespace mapping
  to eliminate conflicts.


type: t
user: dgp
brief: Ticket [1add382a7aaa6686|1add382a7a]: 5 changes
comment:
  Ticket [1add382a7aaa6686|1add382a7a] <i>widgetadaptor crash</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [1add382a7aaa6686|1add382a7a]: 3 changes
comment:
  Ticket [1add382a7aaa6686|1add382a7a] <i>New Itcl classes are untested, unused and broken and a burden</i> status still Open with 3 other changes


type: ci
user: dgp
comment:
  [SF 265] Re-fix this bug, but with less chance of breaking itcl::widget* things.
  Those are still broken in this commit since their dependence on internal
  arrangments must be ferreted out and updated.


type: ci
user: dgp
comment:
  Eliminate the objectunknown command. Replace it with an inherited unknown
  method from the new object itcl::Root.


type: ci
user: dgp
comment:
  Restore the tests for bug [SF 265]. Now to re-fix that bug in some way that
  doesn't break the itcl::widget* stuff.


type: ci
user: dgp
comment:
  Separate the object creation from assigning it its desired name.
  This lets us have the object earlier so we can do things like fetch its
  unique namespace.


type: t
user: dgp
brief: New ticket [1f76cde1a0d3cf71|1f76cde1a0].
comment:
  New ticket [1f76cde1a0d3cf71|1f76cde1a0] <i>widgetadaptor constructor error -&gt; segfault invoking destructor</i>.


type: t
user: dgp
brief: Ticket [1f76cde1a0d3cf71|1f76cde1a0]: 5 changes
comment:
  Ticket [1f76cde1a0d3cf71|1f76cde1a0] <i>widgetadaptor constructor error -&gt; segfault invoking destructor</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [1f76cde1a0d3cf71|1f76cde1a0]: 3 changes
comment:
  Ticket [1f76cde1a0d3cf71|1f76cde1a0] <i>widgetadaptor constructor error -&gt; segfault invoking destructor</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [1f76cde1a0d3cf71|1f76cde1a0].
comment:
  Closed ticket [1f76cde1a0d3cf71|1f76cde1a0]: <i>widgetadaptor constructor error -&gt; segfault invoking destructor</i> plus 4 other changes


type: ci
user: dgp
comment:
  Make sure the widgetadaptors sneak through the NS info too. revised the
  (ugly) mechanism.  Still some failing tests.


type: ci
user: dgp
comment:
  [SF 265] Re-fix this bug, but this time not breaking the widget* things.
  These new commands now rest on an additional ugly hack workaround, joining
  several others already in place. For now, functional. Beauty may come later.


type: t
user: dgp
brief: Closed ticket [1add382a7aaa6686|1add382a7a].
comment:
  Closed ticket [1add382a7aaa6686|1add382a7a]: <i>New Itcl classes are untested, unused and broken and a burden</i> plus 4 other changes


type: ci
user: dgp
comment:
  [itcl::builtin::installcomponent] was expecting [namespace current] to
  be that of the class, it appears.  At least some context where [info] would
  resolve to Itcl's builtin [info] command/method -- one with [info types]
  support.  As a quick workaround, qualify the command with the classname
  as a namespace context.  Ought to get things right.  Makes test suite happy.


type: t
user: dgp
brief: Closed ticket [d0126511d9525d15|d0126511d9].
comment:
  Closed ticket [d0126511d9525d15|d0126511d9]: <i>More internal namespace jackassery</i> plus 5 other changes


type: ci
user: dgp
ecomment:
  Eliminate the flag ITCL_CONINIT to mark the internal method used to invoke
  the constructor initialization script. Use ITCL_CONSTRUCTOR instead to get
  (nearly) the right handling.  Impact is to remove the "__constructor_init"
  method from usage messages, where an internal hack like this doesnt belong
  anywyay, and to pick up some stack trace things from the constructor.
  Further work in progress ought to take care of this.

  This change also takes "__constructor_init" off the list of results returned
  by the [info methods] method, which is also, I assert, the right thing.

comment:
  Eliminate the flag ITCL_CONINIT to mark the internal method used to invoke
  the constructor initialization script. Use ITCL_CONSTRUCTOR instead to get
  (nearly) the right handling.  Impact is to remove the "__constructor_init"
  method from usage messages, where an internal hack like this doesnt belong
  anywyay, and to pick up some stack trace things from the constructor.
  Further work in progress ought to take care of this.


type: ci
user: dgp
comment:
  The "constructor" and "destructor" fields of ItclClass are also written
  but never read, thus not truly used. Eliminate.


type: ci
user: dgp
comment:
  [ec215db901][SF 276] Rework constructor invocation. Fixes bugs. Still leaves
  some internals more exposed than I would prefer.


type: t
user: dgp
brief: Closed ticket [ec215db90132f2d5|ec215db901].
comment:
  Closed ticket [ec215db90132f2d5|ec215db901]: <i>constructor init statement and body should share scope ?</i> plus 4 other changes


type: t
user: griffin
brief: Ticket [34be19cfc57b33d6|34be19cfc5]: 5 changes
comment:
  Ticket [34be19cfc57b33d6|34be19cfc5] <i>common variable initialized as array does not work</i> status still Open with 5 other changes


type: t
user: dgp
brief: Closed ticket [34be19cfc57b33d6|34be19cfc5].
comment:
  Closed ticket [34be19cfc57b33d6|34be19cfc5]: <i>common variable initialized as array does not work</i> plus 2 other changes


type: t
user: griffin
brief: Ticket [050ac21f736d16ba|050ac21f73]: 5 changes
comment:
  Ticket [050ac21f736d16ba|050ac21f73] <i>info variable introspection gap</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [35a5baca6741b990|35a5baca67]: 5 changes
comment:
  Ticket [35a5baca6741b990|35a5baca67] <i>[chain] with no arguments does not work</i> status still Open with 5 other changes


type: t
user: dgp
brief: Closed ticket [35a5baca6741b990|35a5baca67].
comment:
  Closed ticket [35a5baca6741b990|35a5baca67]: <i>[chain] with no arguments does not work</i> plus 3 other changes


type: t
user: dgp
brief: Closed ticket [64cd96d5f902e2be|64cd96d5f9].
comment:
  Closed ticket [64cd96d5f902e2be|64cd96d5f9]: <i>namespace eval &lt;class&gt; info inherit crashes</i> plus 5 other changes


type: ci
user: dgp
comment:
  Many years back the NOTDEF macro was used to disable the effects of unset
  traces on object and class variables. See checkin [92d91879d5fb2655].
  Unfortunately the allocation of machinery to set the traces was not also
  disabled, so we were left with a memory leak.  This checkin extends the use
  of NOTDEF to disable it all the way.


type: ci
user: dgp
comment:
  With the new unique identifier, the Itcl object -> ID map is implicit in Itcl
  and TclOO machinery. No need to keep a separate hash.


type: ci
user: dgp
comment:
  While chasing a leak, came across this unique ID generator.  There's no
  need for this. Every Itcl object is also a TclOO object and every TclOO
  object already possesses a permanent unique identifier -- the fully qualified
  name of its associated namespace.


type: ci
user: dgp
comment:
  Convert the ID -> Itcl object map to a string key hash table so we no longer
  create and leak a Tcl_Obj key value for each Itcl object.


type: ci
user: dgp
comment:
  Purge all the NOTDEF sections so they no longer add confusion.
  Code history is still in code history.


type: ci
user: dgp
comment:
  Establish a system for properly preserving and releasing class common
  variables.  Prior technique of just bumping a refcount of every Itcl
  variable was creating leaks.


type: ci
user: hypnotoad
comment:
  Fixing configure. There was a typo that was preventing --disable-shared --enable-stubs 
  from being expressed properly


type: t
user: dgp
brief: Ticket [61952ca33e9e58df|61952ca33e]: 5 changes
comment:
  Ticket [61952ca33e9e58df|61952ca33e] <i>Variable name resolution incompat with Itcl 3</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [61952ca33e9e58df|61952ca33e]: 3 changes
comment:
  Ticket [61952ca33e9e58df|61952ca33e] <i>Variable name resolution incompat with Itcl 3</i> status still Open with 3 other changes


type: g
user: dgp
comment:
  Edit [16b099b68f72f3de|16b099b68f]: Move to branch [/timeline?r=dgp-method-type-fork&nd&dp=16b099b68f72f3de&unhide | dgp-method-type-fork].


type: t
user: dgp
brief: Ticket [87a89c9a927db943|87a89c9a92]: 5 changes
comment:
  Ticket [87a89c9a927db943|87a89c9a92] <i>Test &quot;sfbug-254&quot; fails for 4.0.5 on Win</i> status still Open with 5 other changes


type: t
user: dgp
brief: Closed ticket [6a814ec012daeb6c|6a814ec012].
comment:
  Closed ticket [6a814ec012daeb6c|6a814ec012]: <i>Test &quot;sfbug-257&quot; fails for win</i> plus 5 other changes


type: g
user: dgp
comment:
  Edit [9b0b7265ee17b74d|9b0b7265ee]: Move to branch [/timeline?r=mistake&nd&dp=9b0b7265ee17b74d&unhide | mistake]. Add propagating "hidden". Mark "Closed".


type: t
user: dgp
brief: New ticket [3e6d655e791b9b2c|3e6d655e79].
comment:
  New ticket [3e6d655e791b9b2c|3e6d655e79] <i>Itcl 4 no longer permits method named &quot;info&quot;</i>.


type: t
user: dgp
brief: Closed ticket [5a00faaa91ff42cf|5a00faaa91].
comment:
  Closed ticket [5a00faaa91ff42cf|5a00faaa91]: <i>Directory tclconfig missing</i> plus 5 other changes


type: t
user: dgp
brief: Ticket [e5f529da7545d2ce|e5f529da75]: 5 changes
comment:
  Ticket [e5f529da7545d2ce|e5f529da75] <i>[scope] incompatibility</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [e5f529da7545d2ce|e5f529da75]: 3 changes
comment:
  Ticket [e5f529da7545d2ce|e5f529da75] <i>[scope] incompatibility</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [3e6d655e791b9b2c|3e6d655e79].
comment:
  Closed ticket [3e6d655e791b9b2c|3e6d655e79]: <i>Itcl 4 no longer permits method named &quot;info&quot;</i> plus 5 other changes


type: t
user: anonymous
brief: New ticket [1b28657c0ed0d25e|1b28657c0e].
comment:
  New ticket [1b28657c0ed0d25e|1b28657c0e] <i>Itcl 4.05 issues tcl_panic from delegated method with snit</i>.


type: t
user: dgp
brief: Ticket [1b28657c0ed0d25e|1b28657c0e]: 5 changes
comment:
  Ticket [1b28657c0ed0d25e|1b28657c0e] <i>Itcl 4.05 issues tcl_panic from delegated method with snit</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [1b28657c0ed0d25e|1b28657c0e]: 3 changes
comment:
  Ticket [1b28657c0ed0d25e|1b28657c0e] <i>Itcl 4.05 issues tcl_panic from delegated method with snit</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [1b28657c0ed0d25e|1b28657c0e].
comment:
  Closed ticket [1b28657c0ed0d25e|1b28657c0e]: <i>Itcl 4.05 issues tcl_panic from delegated method with snit</i> plus 4 other changes


type: t
user: dgp
brief: Closed ticket [a03f579f7db89cab|a03f579f7d].
comment:
  Closed ticket [a03f579f7db89cab|a03f579f7d]: <i>[info vars] segfault in Itcl class procedure</i> plus 5 other changes


type: t
user: dgp
brief: New ticket [c45384364cc29a57|c45384364c].
comment:
  New ticket [c45384364cc29a57|c45384364c] <i>&#39;this&#39; resolution misbehaves in [uplevel]led evaluation</i>.


type: t
user: dgp
brief: Ticket [c45384364cc29a57|c45384364c]: 5 changes
comment:
  Ticket [c45384364cc29a57|c45384364c] <i>&#39;this&#39; resolution misbehaves in [uplevel]led evaluation</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [c45384364cc29a57|c45384364c]: 3 changes
comment:
  Ticket [c45384364cc29a57|c45384364c] <i>&#39;this&#39; resolution misbehaves in [uplevel]led evaluation</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [c45384364cc29a57|c45384364c].
comment:
  Closed ticket [c45384364cc29a57|c45384364c]: <i>&#39;this&#39; resolution misbehaves in [uplevel]led evaluation</i> plus 4 other changes


type: t
user: dgp
brief: New ticket [19fa152b36781ed9|19fa152b36].
comment:
  New ticket [19fa152b36781ed9|19fa152b36] <i>class with self-nullifying proc - cycling instances segfaults</i>.


type: t
user: dgp
brief: Ticket [19fa152b36781ed9|19fa152b36]: 5 changes
comment:
  Ticket [19fa152b36781ed9|19fa152b36] <i>class with self-nullifying proc - cycling instances segfaults</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [19fa152b36781ed9|19fa152b36]: 3 changes
comment:
  Ticket [19fa152b36781ed9|19fa152b36] <i>class with self-nullifying proc - cycling instances segfaults</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [19fa152b36781ed9|19fa152b36].
comment:
  Closed ticket [19fa152b36781ed9|19fa152b36]: <i>class with self-nullifying proc - cycling instances segfaults</i> plus 4 other changes


type: ci
user: dgp
comment:
  Reproduce TclOO's practice of sticking context info in the clientdata of
  the current frame.  This is needed because ItclObjectCommand goes poking
  in there expecting to find it.  One internals intrusion leads to more.
  Ugly! But for now it fixes [Itk Bug 38744a21a0].


type: ci
user: dgp
comment:
  Revert last commit and take the better approach.  Stop ItclObjectCmd from
  going poking into Tcl's areas of the CallFrame.  Use Itcl's own mechanisms
  for fetching proper context information.


type: ci
user: dgp
comment:
  Add routines to manage ItclObject context.
  Add routines to directly access instance variables.
  Revise instance variable access to agree with class resolution rules.


type: ci
bgcolor: #c0c0f0
user: jan.nijtmans
ecomment:
  Add .project file (handy for Eclipse) and resolve minor compiler warning. "configure" script still to be re-renerated, in order to fully resolve this.

  This checkin breaks the build against Tcl 8.4 headers.  I'm not fully convinced we're ready to leave that behind.

comment:
  Add .project file (handy for Eclipse) and resolve minor compiler warning. "configure" script still to be re-renerated, in order to fully resolve this.


type: ci
user: jan.nijtmans
comment:
  Incease some fields in ItclPreserveInfo from int to size_t. Only used when debugging. Also add a ".project" file, handy for Eclipse.


type: g
user: dgp
comment:
  Edit [710bb88a5a127876|710bb88a5a]: Move to branch [/timeline?r=mistake&nd&dp=710bb88a5a127876&unhide | mistake]. Add propagating "closed". Add propagating "hidden". Edit check-in comment.


type: ci
user: jan.nijtmans
comment:
  Merge novem-support: No need any more to keep a separate branch for this (As long as we don't have hardcoded "9.0"s in it)


type: ci
bgcolor: #C2FFC1
user: sebres
comment:
  fixes huge performance regression (introduced in [c7e729d15408ed4e]), replace internal mechanism of preservation facilities (Itcl_PreserveData/Itcl_ReleaseData) from Tcl_Preserve (which is basically inappropriate here) to own memory facilities without this major overhead.


type: t
user: dgp
brief: Closed ticket [c949e73d3e93bc94|c949e73d3e].
comment:
  Closed ticket [c949e73d3e93bc94|c949e73d3e]: <i>itcl crashes in info command</i> plus 5 other changes


type: t
user: dgp
brief: Ticket [c949e73d3e93bc94|c949e73d3e]: 3 changes
comment:
  Ticket [c949e73d3e93bc94|c949e73d3e] <i>itcl crashes in info command</i> status still Open with 3 other changes


type: t
user: dgp
brief: Closed ticket [c949e73d3e93bc94|c949e73d3e].
comment:
  Closed ticket [c949e73d3e93bc94|c949e73d3e]: <i>itcl crashes in info command</i> plus 3 other changes


type: ci
user: dgp
comment:
  [c949e73d3e] Repair regression in [info option $option] by expanding the
  object context discoverable by Itcl_GetContext().  Seems related to
  constructor operations.


type: t
user: dgp
brief: Ticket [15f7db53b9f36d97|15f7db53b9]: 5 changes
comment:
  Ticket [15f7db53b9f36d97|15f7db53b9] <i>Different behavior for Itcl 4 and Itcl 3</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [15f7db53b9f36d97|15f7db53b9]: 3 changes
comment:
  Ticket [15f7db53b9f36d97|15f7db53b9] <i>Different behavior for Itcl 4 and Itcl 3</i> status still Open with 3 other changes


type: t
user: schmitzu
brief: Ticket [050ac21f736d16ba|050ac21f73]: 3 changes
comment:
  Ticket [050ac21f736d16ba|050ac21f73] <i>info variable introspection gap</i> status still Open with 3 other changes


type: t
user: schmitzu
comment:
  Add attachment [/artifact/5e85110efd94c25f|itcl4.1.1_scope.patch] to ticket [050ac21f736d16ba|050ac21f73]


type: t
user: schmitzu
comment:
  Add attachment [/artifact/c51a65cbb70ceba6|infoVariableScopeUsage.tcl] to ticket [050ac21f736d16ba|050ac21f73]


type: ci
user: dgp
comment:
  [SF Bug 267] Make sure [::info vars] falls back to trying [::tcl::info::vars]
  when no Itcl context is found.


type: t
user: schmitzu
comment:
  Add attachment [/artifact/a86b2e77c2e5e430|itcl4.1.1_scope.patch] to ticket [050ac21f736d16ba|050ac21f73]


type: ci
user: sebres
comment:
  silence a compiler warning "-Wformat-overflow": output 2..11 bytes into buf of size 10 ('sprintf' may write a 0 of NTS past the end of the destination)


type: ci
bgcolor: #C2FFC1
user: sebres
comment:
  amend to [734b2ff2e3]: fix release, ckfree -> ItclCkfree (without in-between temp automation in tcl-core)


type: t
user: sebres
brief: Ticket [87a89c9a927db943|87a89c9a92]: 3 changes
comment:
  Ticket [87a89c9a927db943|87a89c9a92] <i>Test &quot;sfbug-254&quot; fails for 4.0.5 on Win</i> status still Open with 3 other changes


type: t
user: sebres
brief: New ticket [1dc2d851ebd9a3df|1dc2d851eb].
comment:
  New ticket [1dc2d851ebd9a3df|1dc2d851eb] <i>SEGFAULT by creating of itc-class after deleting of oo::class machinery</i>.


type: ci
bgcolor: #E08587
user: sebres
comment:
  test case extended to cover [1dc2d851eb] (segfault by creating of itc-class after deleting of oo::class machinery)


type: ci
user: sebres
comment:
  fixes [87a89c9a927db943]: apply "-load" test-option for child interpreter in tests "sfbug-254" and "sfbug-257" (provides library-path to pkgIndex or loads Itcl directly).


type: t
user: sebres
brief: Closed ticket [87a89c9a927db943|87a89c9a92].
comment:
  Closed ticket [87a89c9a927db943|87a89c9a92]: <i>Test &quot;sfbug-254&quot; fails for 4.0.5 on Win</i> plus 3 other changes


type: t
user: sebres
brief: Ticket [1dc2d851ebd9a3df|1dc2d851eb]: 5 changes
comment:
  Ticket [1dc2d851ebd9a3df|1dc2d851eb] <i>SEGFAULT by creating of itc-class after deleting of oo::class machinery</i> status still Open with 5 other changes


type: ci
bgcolor: #E08587
user: sebres
comment:
  fix [1dc2d851eb] case "sfbug-254.1" - Tcl_GetObjectFromObj/Tcl_GetObjectAsClass could return NULL (without oo-machinery), test passed now


type: ci
bgcolor: #E08587
user: sebres
comment:
  2nd segfault-fix of [1dc2d851eb], cases "sfbug-254.2/-254.3" - no base/superclass without oo-machinery (if oo-subsystem is deleted, ::itcl::Root is not available anymore), tests passed now


type: ci
bgcolor: #E08587
user: sebres
comment:
  extend test case illustrating still one segfault, still create class, but now with other base (inheritance that was removed with oo-subsystem)


type: ci
bgcolor: #E08587
user: sebres
comment:
  ultimate segfault-fix of [1dc2d851eb], mod-case of "sfbug-254.3" -  create class, but now with other base (inheritance that was removed with oo-subsystem), all tests passed now;
  note Tcl_GetClassAsObject(infoPtr->clazzClassPtr) can return other object-instance of "deleted" root class, that is still valid for some reasons.


type: ci
user: sebres
comment:
  code review: revert clazzObjectPtr back to unused, remove increment workaround for OO 1.0.2 (thisPtr of clazz is removed with last ref to engine, no matter how many references still exist).


type: t
user: sebres
brief: Closed ticket [1dc2d851ebd9a3df|1dc2d851eb].
comment:
  Closed ticket [1dc2d851ebd9a3df|1dc2d851eb]: <i>SEGFAULT by creating of itc-class after deleting of oo::class machinery</i> plus 4 other changes


type: t
user: oehhar
brief: Ticket [87a89c9a927db943|87a89c9a92]: 4 changes
comment:
  Ticket [87a89c9a927db943|87a89c9a92] <i>Test &quot;sfbug-254&quot; fails for 4.0.5 on Win</i> status still Closed with 4 other changes


type: ci
user: sebres
comment:
  restored clazzObjectPtr and check via this object due to timing problem (clazzClassPtr returns still valid this-object by deleted oo-subsystem sporadicaly, well reproducible within DEBUG-build).


type: ci
user: jan.nijtmans
comment:
  Re-generate configure script. 
  Change various function calls to the *2() or *Ex() versions. This improves possible future compatibility with Tcl 9. For now, it doesn't really matter.


type: ci
bgcolor: #94FCBD
user: sebres
comment:
  Itcl_BuildVirtualTables: avoid whole recreation of var-resolver table (huge speed-up of class creation)


type: ci
bgcolor: #94FCBD
user: sebres
comment:
  avoid duplicates of vlookup by same var (protected vars of ancestor class), can use same handle across all namespaces


type: ci
bgcolor: #94FCBD
user: sebres
comment:
  stop call of var-resolver twice (add TCL_GLOBAL_ONLY - trick to avoid call resolver for namespace of current frame, all vars are fully-qualified).


type: t
user: sebres
brief: New ticket [fe70356a54338a4d|fe70356a54].
comment:
  New ticket [fe70356a54338a4d|fe70356a54] <i>Several performance optimizations (memory-preservation, on demand var-resolver, etc)</i>.


type: t
user: sebres
comment:
  Add attachment [/artifact/0636f98bd18310ec|itcl-perf-trunk-vs-memopt.txt.diff] to ticket [fe70356a54338a4d|fe70356a54]


type: t
user: sebres
comment:
  Add attachment [/artifact/8f88fbe4bd50cfc0|itcl-perf-trunk-vs-on-dmnd-res.txt.diff] to ticket [fe70356a54338a4d|fe70356a54]


type: t
user: sebres
comment:
  Add attachment [/artifact/831ced2dbf09d6d7|itcl-perf-memopt-vs-on-dmnd-res.txt.diff] to ticket [fe70356a54338a4d|fe70356a54]


type: t
user: dgp
brief: Ticket [a6b03440702ed4f7|a6b0344070]: 5 changes
comment:
  Ticket [a6b03440702ed4f7|a6b0344070] <i>Unable to execute configure script</i> status still Open with 5 other changes


type: ci
user: dgp
comment:
  Remove an unused experimental resolver (NEW_PROTO_RESOLVER) that appears to
  have been abandoned. If there is anyone out there who misses it, we can retrieve
  again from the code history.


type: ci
user: jan.nijtmans
comment:
  Always compile Itcl with -DTCL_NO_DEPRECATED, since it then only uses the public TIP #139 stub entries, not the private ones.


type: ci
user: dgp
comment:
  Remove other code that was only written to interact with the experimental
  resolver (NEW_PROTO_RESOLVER).


type: ci
bgcolor: #ff919b
user: sebres
comment:
  closes segfault [4f2e4ff880]: reset iclsPtr only if last method reference is free (ItclReleaseIMF would call ItclDeleteFunction on last reference)


type: t
user: sebres
brief: New ticket [4f2e4ff880766e48|4f2e4ff880].
comment:
  New ticket [4f2e4ff880766e48|4f2e4ff880] <i>segfault executing all test cases with -singleproc 1</i>.


type: t
user: sebres
brief: Ticket [4f2e4ff880766e48|4f2e4ff880]: 5 changes
comment:
  Ticket [4f2e4ff880766e48|4f2e4ff880] <i>segfault executing all test cases with -singleproc 1</i> status still Open with 5 other changes


type: ci
user: sebres
comment:
  fixed inherit-1.10 testing with -singleproc 1 (was depending on previous tests, so for some reasons sporadical)


type: t
user: sebres
brief: Closed ticket [4f2e4ff880766e48|4f2e4ff880].
comment:
  Closed ticket [4f2e4ff880766e48|4f2e4ff880]: <i>segfault executing all test cases with -singleproc 1</i> plus 4 other changes


type: ci
user: dgp
comment:
  When built with -DOBJ_REF_COUNT_DEBUG=1, Itcl appears ready to provide a
  debugging command [::itcl::dumprefcountinfo], and that command shows up in
  a few test files in the test suite. However, the core of the implementation
  seems to be in a routine Tcl_DbDumpRefCountInfo() which has the disadvantage
  of having never actually existed. Removed remnants of the incomplete experiment.


type: t
user: dgp
brief: Ticket [cf042fb5678f0110|cf042fb567]: 5 changes
comment:
  Ticket [cf042fb5678f0110|cf042fb567] <i>itcl::finish segfault</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [cf042fb5678f0110|cf042fb567]: 3 changes
comment:
  Ticket [cf042fb5678f0110|cf042fb567] <i>itcl::finish segfault</i> status still Open with 3 other changes


type: ci
user: dgp
comment:
  The static array itclCmds[] contains a list of Itcl command names for the
  sole purpose of telling [itcl::finish] what commands need to be destroyed.

  Long ago, the command [itcl::genericclass] was added to that list, while
  the actual command [itcl::internal::commands::genericclass] was created.
  So [itcl::finish] has been trying and failing to delete a non-existent
  command ever since. Stop that.


type: g
user: dgp
comment:
  Edit [38793c147d868dc0|38793c147d]: Move to branch [/timeline?r=bug-cd042fb567&nd&dp=38793c147d868dc0&unhide | bug-cd042fb567].


type: t
user: sebres
brief: Open ticket [4f2e4ff880766e48|4f2e4ff880].
comment:
  Open ticket [4f2e4ff880766e48|4f2e4ff880]: <i>segfault executing all test cases with -singleproc 1</i> plus 3 other changes


type: t
user: dgp
brief: Ticket [d8b503542371be13|d8b5035423]: 5 changes
comment:
  Ticket [d8b503542371be13|d8b5035423] <i>segfault when itcl::ensemble is used</i> status still Open with 5 other changes


type: t
user: dgp
brief: Ticket [d8b503542371be13|d8b5035423]: 3 changes
comment:
  Ticket [d8b503542371be13|d8b5035423] <i>segfault when itcl::ensemble is used</i> status still Open with 3 other changes


type: ci
user: dgp
comment:
  Replace occasional, custom, hacky leak testing machinery with conventional
  leak testing machinery throughout almost all the test suite.
  (NOTE: plenty of leaks for hunting!)


type: t
user: dgp
brief: Closed ticket [d8b503542371be13|d8b5035423].
comment:
  Closed ticket [d8b503542371be13|d8b5035423]: <i>segfault when itcl::ensemble is used</i> plus 4 other changes


type: t
user: dgp
brief: Ticket [4f2e4ff880766e48|4f2e4ff880]: 3 changes
comment:
  Ticket [4f2e4ff880766e48|4f2e4ff880] <i>segfault executing all test cases with -singleproc 1</i> status still Open with 3 other changes


type: ci
user: dgp
comment:
  [4f2e4ff880] ItclDeleteFunction() was failing to remove the entry from
  the "procMethods" table during class destruction. This left the entry in
  place, available for retrieval when random chance in memory re-circulation
  would bring the same key into play again. Retrieving and using pointers to
  freed structs is bad.

  Fix was to stop the filtering out of some entry removals. They had been
  blocked because the legacy path to finding the table had been segfaulting
  before. The proper fix though, should not have been to leave the table
  polluted, but to use the simpler path to that table which already exists.


type: t
user: dgp
brief: Closed ticket [4f2e4ff880766e48|4f2e4ff880].
comment:
  Closed ticket [4f2e4ff880766e48|4f2e4ff880]: <i>segfault executing all test cases with -singleproc 1</i> plus 3 other changes


type: t
user: sebres
brief: Ticket [4f2e4ff880766e48|4f2e4ff880]: 3 changes
comment:
  Ticket [4f2e4ff880766e48|4f2e4ff880] <i>segfault executing all test cases with -singleproc 1</i> status still Closed with 3 other changes


type: ci
user: dgp
comment:
  [cf042fb567] Stop leaking error messages from [itcl::finish].
  Eliminate the "checkmemoryleaks" hack that now segfaults.


type: ci
user: sebres
comment:
  amend to [5828b18ff542092f], rewritten as a single helper script injecting leak-test at start of each test


type: ci
user: sebres
comment:
  fix -singleproc with leaktest: disable leaktest injection inside tests (loaded internally) on a child interpreter


type: ci
user: dgp
comment:
  Be sure all the entries of the delegatedFunctions table are discarded, even
  those that map to no ItclComponent.


type: ci
user: sebres
ecomment:
  Stop leak of Initialize on destroyed ::oo::class (sfbug-254.*), don't need to do full initialize if base doesn't exists

comment:
  Stop leak of Initialize on destroyed ::oo::class (sfbug-254.*), don'r need to do full initialize if base doesn't exists


type: ci
user: dgp
comment:
  The command [itcl::finish] was created as an instrumentation and debugging aid.
  Other facilities have taken over those tasks. We no longer need the pain of
  this command.


type: ci
user: dgp
comment:
  By the time FreeItclObjectInfo() is called, the ::itcl namespace is already
  torn down. No need to delete commands and namespaces inside it another time.
  Also Tcl_DeleteHashTable() already includes entry deletion.


type: ci
user: sebres
ecomment:
  eliminate unneeded command delete tracing (rewritten via delete callback), provide NRE-call safety calling built-in info on deleted ensemble

comment:
  eliminate unneded command delete tracing (rewritten via delete callback), provide NRE-call safety calling built-in info on deleted ensemble


type: ci
user: sebres
comment:
  further eliminating of unneeded command delete traces, normalize class delete callbacks, removed unused code


type: ci
user: jan.nijtmans
comment:
  Add type-casts and some other type-changes, making the source-code more C++-friendly. Not 100% compilable with C++-compiler yet, but almost there.


type: t
user: dgp
brief: Ticket [fe70356a54338a4d|fe70356a54]: 5 changes
comment:
  Ticket [fe70356a54338a4d|fe70356a54] <i>Several performance optimizations (memory-preservation, on demand var-resolver, etc)</i> status still Open with 5 other changes


# attachment

src: d463911669b0d55a045da0dac7dd2a1da76c4ff7
target: f8296373502df0656f70ba69f82ef0eceab0f920
filename: itcl_ensemble_option.patch
user: griffin
comment:
  This patches fixes the problem.  The ensemble command uses a slave interp to parse ensemble subparts, but the code actually fails to create the slave interp, using the primary interp instead.


src: 831ced2dbf09d6d786e05e3455aa479a38ef3cab3ca0ae16e7ce66a7d2adcf3d
target: fe70356a54338a4d1122c9a70b000063b866b260
filename: itcl-perf-memopt-vs-on-dmnd-res.txt.diff
user: sebres
comment:
  sebres-memopt-perf-branch vs sebres-on-dmnd-resolver-perf-branch (itcl-basic.perf.tcl - performance comparison)


# ticket

tkt_uuid: d4ee728817f951d0b2aa8e8f9b030ea854e92c9f
type: Code_Defect
status: Closed
priority: Immediate
severity: Critical
foundin: 4.0b5
private_contact: 6dcdfb17584a679c524d6281a3ea7a6353e28944
resolution: Fixed
title: Problems on info command from inside itcl code
comment:
  Try this code

  package require Itcl
  itcl::class myclass {
  	proc myproc {} {
  		set a something
  		puts "WHY ? [info exist a]"
  		puts "WHY ? [::info exist a]"
  	}
  	public method run {} {
  		myproc
  	}
  }
  myclass tryme
  tryme run

  <hr /><i>wiede added on 2012-03-25 08:50:02 UTC:</i><br />
  could be fixed with tailcall ::info::exists in the code


tkt_uuid: 5775d7979aba9a76c9e60babac7eb48f41e7aa54
type: Code_Defect
status: Closed
priority: Immediate
severity: Cosmetic
foundin: 4.0.2
private_contact: 59b8126a5317e750499fddee63d646644f6a1a75
resolution: Rejected
title: IWidget dateentry Calender appears off screen
comment:
  In file: 
  C:\Tcl\lib\teapot\package\tcl\lib\Iwidgets4.0.2\scripts\dateentry.itk  (this is
  the install path of the File)

   In Method
   itcl::body iwidgets::Dateentry::_popup
   
   Right around the following comment
   
       # The icon button will be used as the basis for the position of the
       # popup on the screen.  We'll always attempt to locate the popup
       # off the lower right corner of the button.  If that would put
       # the popup off the screen, then we'll put above the upper left.
      
   
   This chunk of code calculates the position to place the popup calender 
   that is associated to the widget. the logic accounts for the widget going off the screen to the right, by placing above the upper left. If does not check to see if upper left would put the popup off the screen. I am running into that exact scenario. I am using the widget on a laptop with a small screen and low resolution (sad I know :( ) and the application is maximized. This results in no room to the right or top, and I end up with the months being cut off on the calender popup. The widget should check and make sure there is room to place to popup above the upper left and if there is no room place it bottom right (or something like that)

  <hr /><i>wiede added on 2012-03-25 08:51:53 UTC:</i><br />
  IWidget is not part of itcl 4.0 so I think the bug is not in the right bug tracker here


tkt_uuid: 36577626c340ad59615f0a0238d67872c009a8c9
type: Code_Defect
status: Closed
priority: Immediate
severity: Critical
foundin: 4.0b7
private_contact: 9555fa42f4a36780aff7e37d8f4b34c2bbc47faf
resolution: Fixed
title: can not create objects inside class namespace
comment:
  Using version 4.0b7 and the following code snippet:

  package req Itcl
  ::itcl::class ::a {
    constructor args {puts $args}
    destructor {}
  }
  ::a ::a::b

  I got the error message:

    no valid method implementation

  The code was working in itcl 3.4.

  <hr /><i>wiede added on 2012-02-25 16:00:01 UTC:</i><br />
  was a special case when having the object in a child namespace of the class.


tkt_uuid: 900dc81e3a567bae3b1107aaad2592dce5dd43a0
type: Code_Defect
status: Closed
priority: Immediate
severity: Critical
foundin: 4.0b8
private_contact: 9555fa42f4a36780aff7e37d8f4b34c2bbc47faf
resolution: Open
title: itcl chain does not work
comment:
  The chain command is executed but does nothing.
  For an example see the code at: http://wiki.tcl.tk/17161

  itcl3.4 work as expected

  <hr /><i>arnulf added on 2013-02-17 10:59:50 UTC:</i><br />
  seems to be the same as SF bug #237.
  There is a fix in fossil which will go into next version 4.0.1.


# ticketchng

login: dgp
mimetype: text/x-fossil-plain
icomment:
  It doesn't appear that Bug 240 from SF made it
  over.  I'm guessing because it wasn't entered
  until after the SF Itcl Bug Tracker was upgraded
  to a system that doesn't export tickets.

  Anyhow, please don't overlook fixing

  http://sourceforge.net/p/incrtcl/bugs/240/


login: jan.nijtmans
mimetype: text/x-fossil-plain
icomment:
  Just compile Itcl against Tcl 8.6.1 headers, and run it in an environment where Tcl 8.6.0 is installed. Example (MinGW):

  $ tclsh86
  % package require Itcl
  version conflict for package "TclOO": have 1.0, need 1.0.1
  %


login: jan.nijtmans
mimetype: text/x-fossil-plain
icomment:
  When Itcl is built using --disable-shared, the resulting static library cannot be used, it's broken. The reason is that TclOOInitializeStubs() calls tclStubsPtr->tcl_PkgRequireEx, which only works if tclStubsPtr is initialized.
  So we have to make sure that tclStubsPtr is initialized first.


login: anonymous
mimetype: text/plain
icomment:
  package require Itcl
  itcl::class Naughty {private method die {} {}}
  Naughty die

  The above code SIGSEGVs.  Here's what I said about it on the Tcler's Chat:

  [19:48]	<Unununium> I just hit a SIGSEGV in [incr Tcl], though appears to be in the TclOO guts.  Using the latest Fossil of everything.  Tcl_ObjectGetMetadata() is returning NULL which is later dereferenced.
  [19:50]	<Unununium> Critical line in Tcl_ObjectGetMetadata() is hPtr = Tcl_FindHashEntry(oPtr->metadataPtr, (char *) typePtr);
  [19:50]	<Unununium> typePtr->name is "ItclObject"
  [19:51]	<Unununium> oPtr->metadataPtr only has one entry in it at this point
  [19:52]	<Unununium> The one and only entry is for "ItclClass"
  [19:52]	<Unununium> As determined by groveling through RAM using gdb


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Re-opened this one.  The prior work on this report
  stopped a segfault, and that's good.

  However it didn't make the code actually work.

  Contrast Itcl 3 with Itcl 4:

  % package require Itcl
  3.4
  % itcl::class Class {private method instance {} {}}
  % Class instance                                                                
  instance                     


  % package require Itcl
  4.0.3
  % itcl::class Class {private method instance {} {}}
  % Class instance
  invalid command name "instance"


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Try that again....

  % package require Itcl
  3.4
  % itcl::class Class {private method instance {} {}}
  % Class instance                                                                
  instance           

  % package require Itcl
  4.0.3
  % itcl::class Class {private method instance {} {}}
  % Class instance
  invalid command name "instance"


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Why is the ticket system inserting a newline?!?!

  % package require Itcl
  3.4
  % itcl::class Class {private method instance {} {}}
  % Class instance                                                                
  instance          


  Ok, i've just checked with the Preview, and it previews ok.


login: dgp
mimetype: text/plain
icomment:
  % package require Itcl
  4.0.3
  % itcl::class Foo {private method bar {} {}}
  % Foo bar
  invalid command name "bar"


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Anyhow, hopefully through all the ticket mangling you can
  see that there's a confusion lurking about the methods
  of an instance and the methods of the class object that
  creates an instance.  restrictions on one should not interfere
  with the other.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Brought over from Tcl Ticket system:

  http://core.tcl.tk/tcl/tktview/da15321a58

  Script below runs successfully with Itcl 3.4.1 and Tcl/Tk 8.4,
  but segfaults with later releases of Tcl/Tk.
    
  Script runs successfully in Itcl 4.

  Report moved here just in case we ever find anyone to
  work on Itcl 3 sources.

  Demo script (thanks to teo):

  package require Itcl 3

  itcl::class bar {
      public {
  	method config_textvar {w var} {
  	    $w configure -textvariable [itcl::scope $var]
  	    set $var [clock seconds]
  	}
      }
      private {
  	variable foo 0
  	variable bar 0
      }    
  }

  itcl::class foo {
      constructor args {
  	create
      }

      public {
  	method create {} {
  	    set obj_ [uplevel \#0 bar \#auto]
  	    pack [frame .f] -fill both -expand yes
  	    pack [button .f.a] [button .f.b] [button .f.c] [button .f.d] -fill both -expand yes
  	    switch -- $count_ {
  		0 {
  		    $obj_ config_textvar .f.a foo
  		    .f.b configure -textvariable [itcl::scope count_]
  		}
  		1 {
  		    $obj_ config_textvar .f.b foo
  		    .f.c configure -textvariable [itcl::scope count_]
  		}
  		2 {
  		    $obj_ config_textvar .f.c foo
  		    .f.a configure -textvariable [itcl::scope count_]
  		}
  	    }
  	    after $interval_ms_ [itcl::code $this assign]
  	}
  	method assign {} {
  	    incr count_
  	    if {$count_ > 2} { set count_ 0 }
  	    set foo_ $count_
  	    after $interval_ms_ [itcl::code $this remove]
  	}
  	method remove {} {
  	    rename $obj_ {}
  	    destroy .f
  	    unset foo_
  	    after $interval_ms_ [itcl::code $this create]
  	}
      }
      private {
  	variable interval_ms_ 100
  	variable count_ 0
  	variable foo_ 0
  	variable obj_ {}
      }
  }

  wm geometry . 200x200
  update idle
  foo .foo


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Seems that entries go into the infoPtr->myEnsembles hash table,
  but never come back out of it again.   Memleak!

  I'd at least expect to see teardown of this hash table as part
  of ItclFinishCmd, which tears down all the other parts of
  the Itcl assoc data infoPtr.

  It may be that entries need to come out of that table one
  by one as well, for whenever individual ensemble commands
  are deleted.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Looking again, I don't see what the myEnsembles table
  is for?  Entries get put into it.  And that seems to be it.
  Never searched.  Never iterated.  What's the table for?
  Can we just get rid of it?


login: aku
mimetype: text/x-fossil-plain
icomment:
  Is this table in a public structure, i.e. publicly visible ?
  If not I would vote for its removal as well.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  itcl4.0.2/generic/itclObject.c:3012:42: warning: 
        variable 'tail' is uninitialized when used here [-Wuninitialized]
          methodNamePtr = Tcl_NewStringObj(tail, -1);

  The warning is correct.

  If this is a "can't happen" situation, perhaps we'd be
  better off with an assert() ?


login: anonymous
mimetype: text/x-fossil-wiki
icomment:
  Itcl commit 0d11f378d8 breaks iwidgets:

  % package require iwidgets
  cannot inherit from "itk::Widget" (cannot inherit from "itk::Archetype" (can only handle options on class level))

  After backing this changeset out of the Tcl 8.6.3 release tarball iwidgets works fine.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Good that you have a fix that you can apply locally while
  this gets sorted out (even if it means keeping memleaks).

  Any idea how it is that Itk or Iwidgets relies on the removed
  hash table?  I could see no sign that the table was used
  anywhere by anything.  Still cannot find it, so I must be looking
  wrong.


login: apnadkarni
mimetype: text/plain
icomment:
  Example:

  package require Itcl
  itcl::class B {
     public method hierarchy {} { return [$this info heritage] }
  }
  itcl::class C {
     inherit B
     public method hierarchy {} { return [$this info heritage] }
  }
  itcl::class D {
     inherit B
  }
  Then,

  (tcl) 49 % C #auto
  c0
  (tcl) 51 % c0 hierarchy
  ::C ::B
  (tcl) 52 % D #auto
  d0
  (tcl) 53 % d0 hierarchy
  ::B

  I would expect [d0 hierarchy] to return ::D ::B since the object class is D.
  I believe (based on communication with the author of the package where I ran into this bug), this is an incompatibility wrt Itcl 3.x as he uses that version and does not see this problem.


login: apnadkarni
mimetype: text/x-fossil-plain
icomment:
  The same issue also holds for the [info inherit].

  package require Itcl
  itcl::class B {
     public method hierarchy {} { return [$this info heritage] }
     public method inherited {} { return [$this info inherit] }
  }
  itcl::class C {
     inherit B
     public method hierarchy {} { return [$this info heritage] }
     public method inherited {} { return [$this info inherit] }
  }
  itcl::class D {
     inherit B
  }

  (tcl) 49 % C #auto
  c0
  (tcl) 50 % D #auto
  d0
  (tcl) 51 % c0 inherited
  ::B
  (tcl) 52 % d0 inherited

  However, if we call the info method from the global scope directly , it works correctly.

  (tcl) 53 % d0 info heritage
  ::D ::B
  (tcl) 54 % c0 info heritage
  ::C ::B
  (tcl) 55 % d0 info inherit
  ::B
  (tcl) 56 % c0 info inherit
  ::B

  /Ashok


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The trouble here is in the machinery used to invoke

      d0 info heritage

  The d0 object doesn't in fact have an info method.  Instead
  a handler in the unknown method is used, essentially this:

      method unknown args {uplevel 1 ::itcl::builtin::objectunknown d0 $args}

  Ok, so the next mystery is why that d0 argument isn't getting used to
  get the right answer.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Sorry, I give up.  Need a dual expert in both TclOO and Itcl to make
  any progress on this.  I'm neither.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  There's a routine Itcl_BiInfoHeritageCmd() within itclInfo.c where
  the functioning apparently takes place.  From the comments, it
  seems that the result is dependent on the current namespace
  of the interp when that routine is called.  That namespace needs
  to be and Itcl class namespace to avoid an error, and it needs to be
  the right Itcl class namespace to get proper functioning.

  Somehow, whatever path that is actually followed (which I
  cannot untangle) doesn't set the right current namespace
  to get the right answer.

  No idea if that much info in the hands of someone who knows
  something makes it easy to fix or not.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  In Itcl 3 there are a pair of routines

  Itcl_PushContext() and Itcl_PopContext() 

  that are called going in and coming out of
  a method body invocation, and they have the
  effect of chaning the current namespace appropriately
  so that the [$obj info] subcommands see the context
  they need to produce correct results.

  In Itcl 4, those routines no longer exist.

  If they did, it seems possible that calls to
  them might be added to ItclCheckCallMethod()
  and ItclAfterCallMethod() to get the same sort
  of context switch at the right point (following
  the pattern of Itcl_PushStack and Itcl_PopStack).

  Anyone reading this who knows the history of
  the purging of Itcl_(Push|Pop)Context might be
  able to point the way to a proper fix here.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  `make valgrind` on itcl 3.4.2 rc branch highlights a
  few instances of this leak:

  ==27558== 59 bytes in 2 blocks are definitely lost in loss record 655 of 1,550
  ==27558==    at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==27558==    by 0x518B9D: TclpAlloc (tclAlloc.c:700)
  ==27558==    by 0x493ED8: Tcl_Alloc (tclCkalloc.c:1058)
  ==27558==    by 0xDE6B45F: Itcl_DecodeScopedCommand (itcl_util.c:1276)


login: dgp
mimetype: text/x-fossil-plain
icomment:
  About half the time this script segfaults with Tcl trunk and Itcl 3.4.2 RC:

  puts "Itcl [package require Itcl]"
  itcl::class Animal {
    constructor args {namespace which -variable legs}
    public variable legs 4
  }
  Animal .a


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Itcl 3.4.2 build against Tcl 8.4.20 doesn't crash, so
  this is probably another Var Reform issue never addressed.


login: anonymous
mimetype: text/x-fossil-plain
icomment:
  This could well be an incomplete futz in [3f5de3c16d]

  Which Tcl headers were used to compile itcl-3.4.2? It would be useful to know if compiling agaisnta Tcl8.4 or 8.5 headers makes a difference as of the appearance of this bug - in both cases running agains Tcl8.5


login: dgp
mimetype: text/x-fossil-plain
icomment:
  So, according to miguel, Itcl 3.4.2 variable resolvers
  completely fail to follow the post-Var Reform rules about
  Var storage, and this segfault is a symptom of that.

  The crash can be prevented by adding another check to
  Tcl itself.  Doing that now.

  At that point, the worst consequence is avoided, and
  Itcl behaves in a way that's arguably reasonable, even
  on a broken foundation.  (Itcl member variables are not
  recognized as namespace vars by [namespace which], and
  truly they are not.)

  Actually fixing the Itcl code appears to be a major project,
  which I'm not willing to take on.  Folks truly stymied by
  the problem should move to Itcl 4 which doesn't suffer from it.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  % package require Itcl 3
  3.4
  % set itcl::patchLevel
  3.4.2
  % itcl::class Object { constructor {} {} }
  % time {Object #auto} 10000
  4.8025 microseconds per iteration

  % package require Itcl 4
  4.0.3
  % itcl::class Object { constructor {} {} }
  % time {Object #auto} 10000
  2020.0335 microseconds per iteration 

  Very difficult to make the case for migration
  if this is the price to be paid.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The time gets worse with repetition:

  % time {Object #auto} 1000
  121.975 microseconds per iteration
  % time {Object #auto} 1000
  291.508 microseconds per iteration
  % time {Object #auto} 1000
  475.524 microseconds per iteration
  % time {Object #auto} 1000
  825.826 microseconds per iteration

  which leads me to speculate there's some
  really ugly and stupid quadratic scale
  search for something going on.  One possibility
  is a search for an unused ID to fulfill the #auto.
  Another possibility is the impact of a lot of
  Tcl_Preserve() calls.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Some simpl-eminded hacking tends to demonstrate
  that neither speculation pans out.  Wherever
  the quadratic pole is hiding, it's not (exclusively)
  in #auto generation, nor expensive Preserves.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Further ugly poking suggests that at least one
  origin of the trouble is degrading performance
  of the Tcl_CreateHashEntry() call in Tcl_CreateNamespace()
  that enters the namespace into its parent's table
  of children.  That routine appears to slow down
  with increasing table size.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  sorry, no.

  The CreateHashEntry calls are needed to make the table
  bigger.

  Then something else gets slower as the table gets bigger.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The trouble is in the "clazzUnknownBody" script
  that seems to run as part of the implementation
  of every [Object #auto].

  Within that script there is a command:

  ::itcl::find classes ${my_namespace}$m

  and that command somehow triggers a
  loop through all child namespaces of
  ::itcl::internal::variables and there's a child
  namespace there for every object created.
  As the number of objects increases, the
  time for that [itcl::find] to complete increases
  and so the time for every new object creation
  increases.

  I have only the barest clue what all that
  "clazzUnknownBody" script is trying to do.
  Someone who actually understands what's
  being done will have to be the one to dig
  further.  What is [itcl::find] doing for us?
  Is it necessary?


login: dgp
mimetype: text/x-fossil-plain
icomment:
  FWIW, the Tcl_Preserve() failure to scale also
  does show up, but it's small compared to the
  [itcl::find] problem.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  see the branch bug-04470f9067 for a demo of
  what a performance difference it makes to leave
  out the [itcl::find] call.  Big gains here for someone
  who can do the job right.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  To make matters worse, in this case, the expensive command
  is:

  itcl::find classes ::#auto

  which would be useless even if it were useful to find
  and delete a command already using the name about to
  be created.

  But even with the right resolved command name, what's
  the point of finding and [itcl::delete class] on any existing
  class?  Surely the proper delete callbacks on the command
  itself would be the right way to take care of any issues here.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The lines iterating over all the namespaces are here...

  http://core.tcl.tk/itcl/artifact/93c398ae3ca3d61a?ln=277-281

  Directly built right into [::itcl::find classes].

  Undoubtedly the wrong tool for the job here.


login: hkrummeck
mimetype: text/x-fossil-plain
icomment:
  The following code gives a seg fault:

  itcl::class Object { 
    public variable n {} 
    constructor {} { 
      set n test 
    } {}
  }
  Object #auto

  This does not happen with 3.4.2/8.5 or 4.0.3/8.6


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Reproduced.  Backtrace:

  #3  0x000000000053ebc8 in Tcl_Panic (
      format=0x7fffefb83ba8 "itcl: bad implementation flag for %s")
      at /home/dgp/fossil/tcl-only/generic/tclPanic.c:153
  #4  0x00007fffefb7e6b7 in Itcl_EvalMemberCode.part.2 () from ./libitcl3.4.so
  #5  0x00007fffefb7e3aa in Itcl_InvokeMethodIfExists () from ./libitcl3.4.so
  #6  0x00007fffefb7ff08 in Itcl_CreateObject () from ./libitcl3.4.so
  #7  0x00007fffefb76577 in Itcl_HandleClass.part.0 () from ./libitcl3.4.so
  #8  0x0000000000414c40 in Dispatch (data=0x869258, interp=0x81f680, result=0)
      at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4359
  #9  0x0000000000414cce in TclNRRunCallbacks (interp=0x81f680, result=0, 
      rootPtr=0x0) at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4392
  #10 0x00000000004177f5 in TclEvalObjEx (interp=0x81f680, objPtr=0x0, 
      flags=131072, invoker=0x0, word=0)
      at /home/dgp/fossil/tcl-only/generic/tclBasic.c:5958
  #11 0x000000000041778e in Tcl_EvalObjEx (interp=0x81f680, objPtr=0x0, 
      flags=131072) at /home/dgp/fossil/tcl-only/generic/tclBasic.c:5939
  #12 0x00000000005bec01 in Tcl_RecordAndEvalObj (interp=0x81f680, 
      cmdPtr=0x865560, flags=131072)
      at /home/dgp/fossil/tcl-only/generic/tclHistory.c:190
  #13 0x000000000053298b in Tcl_MainEx (argc=-1, argv=0x7fffffffd550, 
      appInitProc=0x40f1d6 <Tcl_AppInit>, interp=0x81f680)
      at /home/dgp/fossil/tcl-only/generic/tclMain.c:534
  #14 0x000000000040f1cf in main (argc=1, argv=0x7fffffffd548)
      at /home/dgp/fossil/tcl-only/unix/tclAppInit.c:84


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Sorry, let's try that again:

  #0  0x0000000000576978 in TclObjVarErrMsg (interp=0x81f680, part1Ptr=0x0, 
      part2Ptr=0x0, operation=0x5d94af "set", 
      reason=0x5d9341 "variable is array", index=0)
      at /home/dgp/fossil/tcl-only/generic/tclVar.c:5624
  #1  0x0000000000570fcc in TclPtrSetVar (interp=0x81f680, 
      varPtr=0x7fffffffc838, arrayPtr=0x0, part1Ptr=0x0, part2Ptr=0x0, 
      newValuePtr=0x8d12d0, flags=512, index=0)
      at /home/dgp/fossil/tcl-only/generic/tclVar.c:1880
  #2  0x00000000004e9ad2 in TEBCresume (data=0x8cc5f8, interp=0x81f680, 
      result=0) at /home/dgp/fossil/tcl-only/generic/tclExecute.c:3574
  #3  0x0000000000414cce in TclNRRunCallbacks (interp=0x81f680, result=0, 
      rootPtr=0x8652c0) at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4392
  #4  0x00000000004177f5 in TclEvalObjEx (interp=0x81f680, objPtr=0x8, flags=0, 
      invoker=0x0, word=0) at /home/dgp/fossil/tcl-only/generic/tclBasic.c:5958
  #5  0x000000000041778e in Tcl_EvalObjEx (interp=0x81f680, objPtr=0x8, flags=0)
      at /home/dgp/fossil/tcl-only/generic/tclBasic.c:5939
  #6  0x00007fffefb7de84 in Itcl_ConstructBase (interp=0x81f680, 
      contextObj=0x87d7c0, contextClass=0x87f640)
      at ./generic/itcl_methods.c:2322
  #7  0x00007fffefb7b7a3 in Itcl_EvalMemberCode (interp=0x81f680, 
      mfunc=0x940310, member=0x8c1cd0, contextObj=0x87d7c0, objc=1, 
      objv=0x8efe80) at ./generic/itcl_methods.c:967
  #8  0x00007fffefb7e063 in Itcl_InvokeMethodIfExists (interp=0x81f680, 
      name=0x7fffefb84ff0 "constructor", contextClass=0x87f640, 
      contextObj=0x87d7c0, objc=0, objv=0x82cd50)
      at ./generic/itcl_methods.c:2429
  #9  0x00007fffefb7ee33 in Itcl_CreateObject (interp=0x81f680, 
      name=0x7fffffffd030 "object0", cdefn=0x87f640, objc=0, objv=0x82cd50, 
      roPtr=0x7fffffffd018) at ./generic/itcl_objects.c:218
  #10 0x00007fffefb72471 in Itcl_HandleClass (clientData=0x87f640, 
      interp=0x81f680, objc=2, objv=0x82cd40) at ./generic/itcl_class.c:899
  #11 0x0000000000414c40 in Dispatch (data=0x869258, interp=0x81f680, result=0)
      at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4359
  #12 0x0000000000414cce in TclNRRunCallbacks (interp=0x81f680, result=0, 
      rootPtr=0x0) at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4392
  #13 0x00000000004177f5 in TclEvalObjEx (interp=0x81f680, objPtr=0x8, 
      flags=131072, invoker=0x0, word=0)
      at /home/dgp/fossil/tcl-only/generic/tclBasic.c:5958
  #14 0x000000000041778e in Tcl_EvalObjEx (interp=0x81f680, objPtr=0x8, 
      flags=131072) at /home/dgp/fossil/tcl-only/generic/tclBasic.c:5939
  #15 0x00000000005bec01 in Tcl_RecordAndEvalObj (interp=0x81f680, 
      cmdPtr=0x865560, flags=131072)
      at /home/dgp/fossil/tcl-only/generic/tclHistory.c:190
  #16 0x000000000053298b in Tcl_MainEx (argc=-1, argv=0x7fffffffd550, 
      appInitProc=0x40f1d6 <Tcl_AppInit>, interp=0x81f680)
      at /home/dgp/fossil/tcl-only/generic/tclMain.c:534
  #17 0x000000000040f1cf in main (argc=1, argv=0x7fffffffd548)
      at /home/dgp/fossil/tcl-only/unix/tclAppInit.c:84


login: dgp
mimetype: text/x-fossil-plain
icomment:
  This demo script begins segfaulting with the
  following checkin to Tcl development:

  http://core.tcl.tk/tcl/info/47649f8b79


login: dgp
mimetype: text/x-fossil-plain
icomment:
  I disable the code introduced in that checkin
  on the Tcl trunk, then the Itcl segfault stops.

  Have to guess Itcl 3 is intruding in unexpected
  ways into the CompiledLocal lists.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  This patch to the Itcl 3.4.2 sources will workaround
  the segfault observed in the submitted demo script:

  Index: generic/itcl_methods.c
  ==================================================================
  --- generic/itcl_methods.c
  +++ generic/itcl_methods.c
  @@ -823,11 +823,11 @@
   
       /*
        *  If the member is a constructor and the class has an
        *  initialization command, compile it here.
        */
  -    if ((member->flags & ITCL_CONSTRUCTOR) != 0 &&
  +    if (0 && (member->flags & ITCL_CONSTRUCTOR) != 0 &&
           (member->classDefn->initCode != NULL)) {
           result = TclProcCompileProc(interp, mcode->procPtr,
               member->classDefn->initCode, (Namespace*)member->classDefn->namesp,
               "initialization code for", member->fullname);


  It's not yet clear whether this is a generally suitable patch
  for all situations, or whether the segfault is a symptom of a
  deeper flaw in the Itcl/Tcl interplay itself.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The trouble here is that Itcl constructors have an optional syntax

     constructor $argSpec $intializer $body

  and then implement that as a single Tcl Proc with two different
  bodies.  That is, two compiled scripts end up sharing a single
  Proc struct.

  The Tcl code assumes that each compiled script that is a Proc
  body has its own Proc struct, so that it can stash things in
  it.  Sharing does not work.


login: anonymous
mimetype: text/x-fossil-plain
icomment:
  * Don Porter <donald.porter@nist.gov>
  | On 03/16/2015 02:34 PM, Ralf Fassel wrote:
  | > * Don Porter <donald.porter@nist.gov>
  | > | I'm pleased to announce several releases of the Itcl and Itk packages.
  | > | First, patch releases of the long-running Itcl/Itk 3.4.* series:
  >
  | > I'm trying to compile these against tcl/tk 8.5.18 on Windows, but this
  | > fails due to the line
  | >     include ..\..\rules.vc
  | > in itcl/win/makefile.vc and itk/win/makefile.vc
  >
  | Thanks for making public note of this.
  >
  | I've replaced those distribution files with new ones, adding the
  | missing files and editing the makefile.vc files.  This should correct
  | the problem you saw, but since clearly we do not test that build
  | system, I cannot be absolutely certain.

  I checked the new files and found two problems:
  - tcl/tk 8.5.18 (and I guess all newer releases as well) add the
    compiler version number to the output directory (eg. Release_VC12/
    instead of plain Release/), so the stubs libs for Tcl and Tk are not
    found.  I copy/pasted the equivalent code from tcl8.5.18/win/rules.vc
    into the itcl/itk rules.vc
    
  - when compiling itk, I got tons of errors related to 32-bit time_t,
    which *should* be addressed by
      #   define _USE_32BIT_TIME_T
    in tclWinport.h, but depending on the order of includes, this #define
    comes too late, if windows system include files are included before
    tkwinport.h is included.  Therefore I added a -D_USE_32BIT_TIME_T to
    the cflags in itk.

  Patches attached.

  HTH
  R'

  --- itcl3.4.2/win/rules.vc~	2015-03-18 13:07:58.000000000 +0100
  +++ itcl3.4.2/win/rules.vc	2015-03-19 12:02:02.884828405 +0100
  @@ -29,6 +29,43 @@
   _INSTALLDIR	= $(INSTALLDIR:/=\)
   !endif
   
  +#------------------------------------------------------------------------------
  +# Determine the host and target architectures and compiler version.
  +#------------------------------------------------------------------------------
  +
  +_HASH=^#
  +_VC_MANIFEST_EMBED_EXE=
  +_VC_MANIFEST_EMBED_DLL=
  +VCVER=0
  +!if ![echo VCVERSION=_MSC_VER > vercl.x] \
  +    && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \
  +    && ![echo ARCH=IX86 >> vercl.x] \
  +    && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
  +    && ![echo ARCH=AMD64 >> vercl.x] \
  +    && ![echo $(_HASH)endif >> vercl.x] \
  +    && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
  +!include vercl.i
  +!if ![echo VCVER= ^\> vercl.vc] \
  +    && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]
  +!include vercl.vc
  +!endif
  +!endif
  +!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
  +!endif
  +
  +!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86]
  +NATIVE_ARCH=IX86
  +!else
  +NATIVE_ARCH=AMD64
  +!endif
  +
  +# Since MSVC8 we must deal with manifest resources.
  +!if $(VCVERSION) >= 1400
  +_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
  +_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
  +!endif
  +
  +
   !ifndef MACHINE
   MACHINE		= IX86
   !endif
  @@ -220,6 +257,14 @@
   BUILDDIRTOP = Release
   !endif
   
  +!if "$(MACHINE)" != "IX86"
  +BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
  +!endif
  +!if $(VCVER) > 6
  +BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
  +!endif
  +
  +
   !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)
   SUFX	    = $(SUFX:g=)
   !endif

  Diff finished.  Thu Mar 19 13:45:37 2015

  --- itk3.4.1/win/makefile.vc~	2015-03-18 13:13:49.000000000 +0100
  +++ itk3.4.1/win/makefile.vc	2015-03-19 12:12:04.889778824 +0100
  @@ -76,7 +76,7 @@
   ITCLIMPLIBNAME	= itcl$(ITCL_VERSION)80$(SUFX).lib
   !endif
   ITKLIB		= "$(OUT_DIR)\$(ITKLIBNAME)"
  -ITCLIMPLIB	= "$(ITCLDIR)\win\Release\$(ITCLIMPLIBNAME)"
  +ITCLIMPLIB	= "$(ITCLDIR)\win\$(BUILDDIRTOP)\$(ITCLIMPLIBNAME)"
   
   
   !if $(TCLINSTALL)
  @@ -87,7 +87,7 @@
   TCL_LIBRARY	= 
   TK_LIBRARY	= 
   !else
  -TKSTUBLIB	= "$(TKDIR)\win\Release\tkstub$(TCL_VERSION).lib"
  +TKSTUBLIB	= "$(TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib"
   TKIMPLIB	= "$(TKDIR)\win\$(OUT_DIR)\tk$(TCL_VERSION)$(DBGX).lib"
   TKLIB		= "$(TKDIR)\win\$(OUT_DIR)\tk$(TCL_VERSION)$(DBGX).dll"
   WISH		= "$(TKDIR)\win\$(OUT_DIR)\wish$(TCL_VERSION)$(DBGX).exe"
  @@ -98,7 +98,7 @@
   ITK_LIBRARY	= "$(ROOT)/library"
   
   ITCLSTUBLIBNAME	= itclstub$(ITCL_VERSION).lib
  -ITCLSTUBLIB	= "$(ITCLDIR)\win\Release\$(ITCLSTUBLIBNAME)"
  +ITCLSTUBLIB	= "$(ITCLDIR)\win\$(BUILDDIRTOP)\$(ITCLSTUBLIBNAME)"
   
   ### For Tcl 8.0
   !if !$(TCL_DOES_STUBS)
  @@ -192,7 +192,7 @@
   !endif
   
   # declarations common to all compiler options
  -cflags = -nologo -c -W3 -YX -Fp$(TMP_DIR)^\
  +cflags = -nologo -c -W3 -YX -D_USE_32BIT_TIME_T -Fp$(TMP_DIR)^\
   
   !if $(PENT_0F_ERRATA)
   cflags = $(cflags) -QI0f

  Diff finished.  Thu Mar 19 13:45:58 2015

  --- itk3.4.1/win/rules.vc~	2015-03-19 12:10:10.925849619 +0100
  +++ itk3.4.1/win/rules.vc	2015-03-19 13:48:09.573103842 +0100
  @@ -29,6 +29,43 @@
   _INSTALLDIR	= $(INSTALLDIR:/=\)
   !endif
   
  +#------------------------------------------------------------------------------
  +# Determine the host and target architectures and compiler version.
  +#------------------------------------------------------------------------------
  +
  +_HASH=^#
  +_VC_MANIFEST_EMBED_EXE=
  +_VC_MANIFEST_EMBED_DLL=
  +VCVER=0
  +!if ![echo VCVERSION=_MSC_VER > vercl.x] \
  +    && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \
  +    && ![echo ARCH=IX86 >> vercl.x] \
  +    && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
  +    && ![echo ARCH=AMD64 >> vercl.x] \
  +    && ![echo $(_HASH)endif >> vercl.x] \
  +    && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
  +!include vercl.i
  +!if ![echo VCVER= ^\> vercl.vc] \
  +    && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]
  +!include vercl.vc
  +!endif
  +!endif
  +!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
  +!endif
  +
  +!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86]
  +NATIVE_ARCH=IX86
  +!else
  +NATIVE_ARCH=AMD64
  +!endif
  +
  +# Since MSVC8 we must deal with manifest resources.
  +!if $(VCVERSION) >= 1400
  +_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
  +_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
  +!endif
  +
  +
   !ifndef MACHINE
   MACHINE		= IX86
   !endif
  @@ -220,6 +257,13 @@
   BUILDDIRTOP = Release
   !endif
   
  +!if "$(MACHINE)" != "IX86"
  +BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
  +!endif
  +!if $(VCVER) > 6
  +BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
  +!endif
  +
   !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)
   SUFX	    = $(SUFX:g=)
   !endif

  Diff finished.  Thu Mar 19 13:48:18 2015


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Here's Itcl 3.4.2 compiled against Tcl 8.5 [*]:

  % itcl::class Object {
  constructor {} {set n 1} {puts $n}
  }
  % Object foo
  1
  foo

  You can set a variable in the init statement,
  and then read that same variable in the 
  constructor body.

  Try it with Itcl 4:


  % itcl::class Object {
  constructor {} {set n 1} {puts $n}
  }
  % Object foo
  can't read "n": no such variable



  [*] Don't try this compiled against Tcl 8.6!  That's
  the segfault reported over in http://core.tcl.tk/itcl/tktview/2e0e27de5f


login: dgp
mimetype: text/x-fossil-plain
icomment:
  That other bug is fixed on the itcl-3-branch tip now,
  so you can try with 8.6 now.  The incompatibility in
  Itcl 4 is the issue.


login: ralfixx
mimetype: text/x-fossil-plain
icomment:
  When building itcl4.0.3 included in tcl8.6.4 as-is on Linux (probably windows as well, not checked yet), all symbols in the shared library are non-exported due to the 
    #define MODULE_SCOPE extern
  in itcl.h.  

  Therefore linking against the shared itcl library fails with 
     ... undefined reference to `Itcl_RegisterObjC'

  (I know stubs is the preferred mechanism, but this opens another can of worms in our context, so I'd really like to link against the shared lib).

  nm shows all of the symbols as local (lower case "t"):

      nm itcl4.0.3/libitcl4.0.3.so | grep Register
      0002c533 t ItclGetRegisteredProcs
      0002c184 t Itcl_RegisterC
      0002c2f3 t Itcl_RegisterObjC


  In the light of the comment in itclDecls.h:
  /*
   * Exported function declarations:
   */
  it makes no sense IMHO to not export those symbols.

  If I apply this patch

  --- tcl8.6.4/pkgs/itcl4.0.3/generic/itcl.h~	2015-03-06 19:19:29.000000000 +0100
  +++ tcl8.6.4/pkgs/itcl4.0.3/generic/itcl.h	2015-04-17 11:13:32.907110547 +0200
  @@ -103,7 +103,7 @@
   
   #ifndef ITCLAPI
   #   if defined(BUILD_itcl)
  -#	define ITCLAPI MODULE_SCOPE
  +#	define ITCLAPI
   #   else
   #	define ITCLAPI extern
   #	undef USE_ITCL_STUBS

  Diff finished.  Fri Apr 17 11:13:37 2015

  these symbols are exported (upper case "T"):
      nm itcl4.0.3/libitcl4.0.3.so | grep Register
      0002ecbf t ItclGetRegisteredProcs
      0002e910 T Itcl_RegisterC
      0002ea7f T Itcl_RegisterObjC

  and linking against the shared lib succeeds.

  So question is whether the non-export of the symbols was intentional?

  R'


login: jan.nijtmans
mimetype: text/x-fossil-plain
icomment:
  Yes, it was intentional, see: [https://sourceforge.net/p/incrtcl/feature-requests/9/]

  Just make sure you call Itcl_InitStubs() in your application, and link with BOTH the stub library and the shared library. Then everything will work just fine.


login: ralfixx
mimetype: text/x-fossil-plain
icomment:
  I just found out that the stubs library cant resolve Itcl_RegisterObjc either.
  if I link agains libitclstub.4.0.3.a, I get at *runtime* (instead of compile time when linking against the shared lib directly):

  couldn't load file "./libfoo.so": ./libfoo.so: undefined symbol: Itcl_RegisterObjC
      while executing
  "load ./libfoo.so"
      (file "foo.tcl" line 4)

  Same patch applies I suppose if the stubs-lib wants to lookup the symbols from the shared lib.


login: ralfixx
mimetype: text/x-fossil-plain
icomment:
  Ok, now I get
    gcc -shared -o libfoo.so foo.c -litclstub4.0.3 -litcl4.0.3

    tclsh8.6 
    $ load ./libfoo.so
    couldn't load file "./libfoo.so": ./libfoo.so: undefined symbol: tclStubsPtr

  so I link in addition against tclstub8.6 and get

    gcc -shared -o libfoo.so foo.c -litclstub4.0.3 -litcl4.0.3 -ltclstub8.6
    tclsh8.6 
    $ load ./libfoo.so
    26287 Segmentation fault      (core dumped)

  Itcl_InitStubs calls Tcl_PkgRequireEx directly, which resolves to (tclStubsPtr->tcl_PkgRequireEx) and if I look in the debugger, the table seems to be filled out properly:

    p *tclStubsPtr
    $2 = {magic = -56378673, hooks = 0xb776f0a8 <tclStubHooks>, 
      tcl_PkgProvideEx = 0xb76dd82d <Tcl_PkgProvideEx>, 
      tcl_PkgRequireEx = 0xb76dd9e0 <Tcl_PkgRequireEx>, 
      ...
  but the program crashes nevertheless.

  Only if I add #define USE_TCL_STUBS and call Tcl_InitStubs() myself before calling Itcl_InitStubs() all seems to work well.

  Don't know whether I'm doing something really stupid here...


login: jan.nijtmans
mimetype: text/x-fossil-plain
icomment:
  In this example, it is not necessary to link against the shared library, just the stub library does everything. Everything works as expected, so closing.


login: ralfixx
mimetype: text/x-fossil-plain
icomment:
  itcl 4.0.3 distributed with tcl 8.6.4 on Linux

  Itcl_RegisterC() seems to pass the wrong objc count to the called C-procedure, it is one less than expected (0 for commands which expect no arguments, should be 1).

  Itcl_RegisterObjC() gets it right.

  C-Code:
  --------------------------------
  /* foo.c */
  #define USE_TCL_STUBS
  #include <itcl.h>

  /* TclObj Version */
  static int
  c_obj_call(ClientData clientData, Tcl_Interp*interp, int argc, Tcl_Obj * const argv[]) {
    Tcl_SetObjResult(interp, Tcl_NewIntObj(argc));
    return TCL_OK;
  }

  /* char * version */
  static int
  c_char_call(ClientData clientData, Tcl_Interp*interp, int argc, const char * argv[]) {
    Tcl_SetObjResult(interp, Tcl_NewIntObj(argc));
    return TCL_OK;
  }


  int Foo_Init(Tcl_Interp * interp) {

    if (NULL == Tcl_InitStubs(interp, TCL_VERSION, 0)) {
      return TCL_ERROR;
    }
    if (NULL == Itcl_InitStubs(interp, ITCL_VERSION, 0)) {
      return TCL_ERROR;
    }
    Itcl_RegisterObjC(interp, "foo_ccall", c_obj_call, NULL, NULL);
    Itcl_RegisterC(interp, "foo_charcall", c_char_call, NULL, NULL);
    
    return TCL_OK;
  }
  /* End of file */
  ------------------------------------

  Compile:
    gcc -shared -o libfoo.so foo.c -litclstub4.0.3 -litcl4.0.3 -ltclstub8.6

  Run with following TCL code:

  -----------------------------------
  # foo.tcl
  package require itcl

  load ./libfoo.so

  itcl::class foo {
      public {
  	method c_call {} @foo_ccall
  	method cc_call {} @foo_charcall
      }
  }

  foo a

  puts [a c_call]
  puts [a c_call 1]
  puts [a c_call 1 2]

  puts [a cc_call]
  puts [a cc_call 1]
  puts [a cc_call 1 2]

  # End of file
  ---------------------------------

  $ tclsh8.6 foo.tcl
  1
  2
  3
  0
  1
  2

  I.e. the objc in the C-Char calls are -1 compared to the objc-calls.

  Difference seems to be in ItclBase.c, routine ItclCallCCommand(), which calls 
      result = (*argProc)(cData, interp, objc-2, argv);
  for char-based commands but
       result = (*objProc)(cData, interp, Itcl_GetCallFrameObjc(interp)-1,
  	        Itcl_GetCallFrameObjv(interp)+1);
  The former uses objc-2, where the latter uses objc-1.

  The following patch seems to fix this:

  --- tcl8.6.4/pkgs/itcl4.0.3/generic/itclBase.c~	2015-03-06 19:19:29.000000000 +0100
  +++ tcl8.6.4/pkgs/itcl4.0.3/generic/itclBase.c	2015-04-17 22:03:40.508016715 +0200
  @@ -572,10 +572,10 @@
   	int i;
   
   	argv = (const char**)ckalloc((unsigned)((objc-1)*sizeof(char*)));
  -	for (i=2;i<objc;i++) {
  -	    argv[i-2] = Tcl_GetString(objv[i]);
  +	for (i=1;i<objc;i++) {
  +	    argv[i-1] = Tcl_GetString(objv[i]);
   	}
  -        result = (*argProc)(cData, interp, objc-2, argv);
  +        result = (*argProc)(cData, interp, objc-1, argv);
           ckfree((char*)argv);
       }
       if (objProc != NULL) {

  Diff finished.  Fri Apr 17 22:03:52 2015




  R'


login: dgp
mimetype: text/x-fossil-plain
icomment:
  In ItclClassBaseCmd(), the flags field of an ItclMemberFunc
  is tested for whether the flag ITCL_IMPLEMENT_NONE is set.

  http://core.tcl.tk/itcl/info/07f70b5b42?ln=779

  Trouble is that this flag value is only ever set in the flags
  field of an ItclMemberCode struct, *not* an ItclMemberFunc struct.

  This turns the conditional test into one that is always true, which
  appears to be against the coded intent.

  Suspect that what is meant here is to test this instead:

  if (!(imPtr->codePtr->flags & ITCL_IMPLEMENT_NONE)) {

  so that an additional dereference gets us a struct of the right type.

  Note that would be better written with use of the macro:

  http://core.tcl.tk/itcl/info/a6c3f38589?ln=779

  which improves the clarity.

  So why bother with a ticket?  Because making this "obvious" fix
  produces failures and segfaults in the test suite.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The segfault comes from something apparently totally broken.

  the "functions" hash table stores values of (ItclMemberFunc *).

  However the routine ItclBiObjectUnknownCmd can pull
  values from that hash table, and then start acting on them
  as if they were (ItclDelegatedFunction *) values.

  The two structs do not share a common structure.  Hilarity ensues.

  It seems that without my flags experimenting the test suite just
  doesn't cover cases broken by this error.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Appears the attempt to keep unimplemented methods
  secret from the TclOO machinery was just the wrong
  idea to begin with, so the buggy failure to do so
  was accidentally making things work.

  And masking the broken bit of the unknown method
  handler, that is now fixed.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  First a TclOO example demonstrating this can work.

  oo::class create juggler {
      variable name target
      constructor {_n _t} {
          set name $_n
          set target $_t
      }
      destructor {puts DIE:$name}
      method toss {{value ""}} {
          if {[llength [info level 0]] == 2} {
              set value [yield [info coroutine]]
          }
          if {$value ne ""} {
              puts "$name : $value"
              lassign [yieldto $target [string replace $value end end]] value
              my toss $value
              puts "$name level [info level]"
              return
          }
          rename [info coroutine] {}
          if {[namespace which $target] ne {}} {
              $target ""
          }
          [self] destroy
      }
  }

  coroutine j1 [juggler new Larry [
  coroutine j2 [juggler new Curly [
  coroutine j3 [juggler new Moe j1] toss ]] toss ]] toss Nyuk!Nyuk!Nyuk!

  Translating the same operations to Itcl syntax:

  package require Itcl 4
  itcl::class juggler {
      variable name
      variable target
      constructor {_n _t} {
          set name $_n
          set target $_t
      }
      destructor {puts DIE:$name}
      method toss {{value ""}} {
          if {[llength [info level 0]] == 2} {
              set value [yield [info coroutine]]
          }
          if {$value ne ""} {
              puts "$name : $value"
              lassign [yieldto $target [string replace $value end end]] value
              toss $value
              puts "$name level [info level]"
              return
          }
          rename [info coroutine] {}
          if {[namespace which $target] ne {}} {
              $target ""
          }
          [self] destroy
      }
  }

  coroutine j1 [juggler #auto Larry [
  coroutine j2 [juggler #auto Curly [
  coroutine j3 [juggler #auto Moe j1] toss ]] toss ]] toss Nyuck!Nyuck!Nyuck!

  The TclOO example works.  Itcl fails like so:

  Larry : Nyuck!Nyuck!Nyuck!
  Curly : Nyuck!Nyuck!Nyuck
  Moe : Nyuck!Nyuck!Nyuc
  Larry : Nyuck!Nyuck!Nyu
  cannot yield: C stack busy
      while executing
  "yieldto $target [string replace $value end end]"
      (object "::juggler2" method "::juggler::toss" body line 7)
      invoked from within
  "toss $value"
      (object "::juggler2" method "::juggler::toss" body line 8)
      invoked from within
  "juggler2 toss Nyuck!Nyuck!Nyuck!"
      invoked from within
  "j1 Nyuck!Nyuck!Nyu"
      invoked from within
  "coroutine j1 [juggler #auto Larry [
  coroutine j2 [juggler #auto Curly [
  coroutine j3 [juggler #auto Moe j1] toss ]] toss ]] toss Nyuck!Nyuck!Nyuck!"


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Replace

      toss $value

  with

      [self] toss $value

  and get a different failure (with a shorter arg):

  Larry : TRUE
  Curly : TRU
  Moe : TR
  Larry : T
  DIE:Larry
  context class has vanished 10x0
      (while mapping method name)
      invoked from within
  "info level"
      (object "::juggler0" method "::juggler::toss" body line 9)
      invoked from within
  "[self] toss $value"
      (object "::juggler1" method "::juggler::toss" body line 8)
      invoked from within
  "juggler2 toss TRUE"
      invoked from within
  "$target """
      (method "::juggler::toss" body line 14)
      invoked from within
  "[self] toss $value"
      (method "::juggler::toss" body line 8)
      invoked from within
  "juggler0 toss"
      invoked from within
  "$target """
      (object "::juggler1" method "::juggler::toss" body line 14)
      invoked from within
  "[self] toss $value"
      (object "::juggler0" method "::juggler::toss" body line 8)
      invoked from within
  "juggler1 toss"
      invoked from within
  "::j2 {}"
      invoked from within
  "coroutine j1 [juggler #auto Larry [
  coroutine j2 [juggler #auto Curly [
  coroutine j3 [juggler #auto Moe j1] toss ]] toss ]] toss TRUE"
      (file "i.tcl" line 30)


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Replace 

      toss $value

  with 

      $this toss $value

  and get another failure:

  Larry : TRUE
  Curly : TRU
  Moe : TR
  Larry : T
  invalid command name ""
      while executing
  "$this toss $value"
      (object "::juggler2" method "::juggler::toss" body line 8)
      invoked from within
  "juggler1 toss"
      invoked from within
  "::j2 {}"
      invoked from within
  "coroutine j1 [juggler #auto Larry [
  coroutine j2 [juggler #auto Curly [
  coroutine j3 [juggler #auto Moe j1] toss ]] toss ]] toss TRUE"


login: dgp
mimetype: text/x-fossil-plain
icomment:
  I believe the last example, and likely the last two
  are due to a mismatch in Itcl's assumption that
  Tcl execution is a single stack.  coroutines break
  free of that.

  Itcl seems to store its context information in a stack.

  When the execution loses its correspondence to that
  stack, I suspect getting context info like the value for
  the $this variable fails.

  Suspect the answer will be to stop stacking in Itcl
  and find a way to map call frames to context instead.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Note that there's another issue adding confusion and that
  is the resolution of "info" into [::info] in light of the built-in
  Itcl method info.  Changing all the [info ....] commands to
  [::info ...] commands changes the results again.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The other ticket was getting too many variants, and this
  one is a clean segfault:

  package require Itcl 4
  itcl::class juggler {
      variable name
      variable target
      constructor {_n _t} {
          set name $_n
          set target $_t

          ::proc toss args {
              tailcall my {*}[info level 0]
          }
      }
      method toss {{value ""}} {
          if {[llength [info level 0]] == 2} {
              set value [yield [info coroutine]]
          }
          if {$value ne ""} {
  puts "$name toss $value -- [namespace current]-[namespace which toss]"
              toss $value
          }
      }
  }

  coroutine j1 [juggler #auto Larry [
  coroutine j3 [juggler #auto Moe {}] toss ]] toss X


  Result:
  Larry toss X -- ::juggler-::juggler::
  make: *** [shell] Segmentation fault


  #0  0x000000000054f21b in TclPushProcCallFrame (clientData=0x8b3d00, 
      interp=0x81f6e0, objc=2, objv=0x96ed90, isLambda=0)
      at /home/dgp/fossil/tcl/generic/tclProc.c:1598
  #1  0x000000000054f40d in TclNRInterpProc (clientData=0x8b3d00, 
      interp=0x81f6e0, objc=2, objv=0x96ed90)
      at /home/dgp/fossil/tcl/generic/tclProc.c:1707
  #2  0x0000000000414c40 in Dispatch (data=0x869ee8, interp=0x81f6e0, result=0)
      at /home/dgp/fossil/tcl/generic/tclBasic.c:4360
  #3  0x0000000000414cce in TclNRRunCallbacks (interp=0x81f6e0, result=0, 
      rootPtr=0x0) at /home/dgp/fossil/tcl/generic/tclBasic.c:4393
  #4  0x000000000041442e in Tcl_EvalObjv (interp=0x81f6e0, objc=5, 
      objv=0x82cfe0, flags=2097168)
      at /home/dgp/fossil/tcl/generic/tclBasic.c:4123
  #5  0x0000000000416be8 in TclEvalEx (interp=0x81f6e0, 
      script=0x87e780 "package require Itcl 4\n

  ....
  (gdb) print *procPtr->cmdPtr
  Cannot access memory at address 0x100000080


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Next, take coroutines out by replacing final command with:

  [juggler #auto dgp {}] toss X

  Produces output:

  dgp toss X -- ::juggler-::juggler::toss
  command "toss" already exists in namespace "::juggler"
      while executing
  "error "command \"$m\" already exists in namespace \"$ns\"""
      (class "::itcl::clazz" method "unknown" line 5)
      invoked from within
  "my toss X"
      invoked from within
  "toss $value"
      (object "::juggler0" method "::juggler::toss" body line 7)
      invoked from within
  "[juggler #auto dgp {}] toss X"


  Note that in this case the [namespace which] properly resolves.

  Then the weirdness is why unknown is getting in the picture when
  the "toss" method should already be known.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  FinalizeCreateObject converts all TCL_ERROR codes

  into reraised [return -level 2]

  which is implicitly [return -level 2 -code ok]

  which makes no sense at all.

  It goes to the trouble of calling Tcl_GetReturnOptions()
  then throws it away.  It has some bizarre dance where
  the value of "result" is only captured from Tcl_SetReturnOptions()
  for certain kinds of classes.

  The whole exercise is just a giant red flag that YOU'RE DOING
  IT WRONG.

  Then up in clazzUnknownBody we have to [catch] the TCL_RETURN
  is order to properly convert it back to a TCL_ERROR.

  But the whole clazzUnknownBody invocation of handleClass is
  also broken -- at least in the case where we're using unknown
  in the TclOO style of reacting to an unknown method.  We
  react to a missing method by creating a new instance of the
  class with the name of that method?  WTF?

  Broken broken broken broken.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Commited to branch bug-5ea6971709 a disabling
  of this mess.  Running the test suite with the
  change reveals only changes to stack trace details
  and error messages -- no functional difference at all.

  Whatever problem(s) were believed to be addressed by
  this ugliness are not demonstrated by the test suite.
  I think it's likely they do not exist.

  If they do exist, then for goodness sake, lets solve
  the real problems and not reach for this again.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  A TclOO object is driven by an access command.  Often
  we think that command "is" the object.

  The access command operates exclusively via subcommands,
  and the valid subcommands is determined by all the components
  in the definition of the object, its class, inheritance, etc. etc.

  $object $sub {*}$args

  A TclOO class, including oo::class, is a TclOO object, so it's
  driven by the same sort of command.  It follows that instance
  creation takes on one of these forms:

      $class create $instanceName

      $class new

  In contrast, Itcl casts its instance creation commands in one of the forms:

      $iClass $instanceName

      $iClass #auto

  Since Itcl 4 is implemented so that an Itcl class is a TclOO class, this
  syntax mismatch has to be addressed.  This is the reason the
  clazzUnknownBody does what it does.  To take

      $iClass $instanceName

  as an encounter with an undefined method and convert it into instance generation.

  It's fine that this is done; the problem is that it is also done in other circumstances
  like

      my $unknownMethod

  The unknown body to accommodate Itcl instance creation syntax should be
  more selective in applying its adaptation.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Fix the "unknown" method of Itcl classes so that it is more selective,
  enabling the C++ declaration inspired syntax [$class $instance] without
  taking lots of missteps in the presence of unknown methods as well.
  Patch takes significant effort to preserve error messages, even when in
  my judgment they are sub-par, and better ones would be simpler, just for
  sake of compatibility.  This patch leaves test import-2.5 failing due
  to another bug [f3a2e7407c].


login: dgp
mimetype: text/x-fossil-plain
icomment:
  In Itcl 3:

  % package require Itcl
  3.4
  % namespace eval demo {}
  % itcl::class demo {}
  % itcl::is class demo
  1

  Contrast with Itcl 4:
  % package require Itcl  
  4.0.3
  % namespace eval demo {}
  % itcl::class demo {}
  % itcl::is class demo
  0


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Seems that part of [itcl::is class] is determined by
  looking at the deleteProc of the namespace associated
  with the class and seeing if it's the right routine to
  cover class teardown.

  Apparently if a class is built on top of an existing
  namespace, that isn't set up properly.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  This traces in part to the implementation of TclOO.

  The routine Tcl_NewObjectInstance() accepts an
  argument nsNameStr that is the namespace name
  the caller asks TclOO to use with the created Tcl_Object.

  Trouble is, when this name names a namespace that already
  exists, TclOO will not use that namespace at all, nor will it
  raise an error, but it will create a new namespace as if
  the value nsNameStr==NULL was passed in.

  In turn this is inconsistent with the expectations of Itcl 4,
  which assumes that TclOO has used the namespace Itcl
  asked it to use, and then probes that namespace to examine
  class-i-ness.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  A similar issue arises in itcl object creation:

  % itcl::class C {}
  % C i
  i
  % info object isa object i
  1
  % info object namespace i
  ::oo::Obj13

  Even though a call to Tcl_NewObjectInstance() is what
  creates [i], and that call requests it to have the namespace
  associated with the Itcl class C, TclOO actually creates
  a new auto-generated namespace instead.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  % package require Itcl
  4.0.3
  % itcl::class ::tcl {}
  % itcl::is class ::tcl
  Itcl Assertion failed: "Itcl_IsClassNamespace(nsPtr)" (line 499 of ./generic/itclResolve.c)

  Zoinks!


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Heh.  Even stranger...

  % package require Itcl
  4.0.3
  % itcl::class ::tcl {}
  % set
  Itcl Assertion failed: "Itcl_IsClassNamespace(nsPtr)" (line 499 of /home/dgp/src/tcl8.6.4/pkgs/itcl4.0.3/generic/itclResolve.c)

  #0  0x00007ffff71175d7 in raise () from /lib64/libc.so.6
  #1  0x00007ffff7118cc8 in abort () from /lib64/libc.so.6
  #2  0x000000000053ee47 in Tcl_PanicVA (
      format=0x7fffefb809a8 "Itcl Assertion failed: \"%s\" (line %d of %s)", 
      argList=0x7fffffffcee8) at /home/dgp/fossil/tcl-only/generic/tclPanic.c:123
  #3  0x000000000053eee8 in Tcl_Panic (
      format=0x7fffefb809a8 "Itcl Assertion failed: \"%s\" (line %d of %s)")
      at /home/dgp/fossil/tcl-only/generic/tclPanic.c:153
  #4  0x00007fffefb76e38 in Itcl_ClassCompiledVarResolver ()
     from /home/dgp/x86_64/linuxoldld/lib/itcl4.0.3/libitcl4.0.3.so
  #5  0x000000000054ee31 in InitResolvedLocals (interp=0x81f6e0, 
      codePtr=0x87b290, varPtr=0x82cdc0, nsPtr=0x813990)
      at /home/dgp/fossil/tcl-only/generic/tclProc.c:1278
  #6  0x000000000054f49b in InitArgsAndLocals (interp=0x81f6e0, 
      procNameObj=0x8698b0, skip=1)
      at /home/dgp/fossil/tcl-only/generic/tclProc.c:1551
  #7  0x000000000054f780 in TclNRInterpProcCore (interp=0x81f6e0, 
      procNameObj=0x8698b0, skip=1, errorProc=0x54fdd0 <MakeProcError>)
      at /home/dgp/fossil/tcl-only/generic/tclProc.c:1750
  #8  0x000000000054f73b in TclNRInterpProc (clientData=0x8aeb70, 
      interp=0x81f6e0, objc=2, objv=0x9546f0)
      at /home/dgp/fossil/tcl-only/generic/tclProc.c:1713
  #9  0x0000000000414c40 in Dispatch (data=0x8654d8, interp=0x81f6e0, result=0)
      at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4360
  #10 0x0000000000414cce in TclNRRunCallbacks (interp=0x81f6e0, result=0, 
      rootPtr=0x0) at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4393
  #11 0x000000000041442e in Tcl_EvalObjv (interp=0x81f6e0, objc=3, 
      objv=0x7fffffffd350, flags=131072)
      at /home/dgp/fossil/tcl-only/generic/tclBasic.c:4123
  #12 0x00000000005bee17 in Tcl_RecordAndEvalObj (interp=0x81f6e0, 
      cmdPtr=0x864f00, flags=131072)


login: dgp
mimetype: text/x-fossil-plain
icomment:
  In case it's not clear, the assertions fail because
  Itcl attaches its custom resolvers to the namespace ::tcl
  but does not succeed in actually making it an "Itcl_ClassNamespace"
  due to the reasons illustrated in this ticket.

  There may be a deep incompatibility here.

  TclOO insists on creating a new namespace for each new object.
  It will not re-use an existing one.

  Itcl, on the other hand, explicitly wants to reuse existing
  namespaces for its classes to implement something to do
  with itcl::import::stub and auto-loading.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Fix for the original report is now committed.

  Itcl_FindClass() now consults the namespaceClasses hashtable
  instead of probing through TclOO metadata.  This avoids the
  inconsistency.

  Later symptoms not yet resolved.  They require reconciling 
  the inconsistency.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Stopped passing the class namespace to the
  Tcl_NewObjectInstance() call that creates a new
  instance object of a class.  TclOO will not reuse
  any existing namespace.  Trying to pass one in just
  adds confusion.


login: dgp
mimetype: text/plain
icomment:
  More symptoms of namespace confusion...

  % package require Itcl
  3.4
  % namespace eval Counter {}
  % itcl::class Counter {
      constructor {args} {
        eval configure $args
      }
  }
  % Counter x
  x

  % package require Itcl
  4.0.3
  % namespace eval Counter {}
  % itcl::class Counter {
      constructor {args} {
        eval configure $args
      }
  }
  % Counter x
  invalid command name "configure"


login: dgp
mimetype: text/plain
icomment:
  % package require Itcl
  3.4
  % namespace eval C {}
  % itcl::class C {}
  % rename C {}
  % itcl::class C {}
  % 



  % package require Itcl
  4.0.3
  % namespace eval C {}
  % itcl::class C {}
  % rename C {}
  % itcl::class C {}
  called Tcl_CreateHashEntry on deleted table


login: dgp
mimetype: text/x-fossil-plain
icomment:
  package require Itcl
  namespace eval Counter {}
  itcl::class Counter {
    private common num 0
    proc num {} {return $num}
  }
  Counter::num

  segfaults.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Commit change to bug-f3a2e7407c branch a patch
  that converts segfault to

  can't read "num": no such variable
      while executing
  "return $num"
      invoked from within
  "Counter::num"

  Still wrong.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  All detected functional issues are now fixed on the branch.

  Did not make revisions that appear to be faulty callers
  assumptions about namespaces, nor in the production of error
  messages and stack traces.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  % package require Itcl
  4.0.3
  % itcl::class C {}
  % itcl::class D {inherit C}
  % D::info level
  tailcall can only be called from a proc, lambda or method


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The tailcall came in essentially as a workaround for the bug
  identified in ticket

  http://core.tcl.tk/itcl/tktview?name=d4ee728817

  That was a failure of all of Itcl's "info" command magic to fallback
  to the equivalent of an "::info" invocation.

  Seems the right thing is to go back and fix that bug properly.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Some comparisons with Itcl 3:

  % package present Itcl
  3.4
  % namespace origin C::info
  ::itcl::builtin::info
  % namespace origin D::info
  ::itcl::builtin::info
  % C::info exists tcl_version
  1
  % D::info exists tcl_version
  1
  % C::info args
  wrong # args: should be "C::info args function"
  % D::info args
  wrong # args: should be "D::info args function"


  % package present Itcl
  4.0.3
  % namespace origin C::info
  ::C::info
  % namespace origin D::info
  ::itcl::builtin::info
  % C::info exists tcl_version
  1
  % D::info exists tcl_version
  tailcall can only be called from a proc, lambda or method
  % C::info args
  wrong # args: should be "info args function"
  % D::info args

  get info like this instead: 
    namespace eval className { info args::itcl::builtin::Info::args... }


login: dgp
mimetype: text/x-fossil-plain
icomment:
  More direct demo (easy stomach):

  % info itclinfo derp
  tailcall can only be called from a proc, lambda or method


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The [tailcall] is present because the builtin info method
  has been effectively defined as:

      method info args {
          return [::itcl::builtin::Info {*}$args]
      }

  This definition adds an extra frame, and the tailcall was put
  in to account for that when falling back to [::info].

  Trouble is this broke [itcl::builtin::Info] when used directly
  or via its imports into derived class namespaces.

  The dgp-tailcall branch solve this by implementing the builtin
  info method differently:

      method info args @itcl-builtin-info

  when the @itcl-builtin-info body causes a direct routing to
  the Tcl_ObjCmdProc implementation of the itcl::builtin::Info
  ensemble, without the bother of an enclosing "proc" frame.
  Combined with removal of the [tailcall], this gets the
  [::info] fallbacks correct in all usages.

  Trouble now is that some portions of the [itcl::builtin::Info]
  ensemble have been written so they only function properly in
  the proc-wrapped environment.  This shows up in some test suite
  failures.  These need correcting to get to the complete fix.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  branch is back to running the test suite clean.

  Major code cleanup is still needed, but the concept
  is proven.  Each Itcl class gets its own info method
  so that contexts are separated.  Makes enormous tracts
  of code complexity unnecessary (they are ifdef'ed out
  in the latest commit).


login: dgp
mimetype: text/x-fossil-plain
icomment:
  This fix went wrong.

  Trouble is that it places [::info frame] and [::info level] 
  in the wrong frame when fallen back to.

  This shit is hard.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Don't know what the point of this command is really,
  but it should not do this:

  % package require Itcl
  4.0.3
  % itcl::finish

  % itcl::finish
  make: *** [shell] Segmentation fault: 11


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Worst aspects fixed.

  Still potential to improve the result,
  and the ability to re-[load] after a finish.


login: griffin
mimetype: text/x-fossil-plain
icomment:
  Problem demonstration:

  $ wish8.6 
  % package require itcl 
  4.0.3 
  % option 
  wrong # args: should be "option cmd arg ?arg ...?" 
  % option get . foreground Foreground 
  #000000 
  % itcl::ensemble itcl::delete { part foo {args} {puts Hi!} } 
  % option get . foreground Foreground 
  wrong # args: should be "option name args body"


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Thanks for the patch.

  Itcl 3 sources use Tcl_CreateInterp() call for the same purpose.

  Any reason to choose one over the other?


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Oops!  Did you try this patch?

  ensemble.test


  ==== ensemble-1.4 invoking ensemble parts FAILED
  ==== Contents of test case:

      list [test_numbers one 1] [test_numbers two 2 3] [test_numbers three 3 4 5]

  ---- Test generated error; Return code was: 1
  ---- Return code should have been one of: 0 2
  ---- errorInfo: invalid command name "::itcl::internal::commands::ensembles::9::one"
      while executing
  "test_numbers one 1"
      ("uplevel" body line 2)
      invoked from within
  "uplevel 1 $script"
  ---- errorCode: TCL LOOKUP COMMAND ::itcl::internal::commands::ensembles::9::one
  ==== ensemble-1.4 FAILED



  ==== ensemble-1.5 invoking parts with improper arguments FAILED
  ==== Contents of test case:

      set res [catch "test_numbers three x" msg]
      lappend res [string match "wrong # args*" $msg]

  ---- Result was:
  1 0
  ---- Result should have been (exact matching):
  1 1
  ==== ensemble-1.5 FAILED

  Test file error: child killed: segmentation violation


login: griffin
mimetype: text/x-fossil-plain
icomment:
  I have not tested it yet.  I'm still trying to get my code to execute.  This fix at least get's me past the [source] command and starts running the program.  All I can say right now is that "it compiles." :)


login: dgp
mimetype: text/x-fossil-plain
icomment:
  $ make gdb
  ...
  (gdb) run
  ...
  % package require Itcl 4
  4.0.3
  % itcl::widget W {}
  ::W
  % W create .w

  Program received signal SIGSEGV, Segmentation fault.
  0x0000000000570400 in TclPtrSetVar (interp=0x81e6e0, varPtr=0xb49fc0, 
      arrayPtr=0x0, part1Ptr=0xb4f3e0, part2Ptr=0x0, newValuePtr=0xb4e990, 
      flags=512, index=-1) at /home/dgp/fossil/tcl/generic/tclVar.c:1864
  1864                TclDecrRefCount(oldValuePtr);       /* Discard old value. */
  Missing separate debuginfos, use: debuginfo-install expat-2.1.0-8.el7.x86_64 fontconfig-2.10.95-7.el7.x86_64 freetype-2.4.11-10.el7_1.1.x86_64 glibc-2.17-78.el7.x86_64 libX11-1.6.0-2.1.el7.x86_64 libXScrnSaver-1.2.2-6.1.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.2-2.1.el7.x86_64 libXft-2.3.1-5.1.el7.x86_64 libXrender-0.9.8-2.1.el7.x86_64 libxcb-1.9-5.el7.x86_64 zlib-1.2.7-13.el7.x86_64
  (gdb) bt
  #0  0x0000000000570400 in TclPtrSetVar (interp=0x81e6e0, varPtr=0xb49fc0, 
      arrayPtr=0x0, part1Ptr=0xb4f3e0, part2Ptr=0x0, newValuePtr=0xb4e990, 
      flags=512, index=-1) at /home/dgp/fossil/tcl/generic/tclVar.c:1864
  #1  0x00000000004e8fbe in TEBCresume (data=0xb4f478, interp=0x81e6e0, result=0)
      at /home/dgp/fossil/tcl/generic/tclExecute.c:3573
  #2  0x0000000000414c74 in TclNRRunCallbacks (interp=0x81e6e0, result=0, 
      rootPtr=0xb4eae0) at /home/dgp/fossil/tcl/generic/tclBasic.c:4393
  #3  0x00000000004143de in Tcl_EvalObjv (interp=0x81e6e0, objc=5, 
      objv=0x9fc950, flags=0) at /home/dgp/fossil/tcl/generic/tclBasic.c:4123
  #4  0x00007fffefb6c818 in ItclCreateObject ()
     from /home/dgp/x86_64/linuxoldld/lib/itcl4.0.3/libitcl4.0.3.so
  #5  0x0000000000414c74 in TclNRRunCallbacks (interp=0x81e6e0, result=0, 
      rootPtr=0xb4ea20) at /home/dgp/fossil/tcl/generic/tclBasic.c:4393
  #6  0x00007fffefb4f0c6 in ItclClassCreateObject ()
     from /home/dgp/x86_64/linuxoldld/lib/itcl4.0.3/libitcl4.0.3.so
  #7  0x00007fffefb491df in CallCreateObject ()
     from /home/dgp/x86_64/linuxoldld/lib/itcl4.0.3/libitcl4.0.3.so
  #8  0x0000000000414c74 in TclNRRunCallbacks (interp=0x81e6e0, result=0, 
      rootPtr=0xb4ea20) at /home/dgp/fossil/tcl/generic/tclBasic.c:4393
  #9  0x00007fffefb486cb in PrepareCreateObject ()
     from /home/dgp/x86_64/linuxoldld/lib/itcl4.0.3/libitcl4.0.3.so
  #10 0x00007fffefb48921 in ItclBiClassUnknownCmd ()
     from /home/dgp/x86_64/linuxoldld/lib/itcl4.0.3/libitcl4.0.3.so
  #11 0x0000000000414be6 in Dispatch (data=0xb4e938, interp=0x81e6e0, result=0)
      at /home/dgp/fossil/tcl/generic/tclBasic.c:4360
  #12 0x0000000000414c74 in TclNRRunCallbacks (interp=0x81e6e0, result=0, 
      rootPtr=0x0) at /home/dgp/fossil/tcl/generic/tclBasic.c:4393
  #13 0x000000000041775e in TclEvalObjEx (interp=0x81e6e0, objPtr=0x100000003, 
      flags=131072, invoker=0x0, word=0)
      at /home/dgp/fossil/tcl/generic/tclBasic.c:5959
  #14 0x00000000004176f7 in Tcl_EvalObjEx (interp=0x81e6e0, objPtr=0x100000003, 
      flags=131072) at /home/dgp/fossil/tcl/generic/tclBasic.c:5940
  #15 0x00000000005bd827 in Tcl_RecordAndEvalObj (interp=0x81e6e0, 
      cmdPtr=0x8646e0, flags=131072)
      at /home/dgp/fossil/tcl/generic/tclHistory.c:190
  #16 0x000000000053233a in StdinProc (clientData=0x7fffffffd430, mask=2)
      at /home/dgp/fossil/tcl/generic/tclMain.c:819
  #17 0x0000000000517e11 in Tcl_NotifyChannel (channel=0x881110, mask=2)
      at /home/dgp/fossil/tcl/generic/tclIO.c:8315
  #18 0x000000000058a28b in FileHandlerEventProc (evPtr=0x9fd290, flags=-3)
      at /home/dgp/fossil/tcl/unix/tclUnixNotfy.c:765
  #19 0x0000000000539082 in Tcl_ServiceEvent (flags=-3)
      at /home/dgp/fossil/tcl/generic/tclNotify.c:670
  #20 0x00000000005394be in Tcl_DoOneEvent (flags=-3)
      at /home/dgp/fossil/tcl/generic/tclNotify.c:967
  #21 0x00007fffef82f9e2 in Tk_MainLoop ()
     from /home/dgp/x86_64/linuxoldld/lib/libtk8.6.so
  #22 0x0000000000531ead in Tcl_MainEx (argc=-1, argv=0x7fffffffd630, 
      appInitProc=0x40f236 <Tcl_AppInit>, interp=0x81e6e0)
      at /home/dgp/fossil/tcl/generic/tclMain.c:573
  #23 0x000000000040f22f in main (argc=1, argv=0x7fffffffd628)
      at /home/dgp/fossil/tcl/unix/tclAppInit.c:84


login: dgp
mimetype: text/x-fossil-plain
icomment:
  This segfault is present all the way back to Itcl 4.0b6 (May 2011).

  It's not a regression due to recent developments.

  Trying to go back further gets into sources that no longer compile
  against released Tcl 8.6 (interfaces changed).

  itcl::widget is not a command in Itcl 3.  There's no legacy interest
  in getting this right.

  It appears to be an experiment or work-in-progress that just
  never got successfully completed.

  Letting it sit at low prio for now.


login: wish72
mimetype: text/x-fossil-plain
icomment:
  It's possible to make destructor protected (or private). Inside master interpreter attempt to delete object of such class causes regular error message. But inside slave interpreter it causes signal Aborted. 

  I think it's better to disallow protected destructors (or ignore it's protection), since objects are sometimes deleted impicitly. In my case it was inside Apache with Rivet during shutdown of unneeded Apache idle child worker process.

  Demo:

  $ cat itcl4-protected-destructor.tcl
  puts "Itcl protected destructor effects.."
  puts "Tcl [info patchlevel]"
  interp create slave
  slave eval {
    puts "Itcl [package require Itcl]"
    itcl::class A {protected destructor {}}
    A ::b
    puts "-- itcl::delete object --"
    catch {itcl::delete object ::b} res
    puts $res
    A ::c
  }
  puts "-- namespace delete :: --"
  namespace delete ::

  $ tclsh itcl4-protected-destructor.tcl
  Itcl protected destructor effects..
  Tcl 8.6.4
  Itcl 4.0.3
  -- itcl::delete object --
  bad option "destructor": should be one of...
    b cget -option
    b configure ?-option? ?value -option value...?
    b isa className
  -- namespace delete :: --
  Tcl_AppendStringsToObj called with shared object
  Aborted


login: ferrieux
mimetype: text/x-fossil-plain
icomment:
  In vanilla Tcl, we've optimized normal exits to avoid tedious (and useless) finalizations, while leaving the option to thoroughly finalize for thos who need it.
  The context you mention strikes me as a candidate for such an optimization (cleanup of an unneeded child which is not likely to have interesting unsaved data). If child cleanup occurs with a simple exit() without going through destructor chains, this could have a hefty perf impact on a busy website powered by Rivet. What do you think ?


login: wish72
mimetype: text/x-fossil-plain
icomment:
  There's notable time spent on objects destruction in my application, about 1 second. It's absolutely useless. I'd have no regrets if destructors where not executed on my app exit.

  On the other hand, I don't expect impact on web site perfomance to be hefty. If a site has unneeded idle workers it's CPU isn't 100% loaded at this time, I think.

  $ tclsh8.6
  % time {namespace delete ::}
  701 microseconds per iteration

  $ tclsh8.6
  % lappend auto_path /usr/local/lib/nemo; package require nemoweb
  2.6b3
  % llength [itcl::find objects]
  1659
  % time {namespace delete ::}
  932098 microseconds per iteration


login: ferrieux
mimetype: text/x-fossil-plain
icomment:
  I was rather thinking about end-of-life workers rather than idle (when they have handled the configured max number of requests). These get phased out even on busy workloads.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  #3  0x000000000054e110 in Tcl_Panic (
      format=0x5e409d "%s called with shared object")
      at /home/dgp/fossil/tcl/generic/tclPanic.c:160
  #4  0x00000000005668ce in Tcl_AppendStringsToObjVA (objPtr=0x8d1a48, 
      argList=0x7fffffffc8c8) at /home/dgp/fossil/tcl/generic/tclStringObj.c:1662
  #5  0x00000000005669df in Tcl_AppendStringsToObj (objPtr=0x8d1a48)
      at /home/dgp/fossil/tcl/generic/tclStringObj.c:1701
  #6  0x00007ffff036a53b in ItclMapMethodNameProc ()
     from /home/dgp/x86_64/linuxoldld/lib/itcl4.0.3/libitcl4.0.3.so


  Appears that ItclMapMethodNameProc isn't managing shared values
  properly.


login: rlehfeld
mimetype: text/x-fossil-plain
icomment:
  There is a double free/reference counter decrement of the methodNamePtr in procedure ItclObjectCmd in file itclObject.c. This leads to a crash.
  Problem can be fixed by applying the patch below.

  --- generic/itclObject.c.orig   2015-10-19 15:33:25.479247093 +0200
  +++ generic/itclObject.c        2015-10-19 15:34:31.914399385 +0200
  @@ -2943,12 +2943,12 @@
                  Tcl_DecrRefCount(methodNamePtr);
              }
               methodNamePtr = objv[0];
  -            Tcl_IncrRefCount(methodNamePtr);
           }
       }
       callbackPtr = Itcl_GetCurrentCallbackPtr(interp);
       newObjv = NULL;
       if (methodNamePtr != NULL) {
  +       Tcl_IncrRefCount(methodNamePtr);
          if (iclsPtr->flags & (ITCL_TYPE|ITCL_WIDGETADAPTOR)) {
              char *myName;
              /* special handling for mytypemethod, mymethod, myproc */


login: rlehfeld
mimetype: text/x-fossil-plain
icomment:
  Hi,

  the problem/crash is detected during execution of a complete in house written test suite/framework written in TCL. With this framework I can 100% reproduce this issue and was able to track it back to this location. The internal free obj list in tcl is getting corrupted and had to change the tcl code itself to tell me the exact location when the corruption is happening. This is happening actually at line

  3013:Tcl_DecrRefCount(methodNamePtr)

  after executing line

  3001:Tcl_NRAddCallback(interp, CallPublicObjectCmd, oPtr, clsPtr,
  	        INT2PTR(objc+incr), newObjv)

  in which the reference was already decremented. Once I created/applied the patch, all code actually whole test suite is running fine. Unfortunately I did not manage to reproduce the issue outside independent of the test suite even though the bug is logical but it is difficult to trigger the free list to reach the same state so that script/tcl will stumble across it :-(

  Best Regards

  René


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Trying to reverse engineer just what the hell
  a "widgetadaptor" is....


  % itcl::widgetadaptor C {}
  ::C
  % C
  wrong # args: should be "C unknown "
  % C foo
  make: *** [shell] Segmentation fault

  Do we really need to keep all these new things?


login: dgp
mimetype: text/x-fossil-plain
icomment:
  That was a simple failure to do some DString init.

  Now on to the next:

  %  itcl::widget W {}
  ::W
  % [New Thread 0x7fffee923700 (LWP 23084)]
  W .bar

  Program received signal SIGSEGV, Segmentation fault.


  This is proving to me these are all untested and
  unused experiments.  Really building up a head of
  steam to raze all the new stuff.  Please offer a
  reason not to do so.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Sorry this is a new regression due to revised
  ordering in recent commit and failure to handle
  unknown internals dependence in the script library.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  It's possible I might have caught this regression
  sooner, but for the "tk" constraint on the widget* tests.

  Digging deeper now, though, it looks like these tests have
  been failing a long time.

  % package present Itcl
  4.0.0
  % itcl::widget myframe {}
  ::myframe
  % myframe create .frm
  make: *** [shell] Segmentation fault


login: dgp
mimetype: text/x-fossil-plain
icomment:
  itcl::widget got broken by checkin:

  http://core.tcl.tk/itcl/info/f6d40ccd8ad787a3

  Long before I got into any serious tinkering.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  That was the introduction of

  http://core.tcl.tk/itcl/info/abeae90b4c

  already fixed in

  http://core.tcl.tk/itcl/ci/73f266f4a188ffbd


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Using checkin [37240415b3] (2015-12-04), the widget*.test files
  can be tested with:

  path/to/wish tests/all.tcl -load "load ./libitcl4.0.3.so"

  All tests run and pass.

  Starting with the next checkin, revisions were made to
  the internal namespace arrangements and things broke.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Found a way to fix bugs without breaking this new stuff.
  Routine tests are turned back on, so should be less chance
  of repeating the breakage.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  On the current trunk, with debug testing:

  package require Itcl
  package require Tk
  itcl::widgetadaptor W {
  constructor {args} {error foo}
  destructor {}
  }
  W .w

  Program received signal SIGSEGV, Segmentation fault.
  0x000000000059dae0 in TclOOObjectCmdCore (oPtr=0xd4f718, interp=0x822378, 
      objc=2, objv=0xd526d8, flags=1, startCls=0xca5d88)
      at /home/dgp/fossil/tcl/generic/tclOO.c:2555
  2555            result = oPtr->mapMethodNameProc(interp, (Tcl_Object) oPtr,
  Missing separate debuginfos, use: debuginfo-install expat-2.1.0-8.el7.x86_64 fontconfig-2.10.95-7.el7.x86_64 freetype-2.4.11-11.el7.x86_64 glibc-2.17-106.el7_2.1.x86_64 libX11-1.6.3-2.el7.x86_64 libXScrnSaver-1.2.2-6.1.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.3-3.el7.x86_64 libXft-2.3.2-2.el7.x86_64 libXrender-0.9.8-2.1.el7.x86_64 libxcb-1.11-4.el7.x86_64 zlib-1.2.7-15.el7.x86_64
  (gdb) bt
  #0  0x000000000059dae0 in TclOOObjectCmdCore (oPtr=0xd4f718, interp=0x822378, 
      objc=2, objv=0xd526d8, flags=1, startCls=0xca5d88)
      at /home/dgp/fossil/tcl/generic/tclOO.c:2555
  #1  0x000000000059da07 in TclOOInvokeObject (interp=0x822378, object=0xd4f718, 
      startCls=0xca5d88, publicPrivate=1, objc=2, objv=0xd526d8)
      at /home/dgp/fossil/tcl/generic/tclOO.c:2495
  #2  0x00007ffff0325021 in Itcl_PublicObjectCmd (clientData=0xd4f718, 
      interp=0x822378, clsPtr=0xca5d88, objc=2, objv=0xd526d8)
      at ./generic/itcl2TclOO.c:223
  #3  0x00007ffff035f990 in CallPublicObjectCmd (data=0xd51220, interp=0x822378, 
      result=0) at ./generic/itclObject.c:2888
  #4  0x0000000000414cf8 in TclNRRunCallbacks (interp=0x822378, result=0, 
      rootPtr=0xccb468) at /home/dgp/fossil/tcl/generic/tclBasic.c:4386
  #5  0x00007ffff0324ac4 in Itcl_NRRunCallbacks (interp=0x822378, 
      rootPtr=0xccb468) at ./generic/itcl2TclOO.c:28
  #6  0x00007ffff0360246 in ItclObjectCmd (clientData=0x9e39b8, interp=0x822378, 
      oPtr=0xd4f718, clsPtr=0xca5d88, objc=2, objv=0xd526d8)
      at ./generic/itclObject.c:3083
  #7  0x00007ffff0355f9e in CallItclObjectCmd (data=0xd52820, interp=0x822378, 
      result=0) at ./generic/itclMethod.c:1193
  #8  0x0000000000414cf8 in TclNRRunCallbacks (interp=0x822378, result=0, 
      rootPtr=0xccb468) at /home/dgp/fossil/tcl/generic/tclBasic.c:4386
  #9  0x00007ffff0324ac4 in Itcl_NRRunCallbacks (interp=0x822378, 
      rootPtr=0xccb468) at ./generic/itcl2TclOO.c:28
  #10 0x00007ffff035635e in Itcl_EvalMemberCode (interp=0x822378, 
      imPtr=0x9e39b8, contextIoPtr=0xd4f3d8, objc=2, objv=0xd526d8)
      at ./generic/itclMethod.c:1324
  #11 0x00007ffff0357717 in Itcl_InvokeMethodIfExists (interp=0x822378, 
      name=0x7ffff0377784 "destructor", contextClassPtr=0x9fa7d8, 
      contextObjectPtr=0xd4f3d8, objc=0, objv=0x0) at ./generic/itclMethod.c:1996
  #12 0x00007ffff035d5d6 in ItclDestructBase (interp=0x822378, 
      contextIoPtr=0xd4f3d8, contextIclsPtr=0x9fa7d8, flags=2)
      at ./generic/itclObject.c:1608
  #13 0x00007ffff035d2db in CallDestructBase (data=0xd4f100, interp=0x822378, 
      result=0) at ./generic/itclObject.c:1492
  #14 0x0000000000414cf8 in TclNRRunCallbacks (interp=0x822378, result=0, 
      rootPtr=0xbccbd8) at /home/dgp/fossil/tcl/generic/tclBasic.c:4386
  #15 0x00007ffff0324ac4 in Itcl_NRRunCallbacks (interp=0x822378, 
      rootPtr=0xbccbd8) at ./generic/itcl2TclOO.c:28
  #16 0x00007ffff035d548 in Itcl_DestructObject (interp=0x822378, 
      contextIoPtr=0xd4f3d8, flags=2) at ./generic/itclObject.c:1568
  #17 0x00007ffff035f4c6 in ItclDestroyObject (cdata=0xd4f3d8)
      at ./generic/itclObject.c:2769
  #18 0x000000000041326f in Tcl_DeleteCommandFromToken (interp=0x822378, 
      cmd=0xd4fa18) at /home/dgp/fossil/tcl/generic/tclBasic.c:3125
  #19 0x00007ffff035acf2 in ItclCreateObject (interp=0x822378, 
      name=0x91ebe8 ".w", iclsPtr=0x9fa7d8, objc=0, objv=0xd4f198)
      at ./generic/itclObject.c:493


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The trouble is that the (TclObject *) oPtr has
  already been freed at the time we try to access its
  fields during Itcl destructor method invocation.
  Something has gone wrong with refcounting.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Itcl uses a delete trace on the access command
  to get destructors triggered before the oPtr is
  freed.

  This isn't working for widgetadaptors because
  they play a rename dance during construction
  so the wrong command is traced.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  % itcl::class N::B {}
  % itcl::class N {}
  can't create namespace "::itcl::internal::variables::N": already existsITCL: cannot create variables namespace "::itcl::internal::variables::N"


login: griffin
mimetype: text/x-fossil-plain
icomment:
  This example straight out of incrTcl FAQ (http://incrtcl.sourceforge.net/itcl/FAQ.html#itcl-vars-3)

  $ tclsh8.6     
  % package require itcl
  4.0.3
  % itcl::class Foo {
      private common colors
          array set colors {
              red #ff0000
              green #00ff00
              blue #0000ff
          }
  }
  % 
  % set ::Foo::colors
  can't read "::Foo::colors": no such variable
  % array get ::Foo::colors
  % parray ::Foo::colors
  "::Foo::colors" isn't an array

  Older incrTcl:
  $ tclsh8.5
  % package require Itcl
  3.4
  % itcl::class Foo {
      private common colors
          array set colors {
              red #ff0000
              green #00ff00
              blue #0000ff
          }
  }
  % 
  % set Foo::colors
  can't read "Foo::colors": variable is array
  % parray Foo::colors
  Foo::colors(blue)  = #0000ff
  Foo::colors(green) = #00ff00
  Foo::colors(red)   = #ff0000


login: griffin
mimetype: text/x-fossil-plain
icomment:
  Never mind.  Visibility keyword was basically ignored in version 3.4.  This is no longer the case.  A *public* common is visible just find, thank you very much!

  I withdraw my complaint.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  > What is the [info variable] method failing to do?

  It provides no access to the value of the variable.  The [info variable $var -value] only works for scalars.

  % package require Itcl 3
  3.4
  % itcl::class C {
  variable a
  variable b
  constructor {} {
      array set a {1 2}
      set b scalar
  }
  }
  % C c
  c
  % c info variable
  ::C::this ::C::a ::C::b
  % c info variable a -type
  variable
  % c info variable b -type
  variable
  % c info variable b -value
  scalar
  % c info variable a -value
  <undefined>
  % c info variable a(1) -value
  "a(1)" isn't a variable in class "::C"


login: schmitzu
mimetype: text/x-fossil-plain
icomment:
  On clt I suggested a "-scope" option for "info variable" command
  to gain acces to the variable. I've implemented it in itclInfo.c
  and it works for me. I can supply a patch if desired. But, it's
  far from beeing perfect. An expert has to review it, before it
  can go into the code base.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Feel free to attach a patch here.

  If you prefer to push onto a fossil branch, we can set you up
  with the access to do that.


login: schmitzu
mimetype: text/x-fossil-plain
icomment:
  I've attached a patch for adding the -scope option to info variable.
  The code ist copied from Itcl_ScopeCmd() and slightly modified
  to work in the info environment. As written before, it's not perfect
  and should only demonstrate a path to fix this ticket.
  With this patch it isn't possible to get the scope of
  single array variables, only the name of the whole array works.
  Also I've done very few tests. If this is the way to go,
  I'm willing to put more work in this solution.

  I attach a little test script infoVariableScopeUsage.tcl which
  demonstrates the usage of -scope option.

  The output of my patched version of Itcl4.1.1:

  Itcl=4.1.1
  _baseV1    scope = ::itcl::internal::variables::oo::Obj15::Base::_baseV1
  _baseArray scope = ::itcl::internal::variables::oo::Obj15::Base::_baseArray
  _baseArray get   = two 2 one 1


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Created a new branch bug-050ac21f72 out of the contributed patch
  for later review.

  Appears the branch doesn't build as is, but gives a good starting
  point.


login: schmitzu
mimetype: text/x-fossil-plain
icomment:
  Sorry, the patch contained a little typo.
  I've uploaded a new patch which hopefully
  will work now.
  Again, sorry for the inconvenience!


login: schmitzu
mimetype: text/x-fossil-plain
icomment:
  Don,

  just saw that you are preparing a new release. Is there
  any chance to get the proposed patch into this release?
  Can I be of any help?
  Thanks in advance.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The prod of a comment here helps, thanks.

  I took the repaired patch and made a new bugfix branch.
  Can confirm that it builds. Only testing issues are those
  caused by expected changes in error messages.

  Since this is a new feature and not just a bug fix, I'll
  ask for some other opinions on it. Given that, it won't
  go into the 4.1.2 release, but with positive opinions could
  go into the next 4.2 release. We don't need a full TIP system
  to develop Itcl, I don't think, but wise comments from multiple
  users would help me have confidence the feature is sensible.


login: griffin
mimetype: text/x-fossil-plain
icomment:
  I am satisfied with this approach.  Access to the scope'd variable will allow all Tcl based introspection which is the point of the ticket, I believe.


login: schmitzu
mimetype: text/x-fossil-plain
icomment:
  I've adjusted the tests and added some new ones.
  Also I tried to adjust the documentation.
  Should I upload the files here?


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Here's a short demo:

  ::itcl::class B {
     method act {args} {puts B:$args}
  }
  ::itcl::class D {
     inherit B 
     method act {args} {puts D:$args; chain}
  }
  [D d] act Now!


login: anonymous
mimetype: text/x-fossil-plain
icomment:
  "info inherit" executed in class namespace causes a crash (Tcl8.6.4, Itcl4.0.3, Windows7) while it used to work under Itcl3.4. Minimal example:
  itcl::class a {}
  itcl::class b {inherit a}
  namespace eval b info heritage
  ::b ::a
  (-> works as expected)
  namespace eval b info inherit
  (-> crashes under Itcl4.0.3, returns ::a under Itcl3.4)

  The command "namespace eval b info vars" also causes a crash.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Cannot reproduce with Tcl 8.6.5 and Itcl 4.0.4.  Please update
  to get the bug fixes already in place.


login: starseeker
mimetype: text/x-fossil-plain
icomment:
  I'm unsure whether this was intended behavior of itcl3, but it looks like variable values within class definitions were readable as variables. The following file sources without error using itcl3, but itcl4 doesn't accept it

  http://brlcad.org/~starseeker/itcl4_behavior_change.tcl

  The report when sourcing in itcl4 is:

  "can't read "Class1::SystemWindowFont": no such variable"

  (the same is true for common LocalFont $::Class1::SystemWindowFont as well - explicitly querying the global namespace doesn't appear to have an impact.)

  It may be that this only worked accidentally with itcl3 - if that's the case we can alter our code, but it would be good to know definitively.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  % itcl::class C {common v 1}
  % namespace eval C {set v}
  1
  % set C::v
  can't read "C::v": no such variable


login: dgp
mimetype: text/x-fossil-plain
icomment:
  % namespace eval C {namespace which -variable v}
  ::itcl::internal::variables::C::v
  % namespace which -variable C::v
  %

  This suggests non-obvious behavior in the Tcl roots
  of variable name resolution is at the bottom of this.

  At least this might offer a clue how you could work
  around things.


login: oehhar
mimetype: text/x-fossil-plain
icomment:
  Test "sfbug-254" fails as follows:
  <verbatim>
  ==== sfbug-254 SF bug #254 FAILED
  ==== Contents of test case:

      set interp [interp create]
      $interp eval {
        package require itcl

        set ::test_status ""
        oo::class destroy
        lappend ::test_status "::oo::class destroy worked"
      }

  ---- Test generated error; Return code was: 1
  ---- Return code should have been one of: 0 2
  ---- errorInfo: can't find package itcl
      while executing
  "package require itcl"
      invoked from within
  "$interp eval {
        package require itcl

        set ::test_status ""
        oo::class destroy
        lappend ::test_status "::oo::class destroy worked"..."
      ("uplevel" body line 3)
      invoked from within
  "uplevel 1 $script"
  ---- errorCode: TCL PACKAGE UNFOUND
  ==== sfbug-254 FAILED
  </verbatim>

  System:
     *   Win 10 64 bit GER
     *   itcl4.0.5 in tcl8.6.6rc1
     *   MS-VC++ + PSDK2003SP1 32 bit, Makefile.vc


login: dgp
mimetype: text/x-fossil-plain
icomment:
  ok, this is a testing error.  For some reason the built
  code is not available properly to the testing engine.
  I'll need a contributed fix.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  This is not windows issue and can affect every system where Itcl is basically not installed (resp. pkgIndex could not be found in library paths).

  For example just compile (itcl), then without installation try to test it, like:
  <code><pre>
  $ cd $prj/itcl4/unix/build; make --with-tcl=$prj/tcl8.6/unix/build
  $ cd $prj/itcl4
  $ $prj/tcl8.6/unix/build/tclsh ./tests/all.tcl -load 'load $prj/itcl4/unix/build/libitcl.so itcl'
  </pre></code>
  will pass each test, excepting "sfbug-254" and "sfbug-257", just because child interpreter would not be able to find itcl-package.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  Should be fixed now in [87a89c9a927db943].

  @Harald, can you test this?

  Thus I'll close this ticket now (please reopen if I'm wrong).


login: oehhar
username: oehhar
mimetype: text/x-fossil-wiki
icomment:
  Thank you, sebres, for the homework.

  Action taken:

     *   tcl8.6.9 file distribution
     *   Removed anything under pkgs\itcl4.1.2
     *   downloaded ITCL commit [0155e66402] as zip
     *   put the folder contents to pkgs\itcl4.1.2
     *   cd tcl8.6.9\win
     *   nmake -f Makefile.vc
     *   nmake -f Makefile.vc test TESTFLAGS="-verbose bte" > testlog_tcl8.6.9_itcl_0155e66402.txt 2>&1
     *   nmake -f Makefile.vc install INSTALLDIR=c:\test\tcl869_itcl_0155e66402
     *   start tclsh, package require Itcl -> 4.1.2

  The test failures are fixed, thank you, good work !

  Harald


login: oehhar
mimetype: text/x-fossil-wiki
icomment:
  Test "sfbug-257" fails as follows:
  <verbatim>
  ==== sfbug-257 SF bug #257 FAILED
  ==== Contents of test case:

      set interp [interp create]
      $interp eval {
        package require itcl
        set ::test_status ""
        ::itcl::class ::cl1 {
          method m1 {} {
            ::oo::class destroy
            lappend ::test_status "method Hello World"
          }
          proc p1 {} {
            lappend ::test_status "proc Hello World"
          }
        }
        set obj1 [::cl1 #auto]
        ::cl1::p1
        $obj1 p1
        $obj1 m1
    
        catch {
        $obj1 m1
        ::cl1::p1
        } msg
        lappend ::test_status $msg
      }

  ---- Test generated error; Return code was: 1
  ---- Return code should have been one of: 0 2
  ---- errorInfo: can't find package itcl
      while executing
  "package require itcl"
      invoked from within
  "$interp eval {
        package require itcl
        set ::test_status ""
        ::itcl::class ::cl1 {
          method m1 {} {
            ::oo::class destroy
  ..."
      ("uplevel" body line 3)
      invoked from within
  "uplevel 1 $script"
  ---- errorCode: TCL PACKAGE UNFOUND
  ==== sfbug-257 FAILED
  </verbatim>

  System:
     *   Win 10 64 bit GER
     *   Itcl4.0.5 in tcl8.6.6rc1
     *   MS-VC++ + PSDK2003SP1 32 bit, Makefile.vc


login: dgp
mimetype: text/x-fossil-plain
icomment:
  % package require Itcl 3 
  3.4
  % itcl::class C {method info {} {}}

  % package require Itcl
  4.0.5
  % itcl::class C {method info {} {}}
  "info" already defined in class "::C"

  This will degrade the ability of code
  written for Itcl 3 to migrate to Itcl 4
  if it contains methods named 'info'.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Fixed on trunk.

  There's non-negligible risk that the
  changes to fix this introduced new bugs
  so testing is encouraged.

  So long as there's not new breakage though,
  I think this is a good path forward to implement
  more of Itcl's builtins via inheritance from a
  TclOO superclass, instead of via methods 
  bolted on to each Itcl object.


login: anonymous
mimetype: text/x-fossil-plain
icomment:
  The directory tclconfig with its contents is missing from the distribution so that it is not possible to build Itcl from scratch.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The directory tclconfig is included in
  the Itcl source code releases.

  I think you are talking about the files
  available after a `fossil open`.

  tclconfig/TEA is a separate project.
  Thus, you `fossil open` it separately.

  See 

  http://core.tcl.tk/itcl/wiki?name=Tracking+Itcl+Sources


login: dgp
mimetype: text/x-fossil-plain
icomment:
  puts "Itcl [package require Itcl]"
  itcl::class B {                                                                 
      common c                                                                    
      method v {} {itcl::scope c}                                                 
  }                                                                               
  itcl::class D {                                                                 
      inherit B                                                                   
      method v {} {itcl::scope c}                                                 
  }                                                                               
  B b                                                                             
  D d                                                                             
  puts "Should be 1: [string equal [b v] [d v]]"  

  Compare:

  Itcl 3.4
  Should be 1: 1

  Itcl 4.0.5                                                                      
  Should be 1: 0


login: anonymous
mimetype: text/x-fossil-plain
icomment:
  Today I tried to mix itcl and snit and got a strange type of crash resulting in the Message "UpdateStringProc should not be invoked for type TCLOO method name"

  I'm using itcl 4.0.x (tried 4.0.2 and 4.0.5), Snit (0.97 or 2.3.x) and TCLKit 8.6.3 (or 8.6.6) under windows (or wine)
  the following code produces the error if you call snt doit xxx TWICE. Yes, twice, so first call is ok, second call gets the fatal error...
  It's not snit, but itcl it seems, since under Itcl 3.4 this does not show up.
  Code:

  package require Itcl
  package require snit

  itcl::class itcl_test {
      method doit {t} {
          puts "ok, running $t"
      }
  }

  snit::type snit_test {
      delegate method doit to itcltest
      
      constructor {} {
          install itcltest using ::itcl_test ${selfns}::#auto 
      }
  }
  console show
  snit_test snt

  #snt doit xxx; ##ok 
  #snt doit xxx; ##UpdateStringProc should not be invoked for type TCLOO method name


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Reproduced. Thank you for the report.

  Hope to find to time to dig deeper after
  the Tcl conference.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Suspect there may be another contributing bug lurking here,
  maybe in Itcl 4.  The TclOO flaw is triggered only because
  the Tcl_Obj holding a method name got passed in without
  having any string rep.  TclOO ought to be robust against
  that possibility, but it also raises the Q of how that can happen.
  From appearances, this method name ought to be a shared
  literal, and those should always always have a string rep.
  Before closing this for good we should check that one isn't
  lost here due to some other flaw.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  In the demo script, the command [snt] is
  created as an ensemble by snit, with subcommands
  defined by the -map mechanism.  In particular
  there's an entry like:

      doit -> $i doit

  where $i holds an instance of the Itcl class
  itcl_test and the "doit" stored in the value
  of the map entry has been generated by a
  [string map] templating pass over the "doit"
  key value.  By quirks of shimmering, the "doit"
  key value has the "string" type, and the [string map]
  produces a new "doit" value that *only* has
  the "string" internalRep -- no string rep at all,
  which primes the context to discover the TclOO bug.

  It's an unusual circumstance, but not illegit.

  Suggests there's a way to demo this using only
  Tcl without Itcl and snit, but I'll leave that
  to others.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  itcl::class C {
      proc p {} {info vars}
  }
  C::p

  <SEGFAULT!>

  This is simplified demo of
  ticket first submitted to 
  the Tcl ticket system.

  https://core.tcl.tk/tcl/tktview/551061651d07944a19c76706530f51ea67b9abae


login: dgp
mimetype: text/x-fossil-plain
icomment:
  TclOO has an internal flag FRAME_IS_METHOD it uses
  to mark CallFrame s that have a CallContext attached
  to them.

  Itcl was improperly marking CallFrame s with this flag
  even for public class procs which lack the CallContext.
  When the assumptions attached to the flag value failed,
  a NULL dereference and segfault is the result.

  Fixed by making Itcl 4.0.6 stop doing bad things.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Demonstration script:

  puts "Tcl  version : [package present Tcl]"
  puts "Itcl version : [package require Itcl]"

  itcl::class M {
    variable foo M
    method eval script {uplevel 1 $script}
  }
  M m

  itcl::class C {
    variable foo C
    method demo {varName} {
      set script [subst -nocommands {
          puts [namespace which -variable $varName]
          puts "FOO is [set $varName]\n"
      }]
      uplevel 1 $script
      uplevel 1 [list m eval $script]
    }
  }
  C c

  itcl::class D {
    variable foo D
    method demo {} {
      c demo foo
      puts [namespace which -variable foo]\n
      c demo this
      puts [namespace which -variable this]
    }
  }
  D d
  d demo 

  Results from Itcl 3.4.3:

  Tcl  version : 8.6.7
  Itcl version : 3.4

  FOO is D


  FOO is D




  FOO is ::d


  FOO is ::d



  Results from Itcl 4.0.6:

  Tcl  version : 8.6.7
  Itcl version : 4.0.6
  ::itcl::internal::variables::oo::Obj18::D::foo
  FOO is D

  ::itcl::internal::variables::oo::Obj18::D::foo
  FOO is D

  ::itcl::internal::variables::oo::Obj18::D::foo

  ::itcl::internal::variables::oo::Obj16::C::this
  FOO is ::c

  ::itcl::internal::variables::oo::Obj14::M::this
  FOO is ::m

  ::itcl::internal::variables::oo::Obj18::D::this


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The feature branch dgp-method-type does not
  suffer from this bug.  

  The same failed Itcl Stack design that prevents
  proper NRE-enabling is also causing this failure.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  It appears this is a revisit of the issues ironed
  out two years ago in the branch dgp-frame-context.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Fixed by merging dgp-method-type and declaring
  the result to be Itcl 4.1.0.

  Update to Itcl 4.1.0 when released to fix this issue.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  itcl::class C {
    proc cheshire {} {
      itcl::body ::C::cheshire {} {}
    }
    constructor {args} {
      cheshire
    }
  }
  while 1 {
    itcl::delete object [C #auto]
  }


login: dgp
mimetype: text/x-fossil-plain
icomment:
  This started segfaulting with checkin

  http://core.tcl.tk/itcl/ci/a4b7fff898598267?sbs=1

  Before that it just failed, which was also wrong:

  Itcl 4.0.4
  member function "::C::cheshire" is not defined and cannot be autoloaded
      while executing
  "cheshire"
      while constructing object "::c1" in ::C::constructor (body line 3)
      invoked from within
  "::itcl::parser::handleClass C ::C #auto"
      invoked from within
  "C #auto"
      ("while" body line 2)
      invoked from within
  "while 1 {
    itcl::delete object [C #auto]
  }"
      (file "/home/dgp/cheshire.tcl" line 12)


login: dgp
mimetype: text/x-fossil-plain
icomment:
  At least part of the problem here is that
  imPtr->codePtr gets a new value in the
  middle of the evaluation of imPtr.  This
  causes the Release in the After to be on
  a different pointer than the Preserve
  in the CheckCall.  Things get out of balance,
  and that leads to crashes and memory trouble.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Removed the Preserve/Release pairs that were going wrong.

  The reference in the ItclMemberFunc ought to be enough.


login: wiede
mimetype: text/x-fossil-plain
icomment:
  package require itcl 4.1.0

  ::itcl::extendedclass Pushbutton {
    constructor {args} {}
    option [list -borderwidth borderWidth BorderWidth] -default 2
  }

  ::itcl::body Pushbutton::constructor {args} {
    set win [createhull frame $this -class [info class]]
  puts stderr "win: $win"
    set val2a [info option -borderwidth -resource]
  puts stderr "val2a: $val2a"
    set val2b [namespace eval ::Pushbutton info class]
  puts stderr "val2b: $val2b"
    # the next one crashes in Itcl_BiInfoMethodCmd in generic/itclInfo.c in Tcl_FindHashEntry
    # as contextIlsPtr == NULL
    #
    # /*
    #  *  Return info for a specific command.
    #  */
    # if (cmdName) {
    #     ItclCmdLookup *clookup;
    #     objPtr = Tcl_NewStringObj(cmdName, -1);
    #     hPtr = Tcl_FindHashEntry(&contextIclsPtr->resolveCmds, (char *)objPtr);
    #
    # The reason is that  Itcl_GetContext can no longer detect the ioContext from infoPtr->contextStack
    # as contextStack is no longer available as it was in version 4.0.3 see code below
    #
    # callContextPtr = Itcl_PeekStack(&infoPtr->contextStack);
    # if ((callContextPtr != NULL) && (callContextPtr->imPtr != NULL)) {
    #     *iclsPtrPtr = callContextPtr->imPtr->iclsPtr;
    # } else {
    #     hPtr = Tcl_FindHashEntry(&infoPtr->namespaceClasses,
    #             (char *)activeNs);
    #     if (hPtr != NULL) {
    #         *iclsPtrPtr = (ItclClass *)Tcl_GetHashValue(hPtr);
    #     }
    # }
    #
    # In that version if Tcl_FindHashEntry returned hptr == NULL, then ioPtrPtr
    # was filled like so:
    # if ((*ioPtrPtr == NULL) && ((*iclsPtrPtr)->nsPtr != NULL)) {
    #     /* maybe we are in a constructor try currIoPtr */
    #     *ioPtrPtr = (*iclsPtrPtr)->infoPtr->currIoPtr;
    # }
    #
    set val2c [namespace eval ::Pushbutton info option -borderwidth -resource]
  puts stderr "val2c: $val2c"
  }

  Pushbutton .pb
  pack .pb


login: dgp
mimetype: text/x-fossil-plain
icomment:
  The crash could be remedied by putting in the protection code
  in [info option] so that it can operate without crashing when it
  is called in a context where no "current object" can be resolved.
  As written, it assumes a current object can always be resolved
  and that's false.

  That won't take care of things though. Recent changes in the
  TclOO foundations have broken the itcl::extendedclass outside
  of that.  Try Itcl 4.0.6 with tip of core-8-6-branch and the demo
  script here. You now get an error:

  namespace "::Pushbutton" is not a class namespace
      while executing
  "createhull frame $this -class [info class]"
      while constructing object "::.pb" in ::Pushbutton::constructor (body line 7)
      invoked from within
  "::itcl::parser::handleClass Pushbutton ::Pushbutton .pb"
      invoked from within
  "Pushbutton .pb"

  itcl::extendedclass will have to get a maintainer to keep up
  with other changes in TclOO and Itcl or it will have to die.
  It is a new command in Itcl 4. I have no interest in it. The
  codebase that implements it is an indecipherable mess I cannot
  deal with any longer. No one migrating from Itcl 3 needs it. I've
  wasted too much time on it now already.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  opening this up again. I got extremely frustrated because I was trying
  to do something impossible -- not understanding all the interwoven
  dependencies at play here.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  So, with the internals revisions to namespaces an TclOO that will be part
  of Tcl 8.6.9+ and Tcl 8.7a3+ the earliest Itcl 4 that can possibly work
  is Itcl 4.1.1 which contains the corresponding reforms.  All the work trying
  to figure out precise why Itcl 4.0.6 would not work with Tcl 8.6.9 was
  just a terrible waste of time. It doesn't work. Itcl 4 users have to keep up.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Just to demonstrate this is a pre-existing problem, and not
  something new in Itcl 4.1.* ...

  % package present Tcl
  8.6.8
  % package require -exact itcl 4.0.6
  4.0.6
  % ::itcl::extendedclass Pushbutton {
    constructor {args} {}
    option [list -borderwidth borderWidth BorderWidth] -default 2
  }
  % namespace eval Pushbutton info option -borderwidth
  Segmentation fault


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Revised Itcl_GetContext() to make Itcl 4.1 acts like Itcl 4.0 on the submitted script.

  No test suite failures.

  Gonna take it on faith, since I don't understand it.


login: anonymous
mimetype: text/x-fossil-plain
icomment:
  Hi! Appears that the following code behaves differently in Itcl 3 and 4:

  itcl::class a {
      constructor {args} {}
      public method a {}
  }

  itcl::body a::constructor {args} {
      puts "a::constructor $args"
      b ::newb
  }

  itcl::body a::a {} {
      puts "a::a"
  }

  itcl::class b {
      constructor {args} {}
  }

  itcl::body b::constructor {args} {
      puts "b::constructor $args"
      a::a
  }

  a newa

  (it's a minimal example which reproduces the problem). Specifically, in Itcl 3 the code works fine and prints

  a::constructor 
  b::constructor 
  a::a

  but in Itcl 4 it emits the error:

  a::constructor 
  b::constructor 
  bad option "a": should be one of...
    newb cget -option
    newb configure ?-option? ?value -option value...?
    newb isa className
      while executing
  "a::a"
      while constructing object "::newb" in ::b::constructor (body line 4)
      invoked from within
  "::itcl::parser::handleClass b ::b ::newb"
      invoked from within
  "b ::newb"
      while constructing object "::newa" in ::a::constructor (body line 4)
      invoked from within
  "::itcl::parser::handleClass a ::a newa"
      invoked from within
  "a newa"
      (file "test.tcl" line 28)

  For some reason a::a tries to find method a in class b and fails.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  This code example makes no sense to me.

  What does an Itcl 3 programmer expect a 
  command [a::a] to do in that context?

  Best I can guess this is an ill-conceived
  attempt to reach into and abuse the particular
  implementation of Itcl 3, which Itcl 4 does not
  reproduce.

  I could be wrong though, I'm not a user of Itcl 3,
  and don't know the full set of programming
  expectations its users have.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  That said, the Itcl 4 reaction is at best a
  confusing and completely wrong error message,
  so there's something to look into.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  If you want objects of class b to have a
  usable method a that is the same as the
  method a of class a, seems to me the
  proper Itcl programming tool to use is
  inherit to get same behavior in Itcl 3 and 4.

  class b {
      inherit a
      ...
  }


login: dgp
mimetype: text/x-fossil-plain
icomment:
  It appears that both Itcl 3 and Itcl 4 have
  this command access to a method in place.
  In Itcl 4, though, every Itcl object is a
  TclOO object and every Itcl method is a
  TclOO method, so when you try to invoke a
  TclOO method (even through a command backdoor access)
  on a TclOO object that lacks that method, the
  access restrictions of TclOO catch that and
  report the error.

  I don't have a strong sense whether this is
  stopping something that was never a good idea
  to begin with, or whether it is exposing that
  TclOO and Itcl have even more deeply fundamental
  disagreements about their very models of operation
  than was ever appreciated, and that in a deep
  sense the Itcl 4 project of building Itcl on top
  of a TclOO foundation is just unworkable.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  Itcl seems to have some tcl-oo dependencies now (since some 4th version), so the bug #254 seems to have continuation.


  Inspired by strange "magic" covered in this itcl-tests by [/artifact?name=a437c1d8c98cbee6&ln=281|sfbug-254] I tried this in tcl-shell (for 8.6 current):
  <pre>
      % oo::class destroy
      % ::itcl::class ::test {}
  </pre>
  followed by **BOOM** with panic "alloc: invalid block: 004CB620: 20 0".

  Doing the same in each child-interp (as it exactly occurs now in itcl-tests sfbug-254 + sfbug-257) is harmless.

  I still don't know it is oo bug or rather itcl bug.


  I'd take a look deeper, but ATM it looks like Tcl_DeleteNamespace is an evil-doer, at least I don't see itcl between 2..7 in the call-stack:
  <pre>
      #2  0x6d7ea757 in Tcl_Panic () from tcl86
      #3  0x6d805d3a in Ptr2Block () from tcl86
      #4  0x6d805ee9 in TclpFree.part.2 () from tcl86
      #5  0x6d7d4fa5 in TclOODecrRefCount.part.2 () from tcl86
      #6  0x6d7d6285 in ObjectNamespaceDeleted () from tcl86
      #7  0x6d7d0779 in Tcl_DeleteNamespace () from tcl86
      #8  0x67f6eb6a in ItclClassBaseCmd.part.5 () from itcl412
  </pre>


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  Further related case (one could already guess):
  <pre>
      % oo::class destroy
      % load {itcl412} itcl
  </pre>
  causes segfault too (don't see any panic at the moment).


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  Found several other cases (all of those segfaulting due to dependency between itcl- and oo-subsystems).

  Ultimate fix is provided now in branch [/timeline?r=bug-1dc2d851eb|bug-1dc2d851eb].
  Merged into trunk, because this all is to classify as grave resp. critical.<br/>
  Additionally, I cannot really work on another issue (affecting memory/references subsystems) as long as the whole system is basically unstable.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  There are several branches of me in order to improve initialization and run-time of Itcl.

  1. Branch [/timeline?r=sebres-memopt-perf-branch|sebres-memopt-perf-branch] introduces new memory preservation mechanism for Itcl (as replacement for Tcl_Preserve), see also tcl-ticket [/../tcl/tktview/4731d31eff3e2245b2300462b9185ab1b2645810|[tcl#4731d31eff3e2245]].

  2. Branch [/timeline?r=sebres-on-dmnd-resolver-perf-branch|sebres-on-dmnd-resolver-perf-branch] is based on first branch and provides additionally a new variable resolver, which build several internal Itcl-structures for var-resolve on demand.<br/>

  New resolver together with new memory preserving mechanism solve large performance regression related to growth of Itcl-internals (classes or definitions like variables) resp. liquidate the run-time dependency to the variables count of class and classes, especially classes within nested namespaces and class inheritances...
  Original itcl-resolver (due to completely rebuild of internals as well as memory-preserve) has the complexity ca. O(nn**2,2**vn) here,
  so the more classes, the deeper a class/inheritance and especially the more variables it has, the worse the performance of class creation or modification was.
  New branch has a related complexity ca. O(1), and a class creation a variable related complexity ca. O(vn) now.

  Additionally this version is memory-saving because several internals (hash-entries, structures etc) are built on demand by first usage only (for example if some variable of inheritance is first time used in ancestor and only then, otherwise the memory remains unused). 

  The second branch contains also a performance test cases covering both improvements (see "tests-perf/itcl-basic.perf.tcl", expects newest 8.6 with timerate feature).

  The comparison of results of the test-suite execution (trunk vs. sebres-memopt-perf-branch vs. sebres-on-dmnd-resolver-perf-branch) are attached.

  The summaries of comparison of results trunk vs. sebres-on-dmnd-resolver-perf-branch are listed below:
  <code><pre style="padding-left:5pt; font-size:75%">

   ==== initialization (preserve/release) ====
   
   ********************************************************************************
  <b style="color:red">-Total 4 cases in 58.34 sec. (58.28 nett-sec.):</b>
  <b style="color:red">-58335.090000 µs/# 3996 # 68.569 #/sec 58276.709 nett-ms</b>
  <b style="color:green">+Total 4 cases in 1.28 sec. (1.27 nett-sec.):</b>
  <b style="color:green">+1274.509000 µs/# 3996 # 3138.465 #/sec 1273.234 nett-ms</b>
   Average:
  <b style="color:red">-14583.772500 µs/# 999 # 69 #/sec 14569.177 nett-ms</b>
  <b style="color:green">+318.627250 µs/# 999 # 3138 #/sec 318.308 nett-ms</b>
   Min:
  <b style="color:red">-4466.60 µs/# 999 # 223.88 #/sec 4462.131 nett-ms</b>
  <b style="color:green">+143.973 µs/# 999 # 6945.7 #/sec 143.829 nett-ms</b>
   Max:
  <b style="color:red">-29910.4 µs/# 999 # 33.433 #/sec 29880.451 nett-ms</b>
  <b style="color:green">+500.756 µs/# 999 # 1997.0 #/sec 500.255 nett-ms</b>
   ********************************************************************************
   
   ==== class/var creation ====
   
   ********************************************************************************
  <b style="color:red">-Total 5 cases in 107.92 sec. (107.67 nett-sec.):</b>
  <b style="color:red">-289147.624000 µs/# 11069 # 102.808 #/sec 107667.039 nett-ms</b>
  <b style="color:green">+Total 5 cases in 0.40 sec. (0.40 nett-sec.):</b>
  <b style="color:green">+119.592700 µs/# 30002 # 75761.287 #/sec 396.007 nett-ms</b>
   Average:
  <b style="color:red">-57829.524800 µs/# 2213 # 103 #/sec 21533.408 nett-ms</b>
  <b style="color:green">+23.918540 µs/# 6000 # 75757 #/sec 79.201 nett-ms</b>
   Min:
  <b style="color:red">-746.324 µs/# 10000 # 1339.9 #/sec 7463.245 nett-ms</b>
  <b style="color:green">+12.1779 µs/# 10000 # 82116.0 #/sec 121.779 nett-ms</b>
   Max:
  <b style="color:red">-96940.1 µs/# 516 # 10.316 #/sec 50021.074 nett-ms</b>
  <b style="color:green">+52.0000 µs/# 1 # 19230.8 #/sec 0.052 nett-ms</b>
   ********************************************************************************
   
   ==== var access ====
   
   ********************************************************************************
  <b style="color:red">-Total 39 cases in 2.23 sec. (0.85 nett-sec.):</b>
  <b style="color:red">-84.529156 µs/# 389961 # 461379.283 #/sec 845.207 nett-ms</b>
  <b style="color:green">+Total 39 cases in 2.22 sec. (0.81 nett-sec.):</b>
  <b style="color:green">+80.869286 µs/# 389961 # 482259.724 #/sec 808.612 nett-ms</b>
   Average:
  <b style="color:red">-2.167414 µs/# 9999 # 461379 #/sec 21.672 nett-ms</b>
  <b style="color:green">+2.073571 µs/# 9999 # 482251 #/sec 20.734 nett-ms</b>
   Min:
  <b style="color:red">-0.926193 µs/# 9999 # 1079689 #/sec 9.261 nett-ms</b>
  <b style="color:green">+0.944594 µs/# 9999 # 1058655 #/sec 9.445 nett-ms</b>
   Max:
  <b style="color:red">-4.874287 µs/# 9999 # 205158 #/sec 48.738 nett-ms</b>
  <b style="color:green">+4.743174 µs/# 9999 # 210829 #/sec 47.427 nett-ms</b>
   ********************************************************************************
   
   ==== object instance ====

  ... not affected here ...
  </pre></code>
  Two first sections show huge performance increase using newest branch.

  The section <code>var access</code> is provided in order to show there is basically no regression using this new building on-demand resolver by variable access.

  The last section (<code>object instance</code>) in the attached results is not really affected (or fixed) by above-mentioned branches at the moment, so it is simply provided to show the large regression on object-initialization and deletion in current Itcl-version. I have already almost ready concept-solution for that, but it expects also modification on Tcl-OO and several Tcl-subsystems (internals), I'll try to provide it later (and then will update this RFE).


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Somewhere we need to capture instructions on the proper use of these
  memory routines. If we make them all public, those instructions can
  just go into the documentation. If not, we'll need to record them somewhere
  else easy to find, at least for Itcl devs ourselves.

  For example, both Itcl_ReleaseData() and ItclCkFree() appear to have the
  capability to deallocate ( via a call to ckfree() ) the memory under control.
  So the programmer has a responsibility to either make enough calls to
  Itcl_ReleaseData() or make a properly-timed call to ItclCkFree() but NOT both?
  It's at least tricky.

  The routines Itcl_PreserveData() and Itcl_ReleaseData() have already been
  public, but now they carry a constraint that their ClientData argument must
  have been allocated by a call to ItclCkAlloc(). This new requirement might
  imply enough incompatibility that we need to bump to an Itcl 4.2 release.

  ItclCkAlloc() is written to take a Tcl_FreeProc argument, but the routine has
  five callers and every one of them passes NULL. If we don't need this argument,
  I think it should go, and the code simplifications that follow from that.


login: anonymous
mimetype: text/x-fossil-plain
icomment:
  ./configure
  ...<several lines>.....
  configure:2365: error: cannot find install-sh, install.sh, or shtool in tclconfig "."/tclconfig

  cp -r itclWidget/tclconfig .
  ./configure 
  make all
  make test
  make install
  <success!>


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Where did you retrieve an Itcl 4.1.2 source code distribution with missing files

  itcl4.1.2/tclconfig/*

  ???


login: christian.nassau
mimetype: text/x-fossil-plain
icomment:
  Itcl allows to declare and implement a method using different argument names, e.g.

   itcl::class xyz {
     public method meth1 {foo bar}
   }

   itcl::body xyz::meth1 {apple banana} {
     puts apple=$apple
   }

  This results in a mismatch between "info args" and "info body":
   
     xyz testobj
     testobj info args meth1  ;# gives "foo bar"
     testobj info body meth1  ;# uses "apple banana"

  As a result, itcl code instrumentation is broken since it relies on both "args" and "body" for a method redefinition.

  I suggest to fix "info args": this should always report the argument names from the latest "itcl::body" call.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  Test:
  <pre>
  make gdb-test
  #or
  TESTFLAGS='-singleproc 1' make test
  </pre>

  Issue:
  <code><pre>
  basic.test
  body.test
  chain.test
  delete.test
  eclasscomponent.test
  ensemble.test
  general1.test
  make: *** [test] Segmentation fault
  ...
  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff64f2ae3 in ItclMapMethodNameProc (interp=0x5555557635b0, oPtr=0x555555bd5090, startClsPtr=0x7fffffffd748, methodObj=0x555555bf6a60) at ../generic/itclObject.c:3123
  3123                                (imPtr->iclsPtr->nsPtr != imPtr2->iclsPtr->nsPtr)) {
  </pre></code>

  Reason:

  <code>imPtr2->iclsPtr</code> points to invalid block, because the hash entry was not removed from hash <code>imPtr->iclsPtr->infoPtr->procMethods</code>,<br/>
  so still point to <code>imPtr2</code>, which is not a method anymore.<br/>
  The main reason is <code>imPtr2->iclsPtr</code> was set to NULL in <code>ItclFreeClass</code> in the cycle <code>FOREACH_HASH_VALUE(imPtr, &iclsPtr->functions)</code> before <code>ItclDeleteFunction(imPtr)</code> gets called,<br/>
  so <code>ItclDeleteFunction</code> does not delete a method hash entry for this imPtr.

  WiP.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  It looks like it was initially introduced in [0b0d0e0b8cd8105c], as <code>imPtr->iclsPtr = NULL</code> before <code>ItclReleaseIMF(imPtr)</code> gets called.
  Just possibly it is caused now only as an after effect of some another fix, occurred later, or it is some constellation of the tests now.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  Well, I suspected that because as you tested last week gdb without segfault.
  And on my side [dc068b3255e5bb3d] is not reproducible vice versa (as described in last comment there).

  Here is what I test:
  <pre>
  Prepare:
    - 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
    - tcl (8.6, any last e. g. 50a5729f85f7033ab3dd3911bd955e2d5bd9d2fe)
      cd unix && ./configure && make tcltest
    - itcl (trunk, any revision since your [e4c69b3785])
      cd build && ../configure --with-tcl=../../core-8-6-branch/unix && make

  Test:
  $ TESTFLAGS='-singleproc 1' make test

  TCL_LIBRARY=`echo /prj/tcl.core/core-8-6-branch/library` LD_LIBRARY_PATH="/prj/tcl.core/itcl-trunk/build:/prj/tcl.core/core-8-6-branch/unix:" PATH="/prj/tcl.core/itcl-trunk/build:/prj/tcl.core/core-8-6-branch/unix:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" ITCL_LIBRARY=`echo ../library` TCLLIBPATH="/prj/tcl.core/itcl-trunk/build" /prj/tcl.core/core-8-6-branch/unix/tclsh `echo ../tests/all.tcl` -singleproc 1 -load "if {[catch {package present itcl}]} {package forget itcl; package ifneeded itcl 4.1.2 [list load `echo /prj/tcl.core/itcl-trunk/build/libitcl4.1.2.so` itcl]}"
  Tests running in interp:  /prj/tcl.core/core-8-6-branch/unix/tclsh
  Tests located in:  /prj/tcl.core/itcl-trunk/tests
  Tests running in:  /prj/tcl.core/itcl-trunk/build
  Temporary files stored in /prj/tcl.core/itcl-trunk/build
  Test files sourced into current interpreter
  Running tests that match:  *
  Skipping test files that match:  l.*.test
  Only running test files that match:  *.test
  Tests began at Wed Jul 17 12:00:04 CEST 2019
  basic.test
  body.test
  chain.test
  delete.test
  eclasscomponent.test
  ensemble.test
  general1.test
  Makefile:253: recipe for target 'test' failed
  make: *** [test] Segmentation fault

  $ cd ../build.deb; # entered build configured with --enable-symbols=mem for tcl/itcl:

  $ make gdb-test
  TCL_LIBRARY=`echo /prj/tcl.core/core-8-6-branch/library` LD_LIBRARY_PATH="/prj/tcl.core/itcl-trunk/build.deb:/prj/tcl.core/core-8-6-branch/build.deb:" PATH="/prj/tcl.core/itcl-trunk/build.deb:/prj/tcl.core/core-8-6-branch/build.deb:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" ITCL_LIBRARY=`echo ../library` TCLLIBPATH="/prj/tcl.core/itcl-trunk/build.deb" gdb \
      --args /prj/tcl.core/core-8-6-branch/build.deb/tclsh `echo ../tests/all.tcl` \
       -singleproc 1 -load "if {[catch {package present itcl}]} {package forget itcl; package ifneeded itcl 4.1.2 [list load `echo /prj/tcl.core/itcl-trunk/build.deb/libitcl4.1.2.so` itcl]}"
  GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
  ...
  Reading symbols from /prj/tcl.core/core-8-6-branch/build.deb/tclsh...(no debugging symbols found)...done.
  (gdb) run
  Starting program: /prj/tcl.core/core-8-6-branch/build.deb/tclsh ../tests/all.tcl -singleproc 1 -load if\ \{\[catch\ \{package\ present\ itcl\}\]\}\ \{package\ forget\ itcl\;\ package\ ifneeded\ itcl\ 4.1.2\ \[list\ load\ /prj/tcl.core/itcl-trunk/build.deb/libitcl4.1.2.so\ itcl\]\}
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  Tests running in interp:  /prj/tcl.core/core-8-6-branch/build.deb/tclsh
  Tests located in:  /prj/tcl.core/itcl-trunk/tests
  Tests running in:  /prj/tcl.core/itcl-trunk/build.deb
  Temporary files stored in /prj/tcl.core/itcl-trunk/build.deb
  Test files sourced into current interpreter
  Running tests that match:  *
  Skipping test files that match:  l.*.test
  Only running test files that match:  *.test
  Tests began at Wed Jul 17 12:04:28 CEST 2019
  basic.test
  body.test
  chain.test
  delete.test
  eclasscomponent.test
  ensemble.test
  general1.test

  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff64f222d in ItclMapMethodNameProc (interp=0x5555557635b0, oPtr=0x555555bd64a0, startClsPtr=0x7fffffffd708, methodObj=0x555555c00af0) at ../generic/itclObject.c:3123
  3123                                (imPtr->iclsPtr->nsPtr != imPtr2->iclsPtr->nsPtr)) {
  (gdb) bt
  #0  0x00007ffff64f222d in ItclMapMethodNameProc (interp=0x5555557635b0, oPtr=0x555555bd64a0, startClsPtr=0x7fffffffd708, methodObj=0x555555c00af0) at ../generic/itclObject.c:3123
  #1  0x00007ffff7b5c036 in TclOOObjectCmdCore () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #2  0x00007ffff64b6186 in Itcl_PublicObjectCmd (clientData=0x555555bd64a0, interp=0x5555557635b0, clsPtr=0x0, objc=2, objv=0x555555bf06d0) at ../generic/itcl2TclOO.c:237
  #3  0x00007ffff64f1110 in CallPublicObjectCmd (data=0x555555c00ac8, interp=0x5555557635b0, result=0) at ../generic/itclObject.c:2744
  #4  0x00007ffff7a57887 in TclNRRunCallbacks () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #5  0x00007ffff64b5b3c in Itcl_NRRunCallbacks (interp=0x5555557635b0, rootPtr=0x555555c002b0) at ../generic/itcl2TclOO.c:28
  #6  0x00007ffff64f1924 in ItclObjectCmd (clientData=0x555555ba3e70, interp=0x5555557635b0, oPtr=0x555555bd64a0, clsPtr=0x0, objc=1, objv=0x555555b542d0) at ../generic/itclObject.c:2919
  #7  0x00007ffff64e74b3 in CallItclObjectCmd (data=0x555555c009d8, interp=0x5555557635b0, result=0) at ../generic/itclMethod.c:1241
  #8  0x00007ffff7a57887 in TclNRRunCallbacks () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #9  0x00007ffff64b5b3c in Itcl_NRRunCallbacks (interp=0x5555557635b0, rootPtr=0x555555c002b0) at ../generic/itcl2TclOO.c:28
  #10 0x00007ffff64e76fe in Itcl_EvalMemberCode (interp=0x5555557635b0, imPtr=0x555555ba3e70, contextIoPtr=0x5555559588e0, objc=1, objv=0x555555b542d0) at ../generic/itclMethod.c:1328
  #11 0x00007ffff64e8398 in NRExecMethod (clientData=0x555555ba3e70, interp=0x5555557635b0, objc=1, objv=0x555555b542d0) at ../generic/itclMethod.c:1734
  #12 0x00007ffff7a57887 in TclNRRunCallbacks () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #13 0x00007ffff64e83f4 in Itcl_ExecMethod (clientData=0x555555ba3e70, interp=0x5555557635b0, objc=1, objv=0x555555b542d0) at ../generic/itclMethod.c:1747
  #14 0x00007ffff7a57887 in TclNRRunCallbacks () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #15 0x00007ffff7a597fe in TclEvalEx () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #16 0x00007ffff7b0db58 in Tcl_FSEvalFileEx () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #17 0x00007ffff7b14fcf in Tcl_MainEx () from /prj/tcl.core/core-8-6-branch/build.deb/libtcl8.6.so
  #18 0x00005555555548d4 in main ()
  <pre>

  As already said, if you add printf at release point of iclsPtr and here (where it segfaults), you'll see the pointer <code>imPtr2->iclsPtr</code> gets free several tests before it get used again.
  The main reason is pretty well described in the ticket.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Can you determine what test in general1.test is running when it segfaults?

  Trying to figure out what class is getting freed before its method is called.


login: sebres
mimetype: text/x-fossil-plain
icomment:
  Sure (I had already find it at some point), and can provide it tomorrow (no dev environment to hand ATM)...
  But it would not say you something, because this is just an after effect of some previous tests (and occurs only because imPtr2->iclsPtr got invalid previously).
  Also this case does not fault alone or without singleproc, so I guess the real test where it gets broken is not general1.
  I can alter and compile my fix in order to try to find the "evildoer" which'd set iclsPtr to NULL before refCount gets 0 (what is in my opinion the true reason).


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  The tests segfaulting in "general1-1.11".
  And as already said using filter <code>-file 'general1.*'</code> it works fine:
  <pre>
  all.tcl:        Total   19      Passed  19      Skipped 0       Failed  0
  Sourced 1 Test Files.
  </pre>

  The "evildoer" seems to be one of "eclasscomponent" or even some another previous, which deleting the clasess.

  If I extend the code with some debug output (one in code causes the bug and another in code segfaulting):
  <code><pre style="padding-left:10pt">
  static void
  ItclFreeClass(
  ...
      /*
       *  Delete all function definitions.
       */
      FOREACH_HASH_VALUE(imPtr, &iclsPtr->functions) {
  <b style="color:green">+	if (imPtr->refCount > 1) {</b>
  <b style="color:green">+	    printf("release %p, cls: %p, ref-count: %d\n", imPtr, imPtr->iclsPtr, imPtr->refCount);</b>
  <b style="color:green">+	}</b>
  	imPtr->iclsPtr = NULL;
          ItclReleaseIMF(imPtr);
      }
      Tcl_DeleteHashTable(&iclsPtr->functions);


  int
  ItclMapMethodNameProc(
  ...
  	            if (hPtr != NULL) {
  	                imPtr2 = Tcl_GetHashValue(hPtr);
  	            }
  +
  <b style="color:green">+		    if (imPtr->protection & ITCL_PRIVATE) {</b>
  <b style="color:green">+			printf("check 1 %p, cls: %p, ref-count: %d\n", imPtr, imPtr->iclsPtr, imPtr->refCount);</b>
  <b style="color:green">+			if (imPtr2 != NULL) {</b>
  <b style="color:green">+			    printf("check 2 %p, cls: %p, ref-count: %d\n", imPtr2, imPtr2->iclsPtr, imPtr2->refCount);</b>
  <b style="color:green">+			}</b>
  <b style="color:green">+		    }</b>

  &nbsp;		    if ((imPtr->protection & ITCL_PRIVATE) &&
  		            (imPtr2 != NULL) &&
  		            (imPtr->iclsPtr->nsPtr != imPtr2->iclsPtr->nsPtr)) {
  </pre></code>

  and test it this way, it is pretty simply:
  <code><pre style="padding-left:10pt">

  $ TESTFLAGS='-singleproc 1 -verbose tp' make test

  ---- delegatemethod-1.5 start
  ...
  release <b style="color:red">0x5601f54e6b50</b>, cls: <b style="color:blue">0x5601f5492810</b>, ref-count: 2
  ...
  ++++ delegatemethod-1.5 PASSED
  ...
  ---- general1-1.11 start
  check 1 0x5601f54e7350, cls: 0x5601f5491810, ref-count: 3
  check 2 <b style="color:red">0x5601f54e6b50</b>, cls: <b style="color:red">0x100000002</b>, ref-count: 0
  Makefile:253: recipe for target 'test' failed
  make: *** [test] Segmentation fault
  </pre></code>

  As you can see imPtr2 is found as hash entry (because previously the imPtr->iclsPtr will be set to NULL, so the hash entry is not deleted properly.<br/>
  But now it points to a memory block which is not ItclMemberFunc anymore.

  BTW, there are also several other calls of ItclReleaseIMF, but no one excepting ItclFreeClass set the member iclsPtr to NULL before it gets called.<br/>
  I understand that ItclFreeClass deletes the class, but in my opinion it is not proper way to signal a class deleting, because iclsPtr is used as keys in several hash tables.

  Therefore it was fixed in the way of [1ca2d5abfba2b94d], and as already said I cannot reproduce [dc068b3255] vice versa at all.

  May be you're using not latest 8.6 (or other tcl-versions)? Or different order of test-cases? (I remember between 8.6.[89] and current we added sort of the test-files after glob).
  Can you describe your test scenario?


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Thanks for that instrumentation. It was what I needed to be able to detect the problem.

  Fix is committed to trunk. If it does not solve the problem, please re-open.


login: sebres
mimetype: text/x-fossil-plain
icomment:
  Confirmed - trunk seems to be fixed now, both (gdb-test as well as -singleproc test) pass now.
  Merged in my both perf-branches, all tests passed too.
  Thx, Don.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Program received signal SIGSEGV, Segmentation fault.
  0x000000000053a14c in Tcl_GetString (objPtr=0x8cbd90)
      at /home/dgp/fossil/tcl8.6.10/generic/tclObj.c:1642
  1642        if (objPtr->typePtr->updateStringProc == NULL) {
  Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.5.x86_64 zlib-1.2.7-18.el7.x86_64
  (gdb) bt
  #0  0x000000000053a14c in Tcl_GetString (objPtr=0x8cbd90)
      at /home/dgp/fossil/tcl8.6.10/generic/tclObj.c:1642
  #1  0x000000000053a1e4 in Tcl_GetStringFromObj (objPtr=0x8cbd90, 
      lengthPtr=0x7fffffffcd94)
      at /home/dgp/fossil/tcl8.6.10/generic/tclObj.c:1692
  #2  0x000000000052da44 in SetListFromAny (interp=0x8225c0, objPtr=0x8cbd90)
      at /home/dgp/fossil/tcl8.6.10/generic/tclListObj.c:1849
  #3  0x000000000052c029 in Tcl_ListObjIndex (interp=0x8225c0, listPtr=0x8cbd90, 
      index=0, objPtrPtr=0x7fffffffce70)
      at /home/dgp/fossil/tcl8.6.10/generic/tclListObj.c:727
  #4  0x00000000004da8df in Tcl_SetEnsembleMappingDict (interp=0x8225c0, 
      token=0x842620, mapDict=0x82a220)
      at /home/dgp/fossil/tcl8.6.10/generic/tclEnsemble.c:949
  #5  0x00007ffff0951ede in ItclFinishCmd (clientData=0x8a15f0, interp=0x8225c0, 
      objc=0, objv=0x0) at ./generic/itclBase.c:731
  #6  0x00007ffff09503b3 in FreeItclObjectInfo (clientData=0x8a15f0)
      at ./generic/itclBase.c:186
  #7  0x0000000000533622 in TclTeardownNamespace (nsPtr=0x87c580)
      at /home/dgp/fossil/tcl8.6.10/generic/tclNamesp.c:1266
  #8  0x0000000000533148 in Tcl_DeleteNamespace (namespacePtr=0x87c580)
      at /home/dgp/fossil/tcl8.6.10/generic/tclNamesp.c:1033
  #9  0x00007ffff095222d in ItclFinishCmd (clientData=0x0, interp=0x8225c0, 
      objc=1, objv=0x82fc80) at ./generic/itclBase.c:773
  #10 0x0000000000414ce6 in Dispatch (data=0x8cc098, interp=0x8225c0, result=0)
      at /home/dgp/fossil/tcl8.6.10/generic/tclBasic.c:4454
  #11 0x0000000000414d74 in TclNRRunCallbacks (interp=0x8225c0, result=0, 
      rootPtr=0x0) at /home/dgp/fossil/tcl8.6.10/generic/tclBasic.c:4490
  #12 0x0000000000417864 in TclEvalObjEx (interp=0x8225c0, objPtr=0x0, 
      flags=131072, invoker=0x0, word=0)
      at /home/dgp/fossil/tcl8.6.10/generic/tclBasic.c:6056
  #13 0x00000000004177fd in Tcl_EvalObjEx (interp=0x8225c0, objPtr=0x0, 
      flags=131072) at /home/dgp/fossil/tcl8.6.10/generic/tclBasic.c:6037
  #14 0x00000000005c0af8 in Tcl_RecordAndEvalObj (interp=0x8225c0, 
      cmdPtr=0x86be50, flags=131072)
      at /home/dgp/fossil/tcl8.6.10/generic/tclHistory.c:190
  #15 0x00000000005318bd in Tcl_MainEx (argc=-1, argv=0x7fffffffd630, 
      appInitProc=0x40f173 <Tcl_AppInit>, interp=0x8225c0)
      at /home/dgp/fossil/tcl8.6.10/generic/tclMain.c:537
  #16 0x000000000040f16c in main (argc=1, argv=0x7fffffffd628)
      at /home/dgp/fossil/tcl8.6.10/unix/tclAppInit.c:84


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Looks to be trouble with re-entrancy of ItclFinishCmd().

  The second time trying to undo the Itcl redefine of [info vars]
  runs into trouble.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Another symptom of the same bad change:

  % package present itcl
  4.1.2
  % namespace delete itcl
  can't delete "::itcl::clazz": command doesn't exist


login: dgp
mimetype: text/x-fossil-plain
icomment:
  New tests basic-7.[01] demonstrate the failures, and make clear
  that both the old design and the new one have re-entrancy crashes.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Since serious repairs are needed down either development path,
  the one that attaches extension machinery to a namespace is the more
  attractive task to work on.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Starting with checkin

  https://core.tcl-lang.org/itcl/info/1ca2d5abfba2b94d

  an --enable-symbols=mem build of Tcl/Itcl segfaults like so:

  package require itcl
  itcl::class test {}
  itcl::delete class test


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff09626de in ItclDeleteFunction (imPtr=0x90f878)
      at ./generic/itclClass.c:2456
  2456            hPtr = Tcl_FindHashEntry(&imPtr->iclsPtr->infoPtr->procMethods,
  Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7_6.5.x86_64 zlib-1.2.7-18.el7.x86_64
  (gdb) bt
  #0  0x00007ffff09626de in ItclDeleteFunction (imPtr=0x90f878)
      at ./generic/itclClass.c:2456
  #1  0x00007ffff095ccd0 in Itcl_DeleteMemberFunc (
      cdata=0x90f878 <incomplete sequence \364\220>) at ./generic/itclClass.c:82
  #2  0x00007ffff097dbc4 in ItclReleaseIMF (clientData=0x90f878)
      at ./generic/itclMethod.c:59
  #3  0x000000000041300f in Tcl_DeleteCommandFromToken (interp=0x80c2f8, 
      cmd=0x95e898) at /home/dgp/fossil/tcl8.6.10/generic/tclBasic.c:3222
  #4  0x000000000052afb8 in TclTeardownNamespace (nsPtr=0x98f1b8)
      at /home/dgp/fossil/tcl8.6.10/generic/tclNamesp.c:1146
  #5  0x000000000052ade2 in Tcl_DeleteNamespace (namespacePtr=0x98f1b8)
      at /home/dgp/fossil/tcl8.6.10/generic/tclNamesp.c:1033
  #6  0x00007ffff095ee04 in Itcl_DeleteClass (interp=0x80c2f8, iclsPtr=0x989c68)
      at ./generic/itclClass.c:864
  ...


  (gdb) print imPtr->iclsPtr->infoPtr
  $2 = (struct ItclObjectInfo *) 0x6161616161616161

  imPtr->iclsPtr has already been freed, though we're clearly still using it.


login: sebres
mimetype: text/x-fossil-wiki
icomment:
  I cannot reproduce it at all... 

  switched to [8c45cdd2a9f0272b] (as before your backout checkin);

  configure Tcl and ITcl with --enable-symbols=mem; 

  clean and make, test with 3 lines script descriebed in this ticket - no segfault at all.

  Here is what I'm doing:

  <code><pre style="padding-left:10pt">
  $

  TCL_LIBRARY=`echo /prj/core-8-6-branch/library` \
  LD_LIBRARY_PATH="/prj/itcl-trunk/build.mem:/prj/core-8-6-branch/build.mem:" \
  PATH="/prj/itcl-trunk/build.mem:/prj/core-8-6-branch/build.mem:$PATH" \
  ITCL_LIBRARY=`echo ../library` \
  TCLLIBPATH="/prj/itcl-trunk/build.mem" \
  /prj/core-8-6-branch/build.mem/tclsh

  %

  package forget itcl; package ifneeded itcl 4.1.2 [list load /prj/itcl-trunk/build.mem/libitcl4.1.2.so itcl]

  package require itcl
  itcl::class test {}
  itcl::delete class test

  puts OK
  </pre></code>

  And I see OK.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Starting with checkin [943f56ae05] this simple script lead to a
  segfault during exit.

  itcl::ensemble X {}
  itcl::delete ensemble X


login: dgp
mimetype: text/x-fossil-plain
icomment:
  That checkin attempted a re-design of managing the lifetime
  of the master ItclObjectInfo struct. That had been managed as
  a piece of associated data in the interp. The new idea was to
  keep it as the clientdata of the ::itcl namespace.  It would still
  be registered as interp assoc data too, but no lifetime management
  would function there.

  Trouble is that [::itcl::ensemble] retrieves the Tcl_InterpDeleteProc
  of that assoc data and may use it. After the reform, it is NULL.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Ok, the retrieval of the Tcl_InterpDeleteProc must be some ancient legacy,
  because they were not used. Removed the dead code.

  On with the search...


login: dgp
mimetype: text/x-fossil-plain
icomment:
  There appears to be a dispute over the responsibility for freeing
  the EnsembleParser.  A call to ItclFinishEnsemble() pulls it from
  assoc data and frees it, while the DeleteEnsParser routine is already
  registered to clean it up when the interp is torn down.

  When both cleanups happen, the double free seems to be the trouble.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  Revised ItclFinishEnsemble to use the assoc data machinery instead of
  improperly competing with it.


login: dgp
mimetype: text/x-fossil-plain
icomment:
  A pool of list elements is kept in itclUtil.c making use of a few process-global
  variables, and no mutex controlled access to them.

  This very likely means Itcl's operations are not thread safe.


