Overview
| Artifact ID: | b8ab1c789f098529251f1127c5969a45ba000d6f7e04b511c067df7776feb911 |
|---|---|
| Ticket: | fec0c17d39db02faffa101ebb605d0958dbf3466
segfault compiling deeply nested [catch] |
| User & Date: | sebres on 2017-11-28 16:47:08 |
Changes
- icomment:
<blockquote>It appears this is conceptually a simple case of call stack exhaustion.</blockquote> I don't think so... Just note that we've here an factorial by lengths of each body objects (which compiled separately)... Simply we cannot allocate all this objects... I'll try to explain it here: <pre><code> proc gencode_lengths {nr} { # initial length: set codelen [string length "set a foo"] # unfold "recursion" to count each body length: for {set i 0} {$i < $nr} {incr i} { # length of body self (from prev. recursion level): incr codelen $codelen # length of addition in this body: incr codelen [string length "catch \{\}"] } # lengths of all body objects (will be compiled) return $codelen } % puts [set len [gencode_lengths 100000]] 16983035581244536635048556993610571046667295363921088760115997655...........very-very-long. % puts [string index $len 0].[string index $len 1]e[expr {[string length $len]-1}] 1.6e30104 </code></pre> The only "real" solution is to dispense the NTS in string representations and use the same (offset-ed) as shared string representation pointer with offset/length. This expects completely rewriting of Tcl_Obj primitives. - login: "sebres"
- mimetype: "text/x-fossil-wiki"