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

Projects
None yet
3 participants
@mkofahl
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@mkofahl

mkofahl Oct 20, 2015

Contributor

@tbonfort Looks good to me now.

Contributor

mkofahl commented Oct 20, 2015

@tbonfort Looks good to me now.

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Feb 24, 2016

Member

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

Member

tbonfort commented Feb 24, 2016

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

@sdlime

This comment has been minimized.

Show comment
Hide comment
@sdlime

sdlime Dec 1, 2016

Member

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

Member

sdlime commented Dec 1, 2016

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

tbonfort added 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

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Dec 5, 2016

Member

Applied to branch-7-0 in 7413952

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