Re: cvs head initdb hangs on unixware

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: cvs head initdb hangs on unixware
Дата
Msg-id 28494.1228760128@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: cvs head initdb hangs on unixware  (ohp@pyrenet.fr)
Ответы Re: cvs head initdb hangs on unixware  (ohp@pyrenet.fr)
Список pgsql-hackers
ohp@pyrenet.fr writes:
> the infinite loop occurs in fsm_search_avail when called for the 32nd 
> time.

... which is the first time that the initial test doesn't make it fall
out immediately.

Would you add a couple more printouts, along the line of

nodeno = target;while (nodeno > 0){
+        fprintf(stderr, "ascend at node %d value %d\n",
+            nodeno, fsmpage->fp_nodes[nodeno]);
    if (fsmpage->fp_nodes[nodeno] >= minvalue)        break;
    /*     * Move to the right, wrapping around on same level if necessary,     * then climb up.     */    nodeno =
parentof(rightneighbor(nodeno));}
/* * We're now at a node with enough free space, somewhere in the middle of * the tree. Descend to the bottom,
followinga path with enough free * space, preferring to move left if there's a choice. */while (nodeno <
NonLeafNodesPerPage){   int leftnodeno = leftchild(nodeno);    int rightnodeno = leftnodeno + 1;    bool leftok =
(leftnodeno< NodesPerPage) &&        (fsmpage->fp_nodes[leftnodeno] >= minvalue);    bool rightok = (rightnodeno <
NodesPerPage)&&        (fsmpage->fp_nodes[rightnodeno] >= minvalue);
 

+        fprintf(stderr, "descend at node %d value %d, leftnode %d value %d, rightnode %d value %d\n",
+            nodeno, fsmpage->fp_nodes[nodeno],
+            leftnodeno, fsmpage->fp_nodes[leftnodeno],
+            rightnodeno, fsmpage->fp_nodes[rightnodeno]);
    if (leftok)        nodeno = leftnodeno;    else if (rightok)        nodeno = rightnodeno;    else

(I'm assuming we can print possibly-off-the-end array elements without dumping
core; which is bogus in general but I expect we can get away with it
for this purpose.)

Also, we don't really need 94MB of log to convince us it's an
infinite loop ;-)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Regexps vs. locale
Следующее
От: KaiGai Kohei
Дата:
Сообщение: Re: Updates of SE-PostgreSQL 8.4devel patches (r1268)