Changeset: c09574a30651 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c09574a30651
Modified Files:
monetdb5/mal/mal_interpreter.mx
Branch: default
Log Message:
mal_interpreter: fix spurious hangs of DFLOWworker and scheduler
Properly check last is a positive value.
The last component was not checked and hence when -1, was retrieved as
array index. On 64-bits Intel-endian platforms, this apparently yielded
in coincidentially zero, while on 32-bits platforms, this returned some
random number. From there a cascade of wrong reads was done, just not
always causing a segfault. As a result, we stuck too long in a loop
waiting for work to be finished.
diffs (21 lines):
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -1068,7 +1068,7 @@
*/
nxtfs = 0;
if ( fs->pc >= 0 )
- for ( last = fs->pc - task->flow->start; (i =
task->flow->nodes[last]) > 0; last= task->flow->edges[last])
+ for ( last = fs->pc - task->flow->start; last >= 0 && (i =
task->flow->nodes[last]) > 0; last= task->flow->edges[last])
if (task->flow->status[i].state == DFLOWpending &&
task->flow->status[i].blocks == 1) {
task->flow->status[i].state = DFLOWrunning;
@@ -1279,7 +1279,7 @@
MT_lock_set(&flow->todo->l, "q_enqueue");
oldq= queued;
- for( ; (i = flow->nodes[last]) > 0; last= flow->edges[last])
+ for( ; last >= 0 && (i = flow->nodes[last]) > 0; last=
flow->edges[last])
if (flow->status[i].state == DFLOWpending)
{
flow->status[i].blocks--;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list