Conversation
| inline std::string to_string(const std::time_t & time) | ||
| { | ||
| std::stringstream ss; | ||
| ss << std::put_time(std::localtime(&time), "%Y-%m-%d %X"); |
There was a problem hiding this comment.
This is real issue. The localtime function cannot be used in multithreaded code. And also this function is extremely slow. @akuzm
But if we have no reports from TSan then it's happened to be not used concurrently.
| const auto & weights = static_cast<const ColVecType &>(*columns[1]); | ||
|
|
||
| this->data(place).numerator += values.getData()[row_num] * weights.getData()[row_num]; | ||
| this->data(place).numerator += static_cast<typename Data::NumeratorType>(values.getData()[row_num]) * weights.getData()[row_num]; |
There was a problem hiding this comment.
100% bug, thanks to CodeQL.
And it's easily exploitable:
SELECT avgWeighted(x, y) FROM (SELECT 0xFFFFFFFF AS x, 1000000000 AS y UNION ALL SELECT 1 AS x, 1 AS y)
| auto proxy_port = proxy_resolver_config.getUInt(prefix + ".proxy_port"); | ||
|
|
||
| LOG_DEBUG(&Poco::Logger::get("DiskS3"), "Configured proxy resolver: {}, Scheme: {}, Port: {}", endpoint.toString(), proxy_scheme, proxy_port); | ||
| LOG_DEBUG(&Poco::Logger::get("DiskS3"), "Configured proxy resolver: {}, Scheme: {}, Port: {}", |
There was a problem hiding this comment.
Non-significant change.
| result.fill(0); | ||
|
|
||
| const auto bits = (precision * BITS_PER_SYMBOL) / 2; | ||
| assert(bits <= 255); |
There was a problem hiding this comment.
This is to guide static analyzer. Actually it shouldn't overflow with the given range of precision.
| return; | ||
|
|
||
| cells.assign(grid_size * grid_size, {}); | ||
| cells.assign(size_t(grid_size) * grid_size, {}); |
There was a problem hiding this comment.
Not exploitable because it cannot overflow with our grid size.
We use 16x16 grid, and this arithmetic is Ok up to 256x256 grid.
src/Functions/array/arraySum.cpp
Outdated
| { | ||
| res[i] = x * (offsets[i] - pos); | ||
| /// Just multiply the value by array size. | ||
| res[i] = Result(x) * (offsets[i] - pos); |
There was a problem hiding this comment.
It's non-realistic that overflow here will alter the result.
The cases like
SELECT arraySum(x -> toInt32(0x80000000), [1, 2])
and
SELECT arraySum(x -> toFloat32(1000000.1), [1, 2])
work correct.
"Arcadia" build is using wrong build system, will fix. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix warnings from CodeQL.
CodeQLis another static analyzer that we will use along withclang-tidyandPVS-Studiothat we use already.