Overview
| Artifact ID: | 452a317ccbce7ce937abb49f65e1b2d3ac965492a144e4b18230861eee90582b |
|---|---|
| Ticket: | 5ee01098824881b5500e4692bcfa74eb853bc795
lseq list conversion results in attempt to access freed memory |
| User & Date: | pooryorick on 2023-05-17 11:50:56 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
In a build of trunk with --enable-symbols and CFLAGS="-DPURIFY", the following script <blockquote><code><verbatim> trace add variable one write [list ::apply [list args { error {this error} } [namespace current]]] set one [lindex [lreplace [lseq 1 2] 1 1 hello] 0] </verbatim></code></blockquote> Results in the following error: <blockquote><code><verbatim> malloc(): unaligned fastbin chunk detected 3 </verbatim></code></blockquote> The reason is that <code>lreplace</code> converts the internal repesentation from <code>tclArithSeriesType</code> to <cod>tclListType</code>, and <code>SetListFromAny()</code> handles the arithmetic series specially, forgetting to increment the reference count when each <code>Tcl_Obj</code> is added to the list. See [https://core.tcl-lang.org/tcl/file?udc=1&ln=3323&ci=57e46213e1e5414a&name=generic%2FtclListObj.c|this loop]. - is_private changed to: "0"
- login: "pooryorick"
- priority changed to: "5 Medium"
- private_contact changed to: "2b2275eab1118e1fab0016cf1c5702893c6af86c"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "- New Builtin Commands"
- title changed to:
lseq list conversion results in attempt to access freed memory
- type changed to: "Bug"