Changes between Initial Version and Version 5 of Ticket #3324


Ignore:
Timestamp:
Mar 21, 2010, 8:05:24 AM (14 years ago)
Author:
dmorissette
Comment:

Reopening.

I have received a report that 5.6.2 (which includes the fix above) breaks with the following error with a mode=map request with mapext=2701967.5295031+1184936.875+2705055.4704969+1186876.375

msDrawMap(): Image handling error. Failed to draw layer named 'ownershipqpoly'.
msPostGISLayerWhichShapes(): Query error. Failed to build query SQL.
msPostGISBuildSQL(): General error message. Failed to build SQL 'where'.
msPostGISBuildSQLWhere(): General error message. Unable to build box SQL.
msPostGISBuildSQLBox: General error message. Bounding box digits truncated. 

The "%.15f" format does NOT guarantee a total of 15 digits, it requests 15 digits AFTER the decimal point... so in most cases you are guaranteed to get more than 15 digits e.g.

printf("%.15f\n%.15f\n%.15f\n%.15f\n", 2701967.5295031, 1184936.875, 2705055.4704969, 1186876.375);

2701967.529503100086004
1184936.875000000000000
2705055.470496899913996
1186876.375000000000000

I think the right fix would be to use the %.15g format and account a few extra chars per coordinate for the potential use of exponential notation.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3324

    • Property Owner changed from sdlime to pramsey
    • Property Status newreopened
    • Property Milestone5.6.2 release
  • Ticket #3324 – Description

    initial v5  
    11Trunk svn 9801.
    2 
     2{{{
    33==20521== Invalid write of size 1
    44==20521==    at 0x4E67BC4: _IO_default_xsputn (in /lib/libc-2.9.so)
     
    1212==20521==    by 0x814CF62: msPostGISBuildSQLBox (in /net/lafont/home/santisa/src/mapserver/trunk/map
    1313server/mapserv)
     14}}}