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

ASAN:undefined-behavior issue in QLTestSelectedExpr_TestCastDecimal #1241

Closed
OlegLoginov opened this issue Apr 23, 2019 · 2 comments
Closed
Assignees

Comments

@OlegLoginov
Copy link
Contributor

1181 I 7.880555 20474 ql-test-base.h:136 Got result. Return type = 2
1182 src/yb/util/bfql/bfunc_convert.h:95:11: runtime error: 5e+308 is outside the range of representable values of type 'float'
1183 #0 0x7fb80ba39b82 in yb::Status yb::bfql::SetNumericResult<yb::Status ()(float, yb::QLValue), yb::QLValue*, yb::QLValue*>(yb::Status ()(float, yb::QLValue), yb::QLValue*, yb::DataType, yb::QLValue*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/util/bfql/bfunc_convert.h:95:11
1184 #1 0x7fb80ba37d98 in yb::Status yb::bfql::ConvertToNumeric<yb::QLValue*, yb::QLValue*, yb::Result ()(yb::Slice), yb::Status ()(float, yb::QLValue*)>(yb::QLValue*, yb::QLValue*, yb::DataType const&, yb::Result ()(yb::Slice), yb::Status ()(float, yb::QLValue*)) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/util/bfql/bfunc_convert.h:1300:12
1185 #2 0x7fb80ba37bcf in yb::Status yb::bfql::ConvertToFloat<yb::QLValue*, yb::QLValue*>(yb::QLValue*, yb::QLValue*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/util/bfql/bfunc_convert.h:1330:10
1186 #3 0x7fb80b9da639 in yb::Status yb::bfql::OPERATOR_ConvertToFloat_134::ExecRefAndRaw<yb::QLValue, yb::QLValue>(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/src/yb/util/bfql/gen_operator.h:3800:12
1187 #4 0x7fb80ba3fe28 in decltype(std::__1::forward<yb::Status (&)(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue*)>(fp)(std::__1::forward<std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >>(fp0), std::__1::forwardyb::QLValue*(fp0))) std::__1::__invoke<yb::Status (&)(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue), std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue>(yb::Status (&)(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue*), std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >&&, yb::QLValue&&) /n/jenkins/thirdparty/yugabyte-thirdparty-2019-02-28T08_28_04/thirdparty/installed/asan/libcxx/include/c++/v1/type_traits:4345:1
1188 #5 0x7fb80ba3fe28 in yb::Status std::__1::__invoke_void_return_wrapperyb::Status::__call<yb::Status (&)(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue*), std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue>(yb::Status (&)(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue*), std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >&&, yb::QLValue&&) $YB_THIRDPARTY_DIR/installed/asan/libcxx/include/c++/v1/__functional_base:318
1189 #6 0x7fb80ba3fd0d in std::__1::__function::__func<yb::Status ()(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue*), std::__1::allocator<yb::Status ()(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue*)>, yb::Status (std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue)>::operator()(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >&&, yb::QLValue&&) $YB_THIRDPARTY_DIR/installed/asan/libcxx/include/c++/v1/functional:1562:12
1190 #7 0x7fb80ba3f7b7 in std::__1::function<yb::Status (std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue)>::operator()(std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue) const $YB_THIRDPARTY_DIR/installed/asan/libcxx/include/c++/v1/functional:1913:12
1191 #8 0x7fb80b9bba05 in yb::bfql::BFExecApi<yb::QLValue, yb::QLValue, std::__1::vector, std::__1::allocator>::ExecQLOpcode(yb::bfql::BFOpcode, std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/util/bfql/bfql.h:317:16
1192 #9 0x7fb80b9baeb5 in yb::QLBfunc::Exec(yb::bfql::BFOpcode, std::__1::vector<yb::QLValue, std::__1::allocatoryb::QLValue >, yb::QLValue) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/common/ql_bfunc.cc:42:10
1193 #10 0x7fb80ba6a4f6 in yb::QLExprExecutor::EvalBFCall(yb::QLBCallPB const&, yb::QLTableRow const&, yb::QLValue*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/common/ql_expr.cc:123:10
1194 #11 0x7fb80ba694a5 in yb::QLExprExecutor::EvalExpr(yb::QLExpressionPB const&, yb::QLTableRow const&, yb::QLValue*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/common/ql_expr.cc
1195 #12 0x7fb814f95550 in yb::docdb::QLReadOperation::PopulateResultSet(yb::QLTableRow const&, yb::QLResultSet*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/docdb/cql_operation.cc:1204:5
1196 #13 0x7fb814f942f2 in yb::docdb::QLReadOperation::AddRowToResult(std::__1::unique_ptr<yb::common::QLScanSpec, std::__1::default_deleteyb::common::QLScanSpec > const&, yb::QLTableRow const&, unsigned long, unsigned long, yb::QLResultSet*, int*, unsigned long*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/docdb/cql_operation.cc:1251:11
1197 #14 0x7fb814f928c5 in yb::docdb::QLReadOperation::Execute(yb::common::YQLStorageIf const&, std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime const&, yb::Schema const&, yb::Schema const&, yb::QLResultSet*, yb::HybridTime*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/docdb/cql_operation.cc:1156:9
1198 #15 0x7fb8164d4a7c in yb::tablet::AbstractTablet::HandleQLReadRequest(std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime const&, yb::QLReadRequestPB const&, boost::optionalyb::TransactionOperationContext const&, yb::tablet::QLReadRequestResult*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/tablet/abstract_tablet.cc:51:27
1199 #16 0x7fb8164eedb8 in yb::tablet::Tablet::HandleQLReadRequest(std::__1::chrono::time_point<yb::CoarseMonoClock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >, yb::ReadHybridTime const&, yb::QLReadRequestPB const&, yb::TransactionMetadataPB const&, yb::tablet::QLReadRequestResult*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/tablet/tablet.cc:884:26
1200 #17 0x7fb8171de4e8 in yb::tserver::TabletServiceImpl::DoRead(yb::tserver::ReadContext*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/tserver/tablet_service.cc:1279:7
1201 #18 0x7fb8171dc63f in yb::tserver::TabletServiceImpl::CompleteRead(yb::tserver::ReadContext*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/tserver/tablet_service.cc:1151:19
1202 #19 0x7fb8171db0c7 in yb::tserver::TabletServiceImpl::Read(yb::tserver::ReadRequestPB const*, yb::tserver::ReadResponsePB*, yb::rpc::RpcContext) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/tserver/tablet_service.cc:1142:3
1203 #20 0x7fb80f3784eb in yb::tserver::TabletServerServiceIf::Handle(std::__1::shared_ptryb::rpc::InboundCall) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/src/yb/tserver/tserver_service.service.cc:153:7
1204 #21 0x7fb809c60e84 in yb::rpc::ServicePoolImpl::Handle(std::__1::shared_ptryb::rpc::InboundCall) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/rpc/service_pool.cc:214:15
1205 #22 0x7fb809c5c910 in yb::rpc::(anonymous namespace)::InboundCallTask::Run() /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/rpc/service_pool.cc:252:10
1206 #23 0x7fb809c77f81 in yb::rpc::(anonymous namespace)::Worker::Execute() /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/rpc/thread_pool.cc:101:15
1207 #24 0x7fb806a45c46 in yb::Thread::SuperviseThread(void*) /net/centos-gcp-cloud-jenkins-slave-ad4/share/jenkins/workspace/yugabyte-centos-master-clang-asan/build/asan-clang-dynamic-enterprise-ninja/../../src/yb/util/thread.cc:660:3
1208 #25 0x7fb800326693 in start_thread /tmp/glibc-20181130-26094-cs1x60/glibc-2.23/nptl/pthread_create.c:333
1209 #26 0x7fb7ffe5141c in __clone /tmp/glibc-20181130-26094-cs1x60/glibc-2.23/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:109
1210
1211 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../src/yb/util/bfql/bfunc_convert.h:95:11 in

@OlegLoginov OlegLoginov self-assigned this Apr 23, 2019
@OlegLoginov
Copy link
Contributor Author

Root cause: floating point values casting with overflow. (Sanitizer: float-cast-overflow)
For example:

double d = 1.E+100;
float f= d;

The result is Inf, and that's correct. So we decided with @mbautin to suppress the message.

@OlegLoginov
Copy link
Contributor Author

Fixed by:
adc1eac

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

No branches or pull requests

1 participant