Ticket #2227 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

AGG:incorrect lookup of symbol in symbolset

Reported by: cph Owned by: tbonfort
Priority: normal Milestone: 5.0 release
Component: AGG Version: unspecified
Severity: critical Keywords:
Cc: hobu, sdlime

Description

when using dynamic symbols there is a lookup in the symbolset but the symbol should be looked up in the mapfile.

This problem only happens with the AGG driver.

Attachments

test2.map Download (6.3 KB) - added by cph 6 years ago.
the file which shows an AGG crash

Change History

Changed 6 years ago by tbonfort

please be more specific (layer type, symbol definition, style definition, etc) I cannot reproduce this here

Changed 6 years ago by cph

I use PCL to generate the mapserver object hierarchy. The attached works for the GD driver but not for the AGG driver. Note that if you change the line 341 from "SYMBOL 1" to "SYMBOL 0" it does not crash.

Changed 6 years ago by cph

the file which shows an AGG crash

Changed 6 years ago by sdlime

You mean line 104?

Changed 6 years ago by tbonfort

am I missing something or does symbol 1 not exist?
why are you talking about inline symbols? there are no inline symbol definitions here
"works with gd": what kind of output do you get
"crash with agg": segmentation fault, or wrong style applied, or nothing drawn ?

Changed 6 years ago by cph

sdlime: sorry yes 104

Changed 6 years ago by cph

tbonfort: as I mentioned I use mapserver only thru PCL, not generally using a mapfile definition directly. Symbol 1, does indeed not exist in the mapfile provided, but this is because that symbol is defined by PCL and added to the mapfile object.

When I change line 104 from "0" to "1", the AGG driver does not cause mapserver to segfault. When the value is "0" there is a segmentation fault in mapagg.cpp at line : 1414

Changed 6 years ago by tbonfort

ok... found it. GD just skips drawing when symbol>numsymbols will fix in next commit

Changed 6 years ago by tbonfort

  • status changed from new to closed
  • resolution set to fixed

fixed in r6569
thanks

Changed 6 years ago by cph

  • status changed from closed to reopened
  • resolution fixed deleted

When I have "SYMBOL 1" I still get a core dump in mapagg.cpp line 1418

1417:    symbolObj *symbol = symbolset->symbol[style->symbol];;
1418:    if(!MS_VALID_COLOR(style->color) && MS_VALID_COLOR(style->outlinecolor) && symbol->type != MS_SYMBOL_PIXMAP) 

as symbol is NULL

Changed 6 years ago by tbonfort

steve:

the test posing problem is

if(style->symbol > symbolset->numsymbols || style->symbol < 0) return; /* no such symbol, 0 is OK   */

This is code that isn't specific to the agg renderer, so I wonder why there's no segfault with gd. changing the > to >= should fix this. I think the gd code should be updated too, but waiting on your comments on this as this is puzzling me.

Changed 6 years ago by sdlime

You are correct. Amazing... I suspect it hasn't come up for a couple of reasons: 1) people use symbol names, 2) you get the crash, fix the mistake and move on. Only a situation like this one would cause the error. Anyway, I've fixed in both AGG and GD code. (r6586)

Steve

Changed 6 years ago by sdlime

  • status changed from reopened to closed
  • resolution set to fixed
  • milestone set to 5.0 release

Closing...

Note: See TracTickets for help on using tickets.