Artifacts Associated With Ticket 218466
Ticket change [4c30ede62f] (rid 126837) by nobody on 2000-10-26 01:00:48:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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
- foundin initialized to: "obsolete: 8.1a2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "realloc bug -- somehow related to regsub?"
- type initialized to: "Bug"
Ticket change [d765d09e47] (rid 123979) by welch on 2000-10-26 08:22:17:
- closedate changed to: "2000-10-26T01:22:17"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [02c5ff8635] (rid 119708) by dgp on 2001-04-17 04:22:32:
- closedate changed to: "2001-04-16T21:22:32"
- closer changed to: "dgp"
- subsystem changed to: "43. Regexp"