Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#4319 closed defect (fixed)

PostGIS 2.5.1 regression test failure on CentOS 6

Reported by: johnkharvey Owned by: pramsey
Priority: medium Milestone: PostGIS 2.5.4
Component: postgis Version: 2.5.x -- EOL
Keywords: Cc:

Description

Hello,

I'd like to report a regression test failure on PostGIS 2.5.1. This occurs during "make installcheck". For reference, I'm using PGDG's geos36 and proj49 as dependencies.

Below is my procedure to build/install/test:

# Install repos
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
sudo yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/pgdg-centos11-11-2.noarch.rpm

# Clone postgis and check out 2.5.1
mkdir -p /opt/git
cd /opt/git
git clone https://github.com/postgis/postgis/
cd postgis
git checkout 2.5.1

# Remove the pragma lines that cause compile errors
perl -p -i -e "s:^#pragma GCC diagnostic://#pragma GCC diagnostic:g" /opt/git/postgis/postgis/lwgeom_functions_basic.c
perl -p -i -e "s:^#pragma GCC diagnostic://#pragma GCC diagnostic:g" /opt/git/postgis/postgis/lwgeom_geos.c

# Install toolchain dependencies
sudo yum -y install autoconf automake libtool
sudo yum -y groupinstall "Development Tools"
sudo yum -y install gtk+-devel gtk2-devel

# Install postgis dependencies
sudo yum -y install postgresql11 postgresql11-devel postgresql11-libs postgresql11-server
sudo yum -y install geos36 geos36-devel
sudo yum -y install proj49 proj49-devel
sudo yum -y install libgeotiff libgeotiff-devel
sudo yum -y install gdal gdal-libs gdal-devel gdal-java
sudo yum -y install flex libxml2-devel
sudo yum -y install json-c-devel
sudo yum -y install ImageMagick
sudo yum -y install docbook-style-xsl
sudo yum -y install CUnit-devel
sudo yum -y install pcre-devel
sudo yum -y install libxslt-devel

# Make / install postgis
cd /opt/git/postgis
./autogen.sh
./configure --with-pgconfig=/usr/pgsql-11/bin/pg_config \
            --with-gui \
            --enable-rpath --libdir=/usr/pgsql-11/lib \
            --with-geosconfig=/usr/geos36/bin/geos-config \
            --with-projdir=/usr/proj49
make
sudo make install

# Stop PG
sudo su postgres -c "cd ~/ ; /usr/pgsql-11/bin/pg_ctl -w -D /var/lib/pgsql/11/data stop"
# Clean data
sudo rm -rf /var/lib/pgsql/11/data
# Init PG
sudo su postgres -c "cd ~/ ; /usr/pgsql-11/bin/initdb --data-checksums -D /var/lib/pgsql/11/data -E utf8 --locale=en_US.UTF-8"
# Start PG
sudo su postgres -c "cd ~/ ; /usr/pgsql-11/bin/pg_ctl -w -D /var/lib/pgsql/11/data -l /var/lib/pgsql/logfile start"

# Create a role for our user - assumes you are "vagrant" user.  Sub with your username as needed.
sudo su postgres -c "psql -c 'CREATE ROLE VAGRANT WITH LOGIN SUPERUSER;'"

make installcheck

Here is the result:

quantize_coordinates .. failed (diff expected obtained: /tmp/pgis_reg/test_63_diff)

Diving in a little deeper:

--- quantize_coordinates_expected	2019-02-01 11:45:29.000000000 -0500
+++ /tmp/pgis_reg/test_63_out	2019-02-01 11:52:05.728870502 -0500
@@ -2,5 +2,5 @@
 ERROR:  Must specify precision
 t3|t
 t4|t
-t5|t
+t5|f
 t6|t

This is the only test case that fails on EL-6 that I'm aware of.

Note that I had to comment out the #pragmas in 2 files up above:

  • postgis/lwgeom_functions_basic.c
  • postgis/lwgeom_geos.c

If I don't do that, I get a compiler errors like the following on EL-6 only:

error: #pragma GCC diagnostic not allowed inside functions

I'm thinking these pragma lines aren't the root cause and would be safe to remove for the build, but if that assumption is wrong, please let me know.

Hopefully this is helpful-- if you have any questions, please let me know.

Change History (12)

comment:1 by robe, 6 years ago

Milestone: PostGIS 2.5.2PostGIS 2.5.3

comment:2 by pramsey, 5 years ago

Hum, not reproducing on my VM... only difference is I used 2.5.2, unlikely that's a fix...

 quantize_coordinates .. ok 

Should be 32-bit platform...

Linux localhost.localdomain 2.6.32-573.el6.i686 #1 SMP Thu Jul 23 12:37:35 UTC 2015 i686 i686 i386 GNU/Linux

I wonder what else differs.

Version 1, edited 5 years ago by pramsey (previous) (next) (diff)

comment:3 by pramsey, 5 years ago

The #pragma stuff is because those pragmas were added in gcc 4.6 and EL6 only has gcc 4.4, so.

comment:4 by robe, 5 years ago

Milestone: PostGIS 2.5.3PostGIS 2.5.4

comment:5 by pramsey, 5 years ago

Hey presto, with an x64 platform I can reproduce this...

comment:6 by pramsey, 5 years ago

And there's a compiler warning right in the place that code runs

lwgeom.c: In function ‘trim_preserve_decimal_digits’:
lwgeom.c:2502: warning: dereferencing pointer ‘double_bits’ does break strict-aliasing rules
lwgeom.c:2500: note: initialized from here

comment:7 by pramsey, 5 years ago

In 17741:

Replace aliasing approach with blunt memcpy to avoid errors with some compilers
References #4319

comment:8 by pramsey, 5 years ago

In 17744:

Replace aliasing with memcpy
References #4319

comment:9 by pramsey, 5 years ago

I think this fixes the 64bit case, but there were still warnings into 32 bit build that were a bit concerning... basically the build seemed to think the sizes of double and uint64_t were not necessarily the same, which could lead to some bad results on 32-bit platforms.

comment:10 by pramsey, 5 years ago

Resolution: fixed
Status: newclosed

comment:11 by strk, 5 years ago

Paul would you mind adding a NEWS entry for these changes of yours in the stable-2.5 branch ? We now have a non-forgiving script that finds out these missing refs :)

comment:12 by johnkharvey, 5 years ago

I have confirmed that this is no longer an issue with the recently-released 2.5.4. Thank you!

Note: See TracTickets for help on using tickets.