Bug #50356 main.gis test fails when running 32-bit binary on Solaris on x86
Submitted: 15 Jan 2010 9:10 Modified: 12 Feb 2010 10:42
Reporter: Olav Sandstå Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: GIS Severity:S3 (Non-critical)
Version:5.5.99-m3 (Celosia) OS:Solaris (x86 32-bit)
Assigned to: CPU Architecture:Any
Tags: Sun Studio

[15 Jan 2010 9:10] Olav Sandstå
Description:
When running the main.gis test using binaries built with Sun Studio for 32-bit Solaris it fails with the following errors:

CURRENT_TEST: main.gis
--- /home/os136802/mysql/develop/repo/bug50221/mysql-test/r/gis.result  Tue Jan 12 20:12:14 2010
+++ /home/os136802/mysql/develop/repo/bug50221/mysql-test/r/gis.reject  Fri Jan 15 11:34:56 2010
@@ -318,8 +318,8 @@
 116    0
 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
 fid    AsText(Centroid(g))
-117    POINT(55.58852775304245 17.426536064113982)
-118    POINT(55.58852775304245 17.426536064113982)
+117    POINT(55.58852775304244 17.42653606411398)
+118    POINT(55.58852775304244 17.42653606411398)
 119    POINT(2 2)
 SELECT fid, Area(g) FROM gis_multi_polygon;
 fid    Area(g)
@@ -651,11 +651,11 @@
 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
 t1 where object_id=85998;
 object_id      geometrytype(geo)       ISSIMPLE(GEO)   ASTEXT(centroid(geo))
-85998  MULTIPOLYGON    0       POINT(115.31877315203187 -36.23747282102153)
+85998  MULTIPOLYGON    0       POINT(115.31877315203185 -36.23747282102153)
 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
 t1 where object_id=85984;
 object_id      geometrytype(geo)       ISSIMPLE(GEO)   ASTEXT(centroid(geo))
-85984  MULTIPOLYGON    0       POINT(-114.87787186923313 36.33101763469059)
+85984  MULTIPOLYGON    0       POINT(-114.87787186923329 36.33101763469052)
 drop table t1;
 create table t1 (fl geometry not null);
 insert into t1 values (1);

mysqltest: Result content mismatch

How to repeat:
1. Use the latest source version from mysql-next-mr-bugfixing

2. Compile it like this (or something similar) using Sun Studio:

   ./BUILD/autorun.sh
   ./configure CC=/opt/studio12/SUNWspro/bin/cc CXX=/opt/studio12/SUNWspro/bin/CC
CFLAGS="-Xa -m32 -mt -g" CXXFLAGS="-m32 -mt -g"
--prefix=/home/os136802/install/mysql-next-mr --with-client-ldflags=-static
--with-plugins=myisam,innobase --enable-dtrace --with-debug
    make

3. Run the test:

     cd mysql-test
     ./mysql-test-run.pl gis
[15 Jan 2010 10:29] Sveta Smirnova
Thank you for the report.

Verified as described.
[22 Jan 2010 10:59] Olav Sandstå
The original test failure was observed when running a 32 bit binary on a Solaris 10 on an x86 server. When running the same test on a 32 bit binary on a Solaris 10 on SPARC server the test passes without any failures.
[25 Jan 2010 13:22] Olav Sandstå
This test failure was observed having used Sun Studio 12 to compile MySQL. Using gcc 3.4.3 to compile 32-bit binaries the test runs without errors.
[25 Jan 2010 14:12] Olav Sandstå
Summary of my experimenting with different platforms and compilers:

* The test failure is only reproducible when using the Sun Studio compiler to compile 32 bit binaries and running the test on Solaris 10 on Intel or AMD x86 processors.

* It is not reproducible when running on:

   -64 bit binaries
   -on SPARC
   -or using the GCC 3.4.3 compiler to generate 32-bit code on x86
[26 Jan 2010 11:20] Olav Sandstå
To see if this test failure also is visible with older versions I used the latest source from mysql-5.1-bugteam and compiled it as given in the "how to repeat" section (without enabling support for DTrace). With this version of MySQL the main.gis test passes.

One difference I notice between the binaries when using the file command:

mysql-5.1-bugteam:

mysqld: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, not stripped

mysql-next-mr-bugfixing (5.5):

mysqld: ELF 32-bit LSB executable 80386 Version 1 [SSE FPU], dynamically linked, not stripped

I do not know the exact meaning of difference between these two but it seems to me that the 5.5 binaries are compiled to take advantage of the SSE instruction set.
[26 Jan 2010 11:37] Olav Sandstå
To check if this test failure is present in our latest published binaries I did the following:

1. Downloaded the latest public binary of 5.5 for Solaris 32 bit on x86, unpacked it

2. Run the main.gis test.

The test does not fail with this binary.
[12 Feb 2010 10:42] Alexander Nozdrin
It's duplicate of Bug#38959.
[27 Mar 2010 19:22] Joerg Bruehe
The same difference still happens in the release build of 5.5.3-m3,
even though the fix for bub#38959 is contained.
See my note about the platform difference there.

The above "duplicate" info is incomplete, anyways:
bug#38959 describes only the first difference.

The third one was (later) reported in bug#52208.

The second one was not reported anywhere else yet,
but I will add it to bug#52208.