Re: Some bogus results from prairiedog

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Some bogus results from prairiedog
Дата
Msg-id 7935.1406074457@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Some bogus results from prairiedog  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Some bogus results from prairiedog  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Jul 22, 2014 at 12:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Anyway, to cut to the chase, the crash seems to be from this:
>> TRAP: FailedAssertion("!(FastPathStrongRelationLocks->count[fasthashcode] > 0)", File: "lock.c", Line: 2957)
>> So there is still something rotten in the fastpath lock logic.

> Gosh, that sucks.

> The inconstancy of this problem would seem to suggest some kind of
> locking bug rather than a flat-out concurrency issue, but it looks to
> me like everything relevant is marked volatile.

I don't think that you need any big assumptions about machine-specific
coding issues to spot the problem.  The assert in question is here:
   /*    * Decrement strong lock count.  This logic is needed only for 2PC.    */   if (decrement_strong_lock_count
 && ConflictsWithRelationFastPath(&lock->tag, lockmode))   {       uint32    fasthashcode =
FastPathStrongLockHashPartition(hashcode);
       SpinLockAcquire(&FastPathStrongRelationLocks->mutex);
Assert(FastPathStrongRelationLocks->count[fasthashcode]> 0);       FastPathStrongRelationLocks->count[fasthashcode]--;
    SpinLockRelease(&FastPathStrongRelationLocks->mutex);   }
 

and it sure looks to me like that
"ConflictsWithRelationFastPath(&lock->tag" is looking at the tag of the
shared-memory lock object you just released.  If someone else had managed
to recycle that locktable entry for some other purpose, the
ConflictsWithRelationFastPath call might incorrectly return true.

I think s/&lock->tag/locktag/ would fix it, but maybe I'm missing
something.
        regards, tom lane



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: proposal (9.5) : psql unicode border line styles
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Diagnose incompatible OpenLDAP versions during build and test.