Artifacts Associated With Ticket 3e7eca8c8c
Ticket change [386e20e515] (rid 142606) by dgp on 2015-07-28 19:57:50:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
From RickyB98 on the chat: % info patch 8.6.4 % set go 1; set string 3; while {$go} {incr iter; append string +4/double([incr x 2]*($x+1)*($x+2))-4/double([incr x 2]*($x+1)*($x+2)); if {$iter > 10000000} {set go 0}}; concat % string length $string 883333447 % time {expr $string} unbalanced close paren in expression "...e(26843546*(26843546+1)*(26843546+2))-4/doubl..." % exit Original report was a segfault, and that indeed happens with Tcl 8.5.9. On trunk and core-8-5-branch tip we get the (false) parsing error message instead. Initial guess is that we're overflowing something or other. - foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "47. Bytecode Compiler"
- title initialized to: "Large [expr]ession parse error/segfault"
- type initialized to: "Bug"
Ticket change [f8d05c0283] (rid 142607) by dgp on 2015-07-28 21:14:13:
- icomment:
Initial debugging shows the bad parse taking place when the size of the nodes array is 268435456. Since the OpNode struct seems to be of size 32 bytes, that does seem to indicate we're getting too big for our ckalloc'ed britches.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [c1d57b192a] (rid 142614) by dgp on 2015-07-29 10:06:17:
- assignee changed to: "dgp"
- closedate changed to: "2457232.9210359"
- closer changed to: "dgp"
- icomment:
Overflow of allocation size repaired. Believe that's all of the problem, but hard to say since once parsing is repaired, that expression doesn't compute in less than hours. Quite possible days or even much much more.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [7c8f2d63b5] (rid 142615) by sebres on 2015-07-29 10:48:04:
- closer changed to: "nobody"
- icomment:
Are you sure, really? If I look at this code - I see an endless cycle if size > UINT_MAX/sizeof(OpNode) ... ``` OpNode *newPtr = NULL; do { if (size <= UINT_MAX/sizeof(OpNode)) { newPtr = (OpNode *) attemptckrealloc((char *) nodes, (unsigned int) size * sizeof(OpNode)); } } while ((newPtr == NULL) ``` Regards, sebres - login: "sebres"
- mimetype: "text/plain"
- status changed to: "Pending"
Ticket change [a8050f8ba8] (rid 142616) by sebres on 2015-07-29 11:10:40:
- closedate changed to: "2457232.96575051"
- closer changed to: "sebres"
- icomment:
Sorry, was my mistake, I have missed a line bottom, that belong this cycle also: && ((size -= (size - nodesUsed) / 2) > nodesUsed)); Thus is alright and ticket closed.
- login: "sebres"
- mimetype: "text/plain"
- status changed to: "Closed"
Ticket change [aed38859a1] (rid 142619) by dgp on 2015-07-29 12:47:56:
- closer changed to: "nobody"
- icomment:
It appears that my "days to calculate" observation came from doing the testing on a system starved for memory. Now on a better resourced system, I get: % set iter 0; set string 3; set x 0 0 % while {[incr iter] <= 7000000} { append string +4/double([incr x 2]*($x+1)*($x+2))-4/double([incr x 2]*($x+1)*($x+2)) }; concat % time {expr $string} make: *** [shell] Segmentation fault 7M terms is enough to prompt another segfault. Maybe compiling. Maybe execution. - login: "dgp"
- mimetype: "text/plain"
- status changed to: "Open"
Ticket change [0a145e1e2b] (rid 142620) by dgp on 2015-07-29 12:52:34:
- icomment:
sorry, no. Made an error and tested on an unpatched sandbox. Without the patch, the error is still there!
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [b50c30fddb] (rid 142622) by dgp on 2015-07-29 14:31:02:
- icomment:
The next actual failure I see is a panic unable to allocate enough memory for an expansion of the literal table. Even on a system with more memory, the literal table limits appear to be reached with this example.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [f1d89264af] (rid 142626) by dgp on 2015-07-29 14:55:55:
- closedate changed to: "2457233.12217053"
- closer changed to: "dgp"
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Closed"