Re: Test suite fails on alpha architecture

From: Jose Luis Rivero <yoswink(at)gentoo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, debian-alpha(at)lists(dot)debian(dot)org, alpha(at)gentoo(dot)org, pgsql-bugs(at)postgreSQL(dot)org, Martin Pitt <martin(at)piware(dot)de>
Subject: Re: Test suite fails on alpha architecture
Date: 2007-11-07 22:12:32
Message-ID: 20071107221231.GA9768@gentoo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Nov 07, 2007 at 02:41:51PM -0500, Steve Langasek wrote:
> On Wed, Nov 07, 2007 at 01:49:53PM -0500, Tom Lane wrote:
> > All the other diffs that Martin showed are divide-by-zero failures,
> > and I do not see any of them on Gentoo's machine. I think that this
> > must be a compiler bug. The first example in his diffs is just
> > "select 1/0", which executes this code:
>
> > int32 arg1 = PG_GETARG_INT32(0);
> > int32 arg2 = PG_GETARG_INT32(1);
> > int32 result;
>
> > if (arg2 == 0)
> > ereport(ERROR,
> > (errcode(ERRCODE_DIVISION_BY_ZERO),
> > errmsg("division by zero")));
>
> > result = arg1 / arg2;
>
> > It looks to me like Debian's compiler must be allowing the division
> > instruction to be speculatively executed before the if-test branch
> > is taken. Perhaps it is supposing that this is OK because control
> > will return from ereport(), when in fact it will not (the routine
> > throws a longjmp). Since we've not seen such behavior on any other
> > platform, however, I suspect this is just a bug and not intentional.
>
> > FWIW the Gentoo machine is running
>
> > $ gcc -v
> > Using built-in specs.
> > Target: alpha-unknown-linux-gnu
> > Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/alpha-unknown-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/alpha-unknown-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/alpha-unknown-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/alpha-unknown-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/alpha-unknown-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/alpha-unknown-linux-gnu/4.1.2/include/g++-v4 --host=alpha-unknown-linux-gnu --build=alpha-unknown-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
> > Thread model: posix
> > gcc version 4.1.2 (Gentoo 4.1.2)
>
> Ok, and Debian is building with gcc 4.2:
>
> $ gcc -v
> Using built-in specs.
> Target: alpha-linux-gnu
> Configured with: ../src/configure -v
> --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
> --enable-shared --with-system-zlib --libexecdir=/usr/lib
> --without-included-gettext --enable-threads=posix --enable-nls
> --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
> --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --disable-libssp
> --with-long-double-128 --enable-checking=release --build=alpha-linux-gnu
> --host=alpha-linux-gnu --target=alpha-linux-gnu
> Thread model: posix
> gcc version 4.2.3 20071014 (prerelease) (Debian 4.2.2-3)
> $
>
> Any chance of testing with a newer version of gcc on Gentoo as well to help
> confirm that the compiler is to blame?
>

In Gentoo the testcase gives the same "division by zero" under these
gcc versions:

Current Stable:
gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2)

Current Testing:
gcc version 4.2.2 (Gentoo 4.2.2 p1.0)

Feel free to add me if you have an open bug for this, in order to test anything you
need or provide some more information about our platform.

Thanks.

> > Bottom line is that I see nothing here that the Postgres project can
> > fix --- these are library and compiler bugs.
>
> Right; though whereas the floor() bug could simply be ignored since it will
> be fixed in glibc (or the kernel) when the time comes, if the other
> regressions are the result of a compiler problem then ignoring those
> failures would indeed mean distributing broken binaries.
>

--
Jose Luis Rivero <yoswink(at)gentoo(dot)org>
Gentoo/Doc Gentoo/Alpha

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-11-07 22:58:06 Re: Test suite fails on alpha architecture
Previous Message Pedro Gimeno 2007-11-07 22:04:53 Re: Test suite fails on alpha architecture