Skip to content
Tcl Source Code History Of Ticket 218466
Login

History Of Ticket 218466

Artifacts Associated With Ticket 218466

  1. Ticket change [4c30ede62f] (rid 126837) by nobody on 2000-10-26 01:00:48:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 627 Bug
      Version: 8.1a2
      SubmitDate: '1998-05-25'
      LastModified: '1999-08-13'
      Severity: MED
      Status: Released
      Submitter: hershey
      ChangedBy: hobbs
      OS: All
      OSVersion: NA
      Machine: NA
      FixedDate: '1999-08-13'
      FixedInVersion: 8.2b3
      ClosedDate: '2000-10-25'
      
      
      I too have encountered this problem.  I have a 2,500 tcl/tk prog
      which gets an exception with the new regsub.  If I remove the
      call it works (I'm actually running it in production with version 8.0).
      I posted a similar warning to the above a couple of months ago
      to c.l.t.
      
      Just thought I'd let you know I think the problem is real.  When I
      have the time I'll try and get a simple example.  I did try to
      at first but failed.
      
      PS I think the new regexp stuff should have been made a "package".
      --------
      Tcl 8.1a2 is blowing up with the message "unable to realloc xxx bytes"
      when I run my program.  My code basically reads HTML files and parses them.
      It reads the entire file into a variable, then parses the data from that.
      The problem ocurrs for large files, e.g. a file "myfile" that is
      971 lines, 15383 characters gives the error.  Small files work fine.
      
      Below is the smallest code fragment that reproduces the problem
      (you need to supply an input file "mtfile" of sufficient size).
      I'm using "wish81", not tclsh81.  "wish80" from the 8.0 Tcl release works fine.
      
      Hopefully someone will use this to verify that the next release corrects
      the problem.  In the meantime, does anyone know whether there is currently
      a patch that will fix this?
      
      Thanks ...
      
      -- [email protected]
      
      # START OF TCL CODE
      proc getdata {file} {
              set fd [open $file]
              set rs [read $fd]
              close $fd
              return $rs
      }
      
      proc parse {html {cmd xtk_HMtest_parse} {start hmstart}} {
              regsub -all \{ $html {\&ob;} html
              regsub -all \} $html {\&cb;} html
              set w " \t\r\n" ;# white space
              proc xtk_HMcl x {return "\[$x\]"}
              set exp <(/?)([xtk_HMcl ^$w>]+)[xtk_HMcl $w]*([xtk_HMcl ^>]*)>
              set sub "\}\n$cmd {\\2} {\\1} {\\3} \{"
              regsub -all $exp $html $sub html
              eval "$cmd {$start} {} {} \{ $html \}"
              eval "$cmd {$start} / {} {}"
      }
      
      proc xtk_HMtest_parse {command tag slash text_after_tag} {
          puts -nonewline "."
          #puts "==> $command $tag $slash $text_after_tag"
      }
      
      proc doit {file} {
              set data [getdata $file]
              puts "size=[string length $data]"
              parse "$data"
      }
      
      doit myfile
      
      ----------
      
      More info:
      First, I forgot to mention that I'm running Tcl 8.1a2 on Window NT 4.0.
      Second, I've discovered that this program only fails when the input file
      contains particular data.  In other words, you can't reproduce the problem
      with any aritrary large file ... my file contains HTML, and some of the
      "regsub" commands process it.  So the "regsub" command must be involved in
      the problem somehow.
      If someone wants it, I'll gladly provide my data file which is needed to
      reproduce the problem (but is anyone really fixing bugs now?)
      
      -- [email protected]
      
      Some worst case regexp bugs were fixed in the 8.2b3 release. 
      -- 08/13/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.1a2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "realloc bug -- somehow related to regsub?"
    11. type initialized to: "Bug"
  2. Ticket change [d765d09e47] (rid 123979) by welch on 2000-10-26 08:22:17:

    1. closedate changed to: "2000-10-26T01:22:17"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [02c5ff8635] (rid 119708) by dgp on 2001-04-17 04:22:32:

    1. closedate changed to: "2001-04-16T21:22:32"
    2. closer changed to: "dgp"
    3. subsystem changed to: "43. Regexp"