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

ARROW-6562: [GLib] Fix returning wrong sliced data of GArrowBuffer #5382

Closed
wants to merge 1 commit into from

Conversation

kou
Copy link
Member

@kou kou commented Sep 14, 2019

We should not share the GBytes data of the original buffer with the
sliced buffer because the sliced buffer has different offset and size
with the original buffer.

The sliced buffer should have reference to the original buffer. If we
shouldn't have it, the original buffer may be freed when the sliced
buffer is used.

This change disables get_property of PROP_DATA. This is not related to
this fix. But I include this change. Sorry.

Users should use garrow_buffer_get_data() to get data instead of
get_property of PROP_DATA. So we should not provide get_property of
PROP_DATA.

We should not share the GBytes data of the original buffer with the
sliced buffer because the sliced buffer has different offset and size
with the original buffer.

The sliced buffer should have reference to the original buffer. If we
shouldn't have it, the original buffer may be freed when the sliced
buffer is used.

This change disables get_property of PROP_DATA. This is not related to
this fix. But I include this change. Sorry.

Users should use garrow_buffer_get_data() to get data instead of
get_property of PROP_DATA. So we should not provide get_property of
PROP_DATA.
@kou kou force-pushed the glib-buffer-fix-wrong-sliced-data branch from 9b6cc04 to 7ebea86 Compare September 15, 2019 21:31
Copy link
Contributor

@shiro615 shiro615 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shiro615 shiro615 closed this in dcc1e9d Sep 17, 2019
@kou kou deleted the glib-buffer-fix-wrong-sliced-data branch September 17, 2019 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants