Bankim Bhavsar has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/15767


Change subject: [util] Don't use static function ptrs for non-static member 
functions in BlockBloom filter
......................................................................

[util] Don't use static function ptrs for non-static member functions in 
BlockBloom filter

Use of static function pointers to non-static member functions causes
crash in Kudu client in Impala test cases.

Backtrace from an instrumented build that checks for null function pointer:
https://gist.github.com/bbhavsar/1580e5e897dcd7271bad623f7da631f0

I don't understand the problem completely but it seems that static
POD like std::once_flag doesn't get destructed but non-POD like static function 
pointers
appear to get destructed which leads to a null function pointer being invoked.

I couldn't reproduce the problem in Kudu using similar combination of Bloom 
filter
predicate and range predicate values.

Insert/Find functions are commonly used functions in Bloom filter in hot path
whereas OrEqualArray is not so common.
So this change:
- Uses non-static member function pointers for Insert/Find that are initialized
in constructor(this is same as the change before introduction of OrEqual 
functions)
avoiding the branch in Insert/Find.
- Doesn't use a static function pointer for OrEqual functions and checks for 
AVX2
capability at run-time on every invocation.

Tests:
- No crashes with the same test run in Impala with the fix.

Change-Id: I39703fd1a7e256ff60ef86d0b370590fbb526380
---
M src/kudu/util/block_bloom_filter-test.cc
M src/kudu/util/block_bloom_filter.cc
M src/kudu/util/block_bloom_filter.h
3 files changed, 45 insertions(+), 50 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/67/15767/1
--
To view, visit http://gerrit.cloudera.org:8080/15767
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I39703fd1a7e256ff60ef86d0b370590fbb526380
Gerrit-Change-Number: 15767
Gerrit-PatchSet: 1
Gerrit-Owner: Bankim Bhavsar <[email protected]>

Reply via email to