Re: Upgrade 10.5->10.6 : db crash BUS ERROR (sig 10), reproducible

Поиск
Список
Период
Сортировка
От Palle Girgensohn
Тема Re: Upgrade 10.5->10.6 : db crash BUS ERROR (sig 10), reproducible
Дата
Msg-id 4BD693C6-B287-4153-A296-D65BB9874CB2@FreeBSD.org
обсуждение исходный текст
Ответ на Re: Upgrade 10.5->10.6 : db crash BUS ERROR (sig 10), reproducible  (Peter <pmc@citylink.dinoex.sub.org>)
Список pgsql-admin


9 mars 2019 kl. 01:17 skrev Peter <pmc@citylink.dinoex.sub.org>:

On Fri, Mar 08, 2019 at 08:22:33PM +0000, Andrew Gierth wrote:
! >>>>> "Peter" == Peter  <pmc@citylink.dinoex.sub.org> writes:
!
!  Peter> Extra Compiler-Options:
!  Peter>   -march=pentium3
!
! I CC'd you on my response to Palle, but to spell it out, what you need
! to do to fix this is either:
!
! 1. Remove the -march=pentium3 option.
!
! 2. Add the -mstackrealign option as well.

Yes, thank You, this got clear to me in the afternoon.

! Either way should work. Could you try (one or both, your preference) and
! report back?

Yes, -mstackrealign helps. So, as my local problem is now solved,
I am thinking about that "greater good for mankind" thing. ;)

At least one other person did run into the issue, and from Your
explanation I understand that this is not a postgres issue, but
could happen to any piece of software that decides to use gcc.

Now it seems easy to put this compiler option into the port's
specific makefile for postgreSQL, but it should actually be fixed
systemwide.

But, while it gets recommended to set the cpu-type systemwide on
FreeBSD, it is not recommend for the system owner to set CFLAGS
systemwide (even less specific ones for gcc - and I didn't find
a proper way to do that, anyway).

So my proposal is that this one belongs into /usr/ports/Mk/bsd.gcc.mk

+ .if ${MACHINE_CPU:Msse} && ${MACHINE_ARCH} == i386
+ CFLAGS+= -mstackrealign
+ .endif

That seems to work. Palle, Your opinion?

Well, we ideally want the binary packages built with the ports framework, for a specific platform, in this case i386, to work on all i386 machines. This makes it a bit more complicated. We would have to check if the user has any of -msse, -msse2, -march=pentium3 or later, or any similar flag that enables use of SSE or later, and if the underlying userland is built with clang, and in that case add -mstackrealign as well.

Perhaps, as Andrew suggests, just adding -mstackrealign defensively in the port for i386 is a reasonable tradeoff? It would not help for other ports though.

I'm cc:ing gerald@FreeBSD.org, maintainer of Mk/bsd.gcc.mk, to see if he has any i thoughts about this. I will forward Andrew's analyze to Gerald as well.

Palle



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

Предыдущее
От: Peter
Дата:
Сообщение: Re: Upgrade 10.5->10.6 : db crash BUS ERROR (sig 10), reproducible
Следующее
От: Peter
Дата:
Сообщение: Re: Upgrade 10.5->10.6 : db crash BUS ERROR (sig 10), reproducible