[
https://issues.apache.org/jira/browse/GEODE-8756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17251971#comment-17251971
]
ASF GitHub Bot commented on GEODE-8756:
---------------------------------------
pdxcodemonkey commented on pull request #703:
URL: https://github.com/apache/geode-native/pull/703#issuecomment-748285361
@gaussianrecurrence This breaks the RHEL7 build, so the change has been
reverted in develop, sorry. Please open a new PR when resolved. Here's the
relevant output from the RHEL7 build:
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/string:53:0,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/random:40,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_algo.h:66,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/algorithm:62,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/regex:38,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:21:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/basic_string.tcc: In
instantiation of ‘static _CharT* std::basic_string<_CharT, _Traits,
_Alloc>::_S_construct(std::basic_string<_CharT, _Traits, _Alloc>::size_type,
_CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits; _Alloc
= apache::geode::client::size_tracking_allocator; std::basic_string<_CharT,
_Traits, _Alloc>::size_type = long unsigned int]’:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/basic_string.tcc:665:31:
required from ‘std::basic_string<_CharT, _Traits,
_Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>::size_type,
_CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits; _Alloc
= apache::geode::client::size_tracking_allocator; std::basic_string<_CharT,
_Traits, _Alloc>::size_type = long unsigned int]’
/home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:243:35:
required from here
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/basic_string.tcc:600:27:
error: no match for ‘operator==’ (operand types are ‘const
apache::geode::client::size_tracking_allocator’ and
‘apache::geode::client::size_tracking_allocator’)
if (__n == 0 && __a == _Alloc())
^
In file included from
/home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:33:0:
/home/geode/nativeclient/cppcache/shared/../src/util/size_tracking_allocator.hpp:92:8:
note: candidate: bool
apache::geode::client::size_tracking_allocator<_Tp>::operator==(const
apache::geode::client::size_tracking_allocator<_Tp>&) [with _Tp = char]
bool operator==(size_tracking_allocator const &) { return true; }
^
/home/geode/nativeclient/cppcache/shared/../src/util/size_tracking_allocator.hpp:92:8:
note: passing ‘const apache::geode::client::size_tracking_allocator*’ as
‘this’ argument discards qualifiers
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/list:63:0,
from /home/geode/nativeclient/cppcache/shared/../src/PdxType.hpp:23,
from /home/geode/nativeclient/cppcache/shared/../src/PdxTypeRegistry.hpp:33,
from /home/geode/nativeclient/cppcache/shared/../src/CacheImpl.hpp:37,
from
/home/geode/nativeclient/cppcache/shared/../src/DataOutputInternal.hpp:26,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:30:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_list.h:1807:5:
note: candidate: template<class _Tp, class _Alloc> bool std::operator==(const
std::list<_Tp, _Alloc>&, const std::list<_Tp, _Alloc>&)
operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
^
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_list.h:1807:5:
note: template argument deduction/substitution failed:
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/string:53:0,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/random:40,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_algo.h:66,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/algorithm:62,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/regex:38,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:21:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/basic_string.tcc:600:27:
note: ‘const apache::geode::client::size_tracking_allocator’ is not derived
from ‘const std::list<_Tp, _Alloc>’
if (__n == 0 && __a == _Alloc())
^
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/list:63:0,
from /home/geode/nativeclient/cppcache/shared/../src/PdxType.hpp:23,
from /home/geode/nativeclient/cppcache/shared/../src/PdxTypeRegistry.hpp:33,
from /home/geode/nativeclient/cppcache/shared/../src/CacheImpl.hpp:37,
from
/home/geode/nativeclient/cppcache/shared/../src/DataOutputInternal.hpp:26,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:30:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_list.h:285:5: note:
candidate: template bool std::operator==(const std::_List_iterator<_Tp>&, const
std::_List_const_iterator<_Val>&)
operator==(const _List_iterator<_Val>& __x,
^
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_list.h:285:5: note:
template argument deduction/substitution failed:
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/string:53:0,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/random:40,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_algo.h:66,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/algorithm:62,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/regex:38,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:21:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/basic_string.tcc:600:27:
note: ‘const apache::geode::client::size_tracking_allocator’ is not derived
from ‘const std::_List_iterator<_Tp>’
if (__n == 0 && __a == _Alloc())
^
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/unordered_set:48:0,
from /home/geode/nativeclient/cppcache/include/geode/CacheableKey.hpp:25,
from
/home/geode/nativeclient/cppcache/include/geode/CacheableBuiltins.hpp:30,
from
/home/geode/nativeclient/cppcache/include/geode/PdxInstanceFactory.hpp:25,
from /home/geode/nativeclient/cppcache/include/geode/RegionService.hpp:26,
from /home/geode/nativeclient/cppcache/include/geode/GeodeCache.hpp:23,
from /home/geode/nativeclient/cppcache/include/geode/Cache.hpp:27,
from /home/geode/nativeclient/cppcache/include/geode/CacheFactory.hpp:25,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:25:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/unordered_set.h:1421:5:
note: candidate: template<class _Value, class _Hash, class _Pred, class _Alloc>
bool std::operator==(const std::unordered_multiset<_Value, _Hash, _Pred,
_Alloc>&, const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>&)
operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
^
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/unordered_set.h:1421:5:
note: template argument deduction/substitution failed:
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/string:53:0,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/random:40,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_algo.h:66,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/algorithm:62,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/regex:38,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:21:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/basic_string.tcc:600:27:
note: ‘const apache::geode::client::size_tracking_allocator’ is not derived
from ‘const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>’
if (__n == 0 && __a == _Alloc())
^
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/unordered_set:48:0,
from /home/geode/nativeclient/cppcache/include/geode/CacheableKey.hpp:25,
from
/home/geode/nativeclient/cppcache/include/geode/CacheableBuiltins.hpp:30,
from
/home/geode/nativeclient/cppcache/include/geode/PdxInstanceFactory.hpp:25,
from /home/geode/nativeclient/cppcache/include/geode/RegionService.hpp:26,
from /home/geode/nativeclient/cppcache/include/geode/GeodeCache.hpp:23,
from /home/geode/nativeclient/cppcache/include/geode/Cache.hpp:27,
from /home/geode/nativeclient/cppcache/include/geode/CacheFactory.hpp:25,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:25:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/unordered_set.h:1409:5:
note: candidate: template<class _Value, class _Hash, class _Pred, class _Alloc>
bool std::operator==(const std::unordered_set<_Value, _Hash, _Pred, _Alloc>&,
const std::unordered_set<_Value, _Hash, _Pred, _Alloc>&)
operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
^
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/unordered_set.h:1409:5:
note: template argument deduction/substitution failed:
In file included from
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/string:53:0,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/random:40,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/stl_algo.h:66,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/algorithm:62,
from /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/regex:38,
from /home/geode/nativeclient/cppcache/test/CacheableStringTests.cpp:21:
/opt/rh/devtoolset-4/root/usr/include/c++/5.3.1/bits/basic_string.tcc:600:27:
note: ‘const apache::geode::client::size_tracking_allocator’ is not derived
from ‘const std::unordered_set<_Value, _Hash, _Pred, _Alloc>’
if (__n == 0 && __a == _Alloc())
^
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> CacheableString objectSize is not correct
> -----------------------------------------
>
> Key: GEODE-8756
> URL: https://issues.apache.org/jira/browse/GEODE-8756
> Project: Geode
> Issue Type: Sub-task
> Components: native client
> Affects Versions: 1.11.0, 1.12.0, 1.13.0, 1.13.1
> Reporter: Mario Salazar de Torres
> Assignee: Mario Salazar de Torres
> Priority: Major
> Labels: pull-request-available
>
> CacheableString objectSize function is returning an incorrect value.
> This class is based upon STL's string implementation, and most of the
> compilers implementations apply what's called SSO.
> What SSO basically does is if the string occupies less than a certain amount,
> no extra memory would be allocated in the heap, and the character-sequence
> would be stored in the object itself. This is typically achieved by using
> union semantics.
> Right now if SSO applies, objectSize calculates the size of std::string as
> sizeof(std::string) + m_str.capacity(), which is more than it actually
> occupies.
> On the other hand starting C++11 STL's strings needs to allocate an extra
> character
> to keep the null-terminator in the same buffer as the actual string. This is
> specified in section § 21.4.7.1 within the C++11 standard.
> Because of this objectSize should take the null-terminator into account,
> which was not the case.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)