Artifacts Associated With Ticket 2960021fffffffffffffffffffffffffffffffff
Ticket change [a7e9939e71] (rid 98880) by blacksqr on 2010-02-27 06:47:17:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
When the "needleString" argument to a "string first" command is very large, a segmentation fault will result. It is easy to switch the "needleString" and the "haystackString" by mistake in the "string first" command, and thus encounter this bug. Mistake notwithstanding, the command is still syntactically correct, and one should expect a "-1" as a return value. To replicate, simply execute the following procedure: proc string_first_bug {} { set line xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx for {set i 0} {$i < 1048547} {incr i} { append largeString $line\n } set line_ [string first $largeString \n] } ActiveTcl 8.5.8 on Ubuntu Intrepid. - foundin initialized to: "obsolete: 8.5.8"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "blacksqr"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: ""string first" command on large string segfaults"
- type initialized to: "Bug"
Ticket change [e0a73315a2] (rid 115236) by blacksqr on 2010-02-27 13:50:37:
- icomment:
Submit form didn't like tabs in code sample. Here's an attempt to prettify with spaces: proc string_first_bug {} { set line xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx for {set i 0} {$i < 1048547} {incr i} { append largeString $line\n } set line_ [string first $largeString \n] } - login: "blacksqr"
- mimetype: "text/plain"
- username: "blacksqr"
- icomment:
Ticket change [54a0c63044] (rid 93981) by blacksqr on 2010-02-27 13:51:14:
- icomment:
Sourceforge says: no pretty code sample for you!
- login: "blacksqr"
- mimetype: "text/plain"
- username: "blacksqr"
- icomment:
Ticket change [d1387525b8] (rid 113310) by andreas_kupries on 2010-02-27 14:07:33:
- icomment:
That is why we usually ask to attach code samples and other stuff like that, instead of inlining it into the report or comment.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [055c1ce0e8] (rid 89053) by dkf on 2010-02-28 01:38:17:
- icomment:
Weird that it was crashing, but at least we can know when the needle is bigger than the haystack that the former that there is no need to search. Applied those preconditions and the crashes go away.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [d00dbf2f3a] (rid 113097) by dkf on 2010-02-28 04:25:43:
- closedate changed to: "2010-02-27T21:25:43"
- closer changed to: "dkf"
- icomment:
allow_comments - 1 Fixed in HEAD and 8.5 branch.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"