Re: pageinspect: Hash index support

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pageinspect: Hash index support
Дата
Msg-id 8921.1478109287@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pageinspect: Hash index support  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: pageinspect: Hash index support
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> So, we're down to crashes in gin_metapage_info() on ia64 and sparc64.
> My guess is that the raw page data that is passed into the function
> needs to be 8-byte aligned before being accessed as GinMetaPageData.

That's what it looks like to me, too.  The "bytea" page image is
guaranteed to be improperly aligned for 64-bit access, since it will have
an int32 length word before the actual page data, breaking the alignment
that would exist for a page sitting in a page buffer.  This is likely to
be a problem for more things than just gin_metapage_info(); sooner or
later it could affect just about everything in pageinspect.

> (Maybe GinPageGetMeta() should do it?)

I think the right thing is likely to be to copy the presented bytea
into a palloc'd (and therefore properly aligned) buffer.  And not
just in this one function.
        regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pageinspect: Hash index support
Следующее
От: Mithun Cy
Дата:
Сообщение: Re: Patch: Implement failover on libpq connect level.