Re: cvs head initdb hangs on unixware

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: cvs head initdb hangs on unixware
Дата
Msg-id 18738.1228847061@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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:
> FWIW, I have attached the 2 generated .s. Someone with knowledge of asm
> may want to have a look..

Hmm.  It looks to me like the compiler is getting confused by the
interaction between nodeno, leftnodeno, and rightnodeno.  Try this
patch to see if it gets around it.  (This is a tad better anyway
since it avoids examining the right child if not needed.)

            regards, tom lane

Index: fsmpage.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/storage/freespace/fsmpage.c,v
retrieving revision 1.2
diff -c -r1.2 fsmpage.c
*** fsmpage.c    7 Oct 2008 21:10:11 -0000    1.2
--- fsmpage.c    9 Dec 2008 18:18:53 -0000
***************
*** 243,259 ****
       */
      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);
!
!         if (leftok)
!             nodeno = leftnodeno;
!         else if (rightok)
!             nodeno = rightnodeno;
          else
          {
              /*
--- 243,262 ----
       */
      while (nodeno < NonLeafNodesPerPage)
      {
!         int childnodeno = leftchild(nodeno);
!
!         if (childnodeno < NodesPerPage &&
!             fsmpage->fp_nodes[childnodeno] >= minvalue)
!         {
!             nodeno = childnodeno;
!             continue;
!         }
!         childnodeno++;            /* point to right child */
!         if (childnodeno < NodesPerPage &&
!             fsmpage->fp_nodes[childnodeno] >= minvalue)
!         {
!             nodeno = childnodeno;
!         }
          else
          {
              /*

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

Предыдущее
От: "Vladimir Sitnikov"
Дата:
Сообщение: Re: contrib/pg_stat_statements 1202
Следующее
От: "Robert Haas"
Дата:
Сообщение: Re: contrib/pg_stat_statements 1202