Using POLYLINE_NO_CLIP with Inline feature can result in a seg fault #4676

aboudreault opened this Issue Jun 28, 2013 · 6 comments


None yet

3 participants


When using a inline layer with the POLYLINE_NO_CLIP processing option, AGG crashes if the feature X and Y are completely outside the extend requested.

  • There is no bounds check in msLayerWhichShape for a inline layer.
  • Using POLYLINE_NO_CLIP disable the shape clipping, so the renderer tries to draw the shape.

Solution: For a INLINE layer, the searchrect will be stored in the layerinfo and a bounds check will be added in msLayerNextShape().

@aboudreault aboudreault was assigned Jun 28, 2013

Please provide a backtrace of the crash, or a testcase. I think this should be investigated at the AGG level rather than looking for a workaround.


The solution is not a workaround, but something that is missing with inline layers. All other drivers already skip the feature that are not in the map extent (in WhichShape). Currently, all inline features are drawn, which is very not optimal. That said, I'll also attach a testcase to allow you to fix the agg crash.

@aboudreault aboudreault pushed a commit that referenced this issue Jul 2, 2013
Alan Boudreault Fix: Using POLYLINE_NO_CLIP with Inline features can result in a seg …
…fault (#4676)

I've committed the improvement in master. @tbonfort let me know if you have any objection if I backport this in branch-6-2. About the AGG crash, you can reproduce it by downloading the following mapfile and shp2img (checkout the revision before my patch):

# success
shp2img -m -l layer1 -s 256 256 -o out.png 
# agg crash
shp2img -m -l layer1 -e -85.25390625 30.2783203125 -85.2099609375 30.322265625 -s 256 256 -o out.png

Will check the msautotest failure...

@aboudreault aboudreault pushed a commit that referenced this issue Jul 2, 2013
Alan Boudreault Fix regression with rfc14 (#4676) 3745e3c

Keeping this one open as there clearly is an issue with AGG when shape coordinates are magnitudes out of image bounds. Low priority though, demilestoning.

@tbonfort tbonfort was assigned Jul 23, 2013

This is an automated comment

This issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid.

Typically, issues fall in this state for one of the following reasons:

  • Hard, impossible or not enough information to reproduce
  • Missing test case
  • Lack of a champion with interest and/or funding to address the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment