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

(JP) tcache_create_column_store()内で確保したメモリの初期化が一部行われないことがある #39

Closed
taiki-k opened this issue Jun 17, 2014 · 1 comment
Labels
bug developer confirmed the steps to reproduce the problem, and does not work as expected

Comments

@taiki-k
Copy link
Contributor

taiki-k commented Jun 17, 2014

#37 の調査中に発見しました。

tcache_create_column_store()で共有メモリからColumn Store用にメモリを確保していますが、
確保する際のサイズ(tcache.c:433)と、その直後に0で初期化する際のサイズ(tcache.c:436)が異なっていおり、
tcsのcdata以降の領域が初期化されことがあります。

直後のコードで具体的な値が代入されていくため、問題がないように見えましたが、
tcache.c:456からのfor文中のbms_is_member()がfalseを返却した場合、
cdataにゴミデータが残ったままとなってしまいます。

@kaigai
Copy link
Contributor

kaigai commented Jun 18, 2014

確かに。tcache_column_store は可変長なので、offsetof(tcache_column_store, cdata[tupdesc->natts]) で初期化する必要がありますね。直しておきました。
ただ、length は tcs のヘッダおよびデータ領域を含むサイズ(数MB~数十MB)なので、これ全体をゼロクリアする必要はありません。

修正したのでクローズします。

@kaigai kaigai closed this as completed Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug developer confirmed the steps to reproduce the problem, and does not work as expected
Projects
None yet
Development

No branches or pull requests

2 participants