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

Fix segfault with expression bindings on database backends #5161

Closed
wants to merge 1 commit into from

Conversation

mkofahl
Copy link
Contributor

@mkofahl mkofahl commented Sep 8, 2015

In some situations, attribute bindings may cause a segmentation fault, when executing multiple MapScript operations, e.g. queryByPoint() followed by draw() on the same layer. This is because the expression is tokenized only once - when uninitialized. In case of an attribute binding, the token bindval index points to the sql column-index built from the list of required attributes, in case of queryByPoint() all attributes are requested. A possibly following draw() will reduce the number of attributes to be queried from the database, so the column index in the resultset changes, but the expression token is still the same.

The fix is to free the expression object, when msLayerFreeItemInfo() is called, which is currently done at LayerClose() only.

mkofahl added a commit to faegi/mapserver that referenced this pull request Sep 30, 2015
@mkofahl
Copy link
Contributor Author

mkofahl commented Oct 20, 2015

@tbonfort Looks good to me now.

@tbonfort
Copy link
Member

tbonfort commented Feb 24, 2016

@sdlime can you please check this is OK for 7.0.1 ?

@sdlime
Copy link
Member

sdlime commented Dec 1, 2016

Thomas: Missed this one. Ok to include IMHO... --Steve

tbonfort pushed a commit that referenced this pull request Dec 5, 2016
@tbonfort tbonfort added this to the 7.0.3 Release milestone Dec 5, 2016
@tbonfort
Copy link
Member

tbonfort commented Dec 5, 2016

Applied to branch-7-0 in 7413952

@tbonfort tbonfort closed this Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants