Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failure on sparc64 #1508

Closed
landryb opened this issue Jun 6, 2019 · 8 comments
Closed

build failure on sparc64 #1508

landryb opened this issue Jun 6, 2019 · 8 comments

Comments

@landryb
Copy link

landryb commented Jun 6, 2019

happens with 6.0 & 6.1 (didnt happen with 5.2), building on OpenBSD/sparc64:

Make proj.db                                                                                                                                                   
rm -f proj.db                                                                                                                                                  
Error: near line 5746: CHECK constraint failed: ellipsoid                                                                                                      
Error: near line 5748: CHECK constraint failed: ellipsoid  
...
Error: near line 5786: CHECK constraint failed: ellipsoid
Error: near line 18966: insert on alias_name violates constraint: new entry refers to unexisting code
Error: near line 18967: insert on alias_name violates constraint: new entry refers to unexisting code
...
Error: near line 19004: insert on alias_name violates constraint: new entry refers to unexisting code
Error: near line 19029: CHECK constraint failed: ellipsoid
...
Error: near line 19191: CHECK constraint failed: ellipsoid                     
Error: near line 19295: CHECK constraint failed: ellipsoid             
Error: near line 26200: insert on area violates constraint: west_lon <= east_lon OR (east_lon + 360 - west_lon <= 200)                                         
Error: near line 26617: insert on area violates constraint: south_lat <= north_lat                                                                             
Error: near line 27154: insert on area violates constraint: south_lat <= north_lat  
...
Error: near line 33235: insert on area violates constraint: south_lat <= north_lat
compound_crs|362|area|0                                                        
compound_crs|368|area|0                                                                                                                                        
compound_crs|369|area|0                                                                                                                                        
compound_crs|370|area|0                                                                                                                                        
compound_crs|371|area|0                                                                                                                                        
compound_crs|372|area|0                                                                                                                                        
compound_crs|373|area|0                                                                                                                                        
compound_crs|374|area|0                                                                                                                                        
compound_crs|375|area|0                                                                                                                                        
compound_crs|376|area|0                                                                                                                                        
compound_crs|377|area|0                                                                                                                                        
projected_crs|5407|area|0                                                                                                                                      
projected_crs|5648|area|0   
...
projected_crs|7187|area|0                                                                                                                                      
projected_crs|7188|area|0                                                                                                                                      
grid_transformation|404|area|0                                                                                                                                 
grid_transformation|405|area|0                                                                                                                                 
grid_transformation|406|area|0                                                                                                                                 
grid_transformation|407|area|0                                                                                                                                 
grid_transformation|409|area|0                                                                                                                                 
grid_transformation|410|area|0                                                                                                                                 
grid_transformation|411|area|0                                                                                                                                 
grid_transformation|412|area|0                                                                                                                                 
conversion_table|2527|area|8                                                                                                                                   
geodetic_datum|1|ellipsoid|2                                                                                                                                   
geodetic_datum|5|ellipsoid|2                                                                                                                                   
geodetic_datum|20|ellipsoid|2                                                                                                                                  
geodetic_datum|21|ellipsoid|2                                                                                                                                  
geodetic_datum|23|ellipsoid|2                                                  
geodetic_datum|46|ellipsoid|2                                                                                                                                  
geodetic_datum|79|ellipsoid|2                                                                                                                                  
geodetic_datum|107|ellipsoid|2                                                                                                                                 
geodetic_datum|119|ellipsoid|2                                                                                                                                 
geodetic_datum|120|ellipsoid|2                                                                                                                                 
geodetic_datum|122|ellipsoid|2                                                                                                                                 
geodetic_datum|123|ellipsoid|2    
...

and quite a bunch of others... can provide more details/full log if it helps. I suppose it's related to the endianess somewhere...

@QuLogic
Copy link
Contributor

QuLogic commented Jun 7, 2019

A scratch build on s390x passed, so I'm not sure it's big-endian related.

@landryb
Copy link
Author

landryb commented Jun 7, 2019

http://build-failures.rhaalovely.net/sparc64/2019-05-14/devel/proj.log is the full failing log for 6.0, tried 6.1 with similar outcome.

@rouault
Copy link
Member

rouault commented Jun 7, 2019

@landryb I suspect an issue with the sqlite3 binary on this platform. What you can do is modify data/Makefile.am to change the line
cat $${SQL_EXPANDED_LIST} | sqlite3 proj.db; \
into
cat $${SQL_EXPANDED_LIST} > /tmp/foo.sql && cat /tmp/foo.sql | sqlite3 proj.db; \
Then run autoreconf -i && automake, and build again.
Then outside of the build environment, rm -f tmp.db && cat /tmp/foo.sql | sqlite3 tmp.db should trigger the same errors. I've looked at the lines indicated in the build log, like Error: near line 5281: CHECK constraint failed: ellipsoid to see the SQL statements of /tmp/foo.sql that caused the errors, but the errors seem unjustified to me. It does not even look like numeric precision issues. So perhaps a bug with this particular sqlite3 version on that particular platform ? You might try with an older sqlite3 version to see if that makes a difference. In any case that'd be worth reporting to the sqlite3 project.

@landryb
Copy link
Author

landryb commented Jun 7, 2019

thanks @rouault for the STR, will try over the coming days. Per the logfile, this is using sqlite 3.28.0, as on other platforms where proj builds fine...

@jcourreges
Copy link

jcourreges commented Jun 8, 2019

@landryb I suspect an issue with the sqlite3 binary on this platform. What you can do is modify data/Makefile.am to change the line
cat $${SQL_EXPANDED_LIST} | sqlite3 proj.db; \
into
cat $${SQL_EXPANDED_LIST} > /tmp/foo.sql && cat /tmp/foo.sql | sqlite3 proj.db; \
Then run autoreconf -i && automake, and build again.
Then outside of the build environment, rm -f tmp.db && cat /tmp/foo.sql | sqlite3 tmp.db should trigger the same errors.

I noticed the same error on my OpenBSD/sparc64 machine and use something similar to produce a /tmp/foo.sql script.

I've looked at the lines indicated in the build log, like Error: near line 5281: CHECK constraint failed: ellipsoid to see the SQL statements of /tmp/foo.sql that caused the errors, but the errors seem unjustified to me. It does not even look like numeric precision issues.

I tried to manually reproduce the problem using the INSERTs in the ellipsoid table. The first line that failed was:

INSERT INTO "ellipsoid" VALUES('EPSG','1025','GSK-2011',NULL,'PROJ','EARTH',6378136.5,'EPSG','9001',298.2564151,NULL,0);

Suspecting a problem with floats, I tweaked "298.2564151" until the INSERT got accepted. So I removed the CHECK constraint on inv_flattening and retried the INSERT without changing the value this time: the INSERT was also accepted. The result:

sqlite> select * from ellipsoid; EPSG|1024|CGCS2000||PROJ|EARTH|6378137.0|EPSG|9001|298.257222101||0 EPSG|1025|GSK-2011||PROJ|EARTH|6378136.5|EPSG|9001|-298.2564151||0

There's a big nasty bug in sqlite3 on this platform:

sqlite> select 298.2564151; -298.2564151

So perhaps a bug with this particular sqlite3 version on that particular platform ? You might try with an older sqlite3 version to see if that makes a difference. In any case that'd be worth reporting to the sqlite3 project.

Indeed, thank you @rouault for the pointers.

@kbevers
Copy link
Member

kbevers commented Jun 10, 2019

There's a big nasty bug in sqlite3 on this platform:

Please report the bug to the SQLite project. I am closing this since it is not a PROJ issue.

@kbevers kbevers closed this as completed Jun 10, 2019
@landryb
Copy link
Author

landryb commented Jun 13, 2019

For the record, https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg115571.html but no feedback (yet?) from upstream.

@landryb
Copy link
Author

landryb commented Jun 21, 2019

And fwiw, ultimately it was a libc bug in OpenBSD, not a bug in sqlite3. Fixed by https://marc.info/?l=openbsd-cvs&m=156113647005489&w=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants