GitHub user jianqiao opened a pull request:

    https://github.com/apache/incubator-quickstep/pull/18

    Fix a potential segfault in CompressedBlockBuilder

    This PR fixes a potential bug in `CompressedBlockBuilder`. This fix is 
necessary for a subsequent PR on `TextScanOperator` where each work order first 
constructs a `ColumnVectorsValueAccessor` and then bulk insert the value 
accessor into a `CompressedColumnStoreTupleStorageSubBlock`.
    
    In the typical scenario, `CompressedBlockBuilder` first collects tuples 
from a `ValueAccesor` into a `PtrVector<Tuple>` , then calls `buildDictionary` 
to process the tuples. However, the collected tuples do not own the underlying 
attribute values' **`out_of_line_data`** if the value is of `Char` or `VarChar` 
type. This incurs segmentation fault if the `ValueAccessor` (which owns the 
`out_of_line_data`) gets released before `buildDictionary` is completed.
    
    The fix is just to ensure that the `PtrVector<Tuple>` owns the underlying 
`out_of_line_data`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-quickstep 
fix-compressed-block-builder-tuple-values-not-owned

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-quickstep/pull/18.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18
    
----
commit e95b312d665ea3e6b1353b62f1efca19c303d48e
Author: Jianqiao Zhu <[email protected]>
Date:   2016-06-09T05:43:16Z

    Fix a potential segfault with CompressedBlockBuilder

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to