Opened 20 years ago

Last modified 13 years ago

#828 assigned defect

MapScript hangs when using MAXINTERVAL in a grid

Reported by: b.veldkamp@… Owned by: sdlime
Priority: high Milestone: 6.0 release
Component: MapServer C Library Version: 4.3
Severity: normal Keywords:
Cc: jnovak@…, aboudreault

Description (last modified by sdlime)

This layer works, but MapScript hangs when I uncomment MAXINTERVAL:

LAYER
  NAME "Grid"
  PROJECTION
    "init=epsg:28992"
  END
  METADATA
    WMS_TITLE "Graticule"
  END
  TYPE LINE
  STATUS on
  CLASS
    COLOR 128 128 128
    LABEL
      TYPE truetype
      FONT arial
      SIZE 7
      COLOR 0 0 0
      PARTIALS FALSE
    END
  END
  GRID
    LABELFORMAT "%5.0f"
    MAXARCS 10
#    MAXINTERVAL 10
    MAXSUBDIVIDE 2
  END
END

Attachments (1)

bad.map (1.8 KB ) - added by php@… 19 years ago.
MapFile reproducing Bug #828

Download all attachments as: .zip

Change History (18)

comment:1 by sdlime, 20 years ago

Summary: MapScript hangs when using MAXINTERVAL in a grid MapScript hangs when using MAXINTERVAL in a grid
Which MapScript language?

comment:2 by b.veldkamp@…, 20 years ago

PHP/MapScript (Chameleon)

comment:3 by sdlime, 20 years ago

Component: MapScriptMapScript-PHP
Owner: changed from sdlime to mapserverbugs

comment:4 by dmorissette, 20 years ago

Did you try this same mapfile with the CGI? Or could you please try it with the
CGI and see if it hangs as well.

comment:5 by assefa, 19 years ago

Milestone: 4.4 release
I have added the following layer in the gmap map file and It produced a valid 
grid (using php/mapscript and cgi) with the latest mapserver. Is this still an 
issue ?

  LAYER
    NAME "my_grid"
    PROJECTION
      "proj=latlong"
    END
    SIZEUNITS PIXELS
    STATUS ON
    TOLERANCE 0
    TOLERANCEUNITS PIXELS
    TYPE LINE
    UNITS METERS
    CLASS
      LABEL
        ANGLE 0.000000
        ANTIALIAS TRUE
        FONT fritqat
        MAXSIZE 256
        MINSIZE 4
        SIZE 6
        TYPE TRUETYPE
        BUFFER 0
        COLOR 0 0 0
        FORCE FALSE
        MINDISTANCE -1
        MINFEATURESIZE -1
        OFFSET 0 0
        PARTIALS TRUE
        POSITION CC
      END
      STYLE
          COLOR 255 0 0
        MAXSIZE 100
        MINSIZE 1
        SIZE 1
        SYMBOL 0
      END
    END
        GRID
    LABELFORMAT "%5.0f"
    MAXARCS 10
    MAXINTERVAL 10
    MAXSUBDIVIDE 2
  END

#      GRID
#        MINSUBDIVIDE 0
#        MAXSUBDIVIDE 0
#        MININTERVAL 0.000000
#        MAXINTERVAL 5.000000
#        MINARCS 0
#        MAXARCS 0
#        LABELFORMAT DDMM
#      END
  END

comment:6 by assefa, 19 years ago

Status: newassigned

comment:7 by assefa, 19 years ago

Resolution: wontfix
Status: assignedclosed
Please reopen if it is still an issue.

by php@…, 19 years ago

Attachment: bad.map added

MapFile reproducing Bug #828

comment:8 by php@…, 19 years ago

Resolution: wontfix
Status: closedreopened
I am able to reproduce this issue with PHP/MapScript in MapServer 4.6.0 beta3.
Relevant details:

Reproducing MapFile:
Attached

System:
Linux 2.6.9-1.667 #1 Tue Nov 2 14:50:10 EST 2004 x86_64 x86_64 x86_64 GNU/Linux

MapServer Configuration:
 ./configure --with-gd=/usr/local --with-png=/usr/local
--with-freetype=/usr/local --with-jpeg=/usr/local --with-php=../php-4.3.10
--with-proj=../proj-4.4.9 --with-ogr=/usr/local/bin/gdal-config
--with-gdal=/usr/local/bin/gdal-config

Accessory Versions:
gd-2.0.33
libpng-1.2.8-config
freetype-2.1.9
jpeg-6b
php-4.3.10
proj-4.4.9
gdal-1.2.6

Notes:
This "hang" (looks to be a memory gobbling infinite loop that ulimit caps
(eventually)) appears only when including the MAXINTERVAL directive. I was using
a custom layer for the grid, but the issue exists even with the
documentation-provided example of GRID (which is in the attached mapfile).

Perhaps relevant: this appeared only after rebuilding MapServer with GDAL libraries.

comment:9 by php@…, 19 years ago

Follow-up: MININTERVAL exhibits the same behaviour. A workaround seems to be use
MAXARCS/MINARCS.

comment:10 by dmorissette, 19 years ago

Cc: mapserver-bugs@… added
Milestone: 4.4 release4.6 release
Owner: changed from mapserverbugs to dmorissette@…
Status: reopenednew
I am able to reproduce. Checking this now.

comment:11 by dmorissette, 19 years ago

Cc: jnovak@… added
Component: MapScript-PHPMapServer C Library
Owner: changed from dmorissette@… to sdlime
This is not a MapScript-specific issue, it's an issue with the mapgraticule.c
code and it can be reproduced with the attached mapfile and the following call:

http://localhost/cgi-bin/mapserv?map=/tmp/test.map&mode=map&layer=grid

It seems to me that a projection would be missing at the top-level in the
mapfile for MapServer to produce a grid, otherwise how is the graticule stuff
expected to know what the extents line means (EXTENT 2087266.442091
730738.923939 2098790.326038 746347.509157) and how to convert those values to a
grid in degrees?

After adding a dummy projection and enlarging the extents a bit, just for
testing, I was able to get a grid, e.g. 
    PROJECTION
     "init=epsg:42304"
    END
    EXTENT 0 0 2098790.326038 746347.509157

It could be that the graticule code assumes that the values are in degrees if no
projection is set(?), and tries to generate a grid for a map that would be more
or less 10,000 degrees wide by 15,000 degrees high.

Reassigned to Steve, and CC'd John Novak since the two of them seem to share
ownership of that code.

comment:12 by dmorissette, 19 years ago

Oh, BTW, while looking into this, I ran into indirectly related issues because
failures from msGetLabelSize() were not propagated up to the caller of
msGraticuleLayerNextShape(). I have committed a fix for that in CVS, and now if
an invalid font is specified in the graticule layer, the user gets an error message.

comment:13 by sdlime, 17 years ago

Description: modified (diff)
Milestone: 5.0 release5.2 release

Dan:

comment:14 by sdlime, 16 years ago

Status: newassigned

comment:15 by sdlime, 16 years ago

Dan: The projection line in this test case has no effect when run so a grid in the output coordinate system is generated. Some how we're getting into an infinite loop, perhaps not in the grid code, but elsewhere are a result of bogus output.

Steve

comment:16 by sdlime, 16 years ago

Milestone: 5.2 release5.4 release

I can't find the source easily, moving to 5.4 so I can find the time to understand the grid code...

Steve

comment:17 by dmorissette, 13 years ago

Cc: aboudreault added
Milestone: 5.6 release6.0 release

5.4/5.6 are over, moving to 6.0

Note: See TracTickets for help on using tickets.