ClickHouse/dbms/DataStreams/PushingToViewsBlockOutputStream.cpp

273 lines
11 KiB
C++
Raw Normal View History

#include <DataStreams/AddingDefaultBlockOutputStream.h>
2019-08-04 17:48:04 +00:00
#include <DataStreams/ConvertingBlockInputStream.h>
2018-02-21 03:48:46 +00:00
#include <DataStreams/PushingToViewsBlockOutputStream.h>
#include <DataStreams/SquashingBlockInputStream.h>
#include <DataTypes/NestedUtils.h>
2018-02-21 03:48:46 +00:00
#include <Interpreters/InterpreterSelectQuery.h>
#include <Interpreters/InterpreterInsertQuery.h>
#include <Parsers/ASTInsertQuery.h>
#include <Common/CurrentThread.h>
#include <Common/setThreadName.h>
#include <Common/ThreadPool.h>
#include <Storages/MergeTree/ReplicatedMergeTreeBlockOutputStream.h>
2019-08-04 00:29:32 +00:00
#include <Storages/StorageValues.h>
2019-08-22 23:22:57 +00:00
#include <Storages/LiveView/StorageLiveView.h>
namespace DB
{
PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream(
2019-12-05 11:42:13 +00:00
const StoragePtr & storage_,
const Context & context_, const ASTPtr & query_ptr_, bool no_destination)
2018-09-19 12:56:56 +00:00
: storage(storage_), context(context_), query_ptr(query_ptr_)
{
/** TODO This is a very important line. At any insertion into the table one of streams should own lock.
* Although now any insertion into the table is done via PushingToViewsBlockOutputStream,
* but it's clear that here is not the best place for this functionality.
*/
addTableLock(storage->lockStructureForShare(true, context.getInitialQueryId()));
/// If the "root" table deduplactes blocks, there are no need to make deduplication for children
/// Moreover, deduplication for AggregatingMergeTree children could produce false positives due to low size of inserting blocks
bool disable_deduplication_for_children = false;
if (!context.getSettingsRef().deduplicate_blocks_in_dependent_materialized_views)
disable_deduplication_for_children = !no_destination && storage->supportsDeduplication();
2019-12-05 11:42:13 +00:00
auto table_id = storage->getStorageID();
Dependencies dependencies = DatabaseCatalog::instance().getDependencies(table_id);
2019-12-05 11:42:13 +00:00
/// We need special context for materialized views insertions
if (!dependencies.empty())
{
views_context = std::make_unique<Context>(context);
// Do not deduplicate insertions into MV if the main insertion is Ok
if (disable_deduplication_for_children)
views_context->setSetting("insert_deduplicate", false);
2019-12-05 11:42:13 +00:00
}
2019-12-05 11:42:13 +00:00
for (const auto & database_table : dependencies)
{
2020-02-17 13:52:59 +00:00
auto dependent_table = DatabaseCatalog::instance().getTable(database_table);
2019-12-05 11:42:13 +00:00
ASTPtr query;
BlockOutputStreamPtr out;
2020-01-31 17:12:18 +00:00
if (auto * materialized_view = dynamic_cast<StorageMaterializedView *>(dependent_table.get()))
2019-12-05 11:42:13 +00:00
{
addTableLock(materialized_view->lockStructureForShare(true, context.getInitialQueryId()));
2020-01-31 17:12:18 +00:00
2019-12-05 11:42:13 +00:00
StoragePtr inner_table = materialized_view->getTargetTable();
auto inner_table_id = inner_table->getStorageID();
2019-12-05 11:42:13 +00:00
query = materialized_view->getInnerQuery();
2020-01-23 18:02:13 +00:00
2019-12-05 11:42:13 +00:00
std::unique_ptr<ASTInsertQuery> insert = std::make_unique<ASTInsertQuery>();
2020-03-02 20:23:58 +00:00
insert->table_id = inner_table_id;
2020-01-23 18:02:13 +00:00
/// Get list of columns we get from select query.
2020-01-23 17:51:43 +00:00
auto header = InterpreterSelectQuery(query, *views_context, SelectQueryOptions().analyze())
.getSampleBlock();
2020-01-23 17:11:49 +00:00
2020-01-23 18:02:13 +00:00
/// Insert only columns returned by select.
2020-01-23 17:11:49 +00:00
auto list = std::make_shared<ASTExpressionList>();
2020-01-23 17:51:43 +00:00
for (auto & column : header)
/// But skip columns which storage doesn't have.
if (inner_table->hasColumn(column.name))
list->children.emplace_back(std::make_shared<ASTIdentifier>(column.name));
2020-01-23 17:11:49 +00:00
insert->columns = std::move(list);
2019-12-05 11:42:13 +00:00
ASTPtr insert_query_ptr(insert.release());
InterpreterInsertQuery interpreter(insert_query_ptr, *views_context);
BlockIO io = interpreter.execute();
out = io.out;
}
2019-12-05 11:42:13 +00:00
else if (dynamic_cast<const StorageLiveView *>(dependent_table.get()))
out = std::make_shared<PushingToViewsBlockOutputStream>(dependent_table, *views_context, ASTPtr(), true);
else
out = std::make_shared<PushingToViewsBlockOutputStream>(dependent_table, *views_context, ASTPtr());
views.emplace_back(ViewInfo{std::move(query), database_table, std::move(out)});
}
/* Do not push to destination table if the flag is set */
if (!no_destination)
{
output = storage->write(query_ptr, context);
replicated_output = dynamic_cast<ReplicatedMergeTreeBlockOutputStream *>(output.get());
}
}
Block PushingToViewsBlockOutputStream::getHeader() const
{
/// If we don't write directly to the destination
/// then expect that we're inserting with precalculated virtual columns
if (output)
return storage->getSampleBlock();
else
return storage->getSampleBlockWithVirtuals();
}
void PushingToViewsBlockOutputStream::write(const Block & block)
{
/** Throw an exception if the sizes of arrays - elements of nested data structures doesn't match.
* We have to make this assertion before writing to table, because storage engine may assume that they have equal sizes.
* NOTE It'd better to do this check in serialization of nested structures (in place when this assumption is required),
* but currently we don't have methods for serialization of nested structures "as a whole".
*/
Nested::validateArraySizes(block);
if (auto * live_view = dynamic_cast<StorageLiveView *>(storage.get()))
{
2019-08-22 22:41:30 +00:00
StorageLiveView::writeIntoLiveView(*live_view, block, context);
}
else
{
if (output)
/// TODO: to support virtual and alias columns inside MVs, we should return here the inserted block extended
/// with additional columns directly from storage and pass it to MVs instead of raw block.
output->write(block);
}
/// Don't process materialized views if this block is duplicate
if (!context.getSettingsRef().deduplicate_blocks_in_dependent_materialized_views && replicated_output && replicated_output->lastBlockIsDuplicate())
return;
// Insert data into materialized views only after successful insert into main table
2018-10-01 21:49:56 +00:00
const Settings & settings = context.getSettingsRef();
if (settings.parallel_view_processing && views.size() > 1)
{
// Push to views concurrently if enabled, and more than one view is attached
2018-10-01 21:49:56 +00:00
ThreadPool pool(std::min(size_t(settings.max_threads), views.size()));
for (size_t view_num = 0; view_num < views.size(); ++view_num)
{
auto thread_group = CurrentThread::getGroup();
2019-12-28 16:42:58 +00:00
pool.scheduleOrThrowOnError([=, this]
{
2019-02-10 21:15:14 +00:00
setThreadName("PushingToViews");
if (thread_group)
CurrentThread::attachToIfDetached(thread_group);
process(block, view_num);
});
}
// Wait for concurrent view processing
pool.wait();
}
else
{
// Process sequentially
for (size_t view_num = 0; view_num < views.size(); ++view_num)
process(block, view_num);
}
}
void PushingToViewsBlockOutputStream::writePrefix()
{
if (output)
output->writePrefix();
for (auto & view : views)
{
try
{
view.out->writePrefix();
}
catch (Exception & ex)
{
2019-12-05 11:42:13 +00:00
ex.addMessage("while write prefix to view " + view.table_id.getNameForLogs());
throw;
}
}
}
void PushingToViewsBlockOutputStream::writeSuffix()
{
if (output)
output->writeSuffix();
for (auto & view : views)
{
try
{
view.out->writeSuffix();
}
catch (Exception & ex)
{
2019-12-05 11:42:13 +00:00
ex.addMessage("while write prefix to view " + view.table_id.getNameForLogs());
throw;
}
}
}
void PushingToViewsBlockOutputStream::flush()
{
if (output)
output->flush();
for (auto & view : views)
view.out->flush();
}
void PushingToViewsBlockOutputStream::process(const Block & block, size_t view_num)
{
auto & view = views[view_num];
try
{
2019-08-09 15:32:44 +00:00
BlockInputStreamPtr in;
Fix scope of the InterpreterSelectQuery for views with query ASAN report (s/#//): ================================================================= ==1==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fff5d89a080 at pc 0x0000123398bb bp 0x7fff5d8941b0 sp 0x7fff5d8941a8 READ of size 8 at 0x7fff5d89a080 thread T55 (AsyncBlockInput) 0 0x123398ba in std::__1::shared_ptr<DB::ContextShared>::operator->() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3933:56 1 0x123398ba in DB::Context::getLock() const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/Context.cpp:340 2 0x123398ba in DB::Context::hasDictionaryAccessRights(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/Context.cpp:711 3 0x88faf6b in DB::FunctionDictGet<DB::DataTypeNumber<unsigned short>, DB::NameDictGetUInt16>::executeImpl(DB::Block&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, unsigned long, unsigned long) (/usr/bin/clickhouse+0x88faf6b) 4 0x11da8091 in DB::PreparedFunctionImpl::executeWithoutLowCardinalityColumns(DB::Block&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) /build/obj-x86_64-linux-gnu/../dbms/src/Functions/IFunction.cpp:312:9 5 0x11da8091 in DB::PreparedFunctionImpl::execute(DB::Block&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) /build/obj-x86_64-linux-gnu/../dbms/src/Functions/IFunction.cpp:473 6 0x125278c5 in DB::ExpressionAction::execute(DB::Block&, bool) const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/ExpressionActions.cpp:381:23 7 0x1254250d in DB::ExpressionActions::execute(DB::Block&, bool) const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/ExpressionActions.cpp:762:16 8 0x129e9811 in DB::ExpressionBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/ExpressionBlockInputStream.cpp:43:21 9 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 10 0x12a46ef2 in DB::PartialSortingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PartialSortingBlockInputStream.cpp:12:34 11 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 12 0x129f3968 in DB::MergeSortingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/MergeSortingBlockInputStream.cpp:51:47 13 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 14 0x129e97a3 in DB::ExpressionBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/ExpressionBlockInputStream.cpp:41:34 15 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 16 0x125d5a29 in DB::MaterializingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/MaterializingBlockInputStream.cpp:25:46 17 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 18 0x12098079 in DB::SquashingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockInputStream.cpp:22:36 19 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 20 0x125c677b in DB::ConvertingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/ConvertingBlockInputStream.cpp:95:34 21 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 22 0x125d043e in DB::PushingToViewsBlockOutputStream::process(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:230:41 23 0x125cedde in DB::PushingToViewsBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:147:13 24 0x125c8600 in DB::SquashingBlockOutputStream::finalize() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:30:17 25 0x125c89ed in DB::SquashingBlockOutputStream::writeSuffix() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:50:5 26 0x13402808 in DB::StorageBuffer::writeBlockToDestination(DB::Block const&, std::__1::shared_ptr<DB::IStorage>) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageBuffer.cpp:678:19 27 0x1340c4b2 in DB::BufferBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageBuffer.cpp:340:25 28 0x125ce657 in DB::PushingToViewsBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:116:21 29 0x125c8600 in DB::SquashingBlockOutputStream::finalize() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:30:17 30 0x125c89ed in DB::SquashingBlockOutputStream::writeSuffix() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:50:5 31 0x134652a0 in DB::DistributedBlockOutputStream::writeToLocal(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:550:19 32 0x1345d13f in DB::DistributedBlockOutputStream::writeAsyncImpl(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:513:13 33 0x1345abdd in DB::DistributedBlockOutputStream::writeAsync(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:111:5 34 0x1345abdd in DB::DistributedBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:103 35 0x125ce657 in DB::PushingToViewsBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:116:21 36 0x125c8600 in DB::SquashingBlockOutputStream::finalize() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:30:17 37 0x125c89ed in DB::SquashingBlockOutputStream::writeSuffix() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:50:5 38 0x1209ae2d in void DB::copyDataImpl<DB::copyData(DB::IBlockInputStream&, DB::IBlockOutputStream&, std::__1::atomic<bool>*)::$_0&, void (&)(DB::Block const&)>(DB::IBlockInputStream&, DB::IBlockOutputStream&, DB::copyData(DB::IBlockInputStream&, DB::IBlockOutputStream&, std::__1::atomic<bool>*)::$_0&, void (&)(DB::Block const&)) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/copyData.cpp:48:8 39 0x1209ae2d in DB::copyData(DB::IBlockInputStream&, DB::IBlockOutputStream&, std::__1::atomic<bool>*) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/copyData.cpp:61 40 0x125c1d43 in DB::NullAndDoCopyBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/NullAndDoCopyBlockInputStream.h:42:9 41 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 42 0x1204e769 in DB::AsynchronousBlockInputStream::calculate() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/AsynchronousBlockInputStream.cpp:74:34 43 0x1204f7d6 in DB::AsynchronousBlockInputStream::next()::$_0::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/AsynchronousBlockInputStream.cpp:59:9 44 0x1204f7d6 in decltype(std::__1::forward<DB::AsynchronousBlockInputStream::next()::$_0&>(fp)()) std::__1::__invoke<DB::AsynchronousBlockInputStream::next()::$_0&>(DB::AsynchronousBlockInputStream::next()::$_0&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 45 0x1204f7d6 in void std::__1::__invoke_void_return_wrapper<void>::__call<DB::AsynchronousBlockInputStream::next()::$_0&>(DB::AsynchronousBlockInputStream::next()::$_0&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:348 46 0x1204f7d6 in std::__1::__function::__alloc_func<DB::AsynchronousBlockInputStream::next()::$_0, std::__1::allocator<DB::AsynchronousBlockInputStream::next()::$_0>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 47 0x1204f7d6 in std::__1::__function::__func<DB::AsynchronousBlockInputStream::next()::$_0, std::__1::allocator<DB::AsynchronousBlockInputStream::next()::$_0>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 48 0x77324d6 in std::__1::__function::__value_func<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 49 0x77324d6 in std::__1::function<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 50 0x77324d6 in ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:221 51 0x773ad16 in void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:73 52 0x773ad16 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke_constexpr<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'() const&>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4416 53 0x773ad16 in decltype(auto) std::__1::__apply_tuple_impl<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'() const&, std::__1::tuple<> const&>(void&&, std::__1::tuple<> const&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1358 54 0x773ad16 in decltype(auto) std::__1::apply<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'() const&, std::__1::tuple<> const&>(void&&, std::__1::tuple<> const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1367 55 0x773ad16 in ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:156 56 0x773ad16 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()&>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 57 0x773ad16 in void std::__1::__invoke_void_return_wrapper<void>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:348 58 0x773ad16 in std::__1::__function::__alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 59 0x773ad16 in std::__1::__function::__func<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 60 0x772d9c3 in std::__1::__function::__value_func<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 61 0x772d9c3 in std::__1::function<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 62 0x772d9c3 in ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:221 63 0x7735e87 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:73 64 0x7735e87 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 65 0x7735e87 in void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:341 66 0x7735e87 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:351 67 0x7ffff7fb3fb6 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8fb6) 68 0x7ffff7ed52ee in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfa2ee) Address 0x7fff5d89a080 is located in stack of thread T55 (AsyncBlockInput) at offset 4448 in frame 0 0x125cf5df in DB::PushingToViewsBlockOutputStream::process(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:199 This frame has 18 object(s): [32, 48) 'in' (line 204) [64, 4112) 'local_context' (line 211) [4240, 4256) 'ref.tmp' (line 212) [4272, 4296) 'ref.tmp6' (line 212) [4336, 4360) 'ref.tmp10' (line 212) [4400, 9136) 'select' (line 215) <== Memory access at offset 4448 is inside this variable [9392, 9416) 'ref.tmp33' (line 215) [9456, 9480) 'ref.tmp36' (line 215) [9520, 9840) 'ref.tmp43' (line 216) [9904, 9960) 'ref.tmp71' (line 223) [10000, 10056) 'result_block' (line 230) [10096, 10120) 'ref.tmp126' (line 240) [10160, 10184) 'ref.tmp127' (line 240) [10224, 10248) 'ref.tmp128' (line 240) [10288, 10312) 'ref.tmp129' (line 240) [10352, 10368) 'ref.tmp130' (line 240) [10384, 10408) 'ref.tmp138' (line 240) [10448, 10464) 'ref.tmp139' (line 240) HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) Thread T55 (AsyncBlockInput) created by T4 (SystemLogFlush) here: 0 0x759ffad in pthread_create (/usr/bin/clickhouse+0x759ffad) 1 0x7733f3e in std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__threading_support:327:10 2 0x7733f3e in std::__1::thread::thread<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'(), void>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:367 3 0x772b172 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:35 4 0x772c613 in ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, int, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:138:5 5 0x77383c2 in ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:149:38 6 0x772f1de in void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:35 7 0x772e8db in ThreadPoolImpl<ThreadFromGlobalPool>::scheduleOrThrowOnError(std::__1::function<void ()>, int) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:126:5 8 0x134e4d0e in DB::MergeTreeData::loadDataParts(bool) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/MergeTree/MergeTreeData.cpp:805:14 9 0x1318d956 in DB::StorageMergeTree::StorageMergeTree(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ColumnsDescription const&, DB::IndicesDescription const&, DB::ConstraintsDescription const&, bool, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, DB::MergeTreeData::MergingParams const&, std::__1::unique_ptr<DB::MergeTreeSettings, std::__1::default_delete<DB::MergeTreeSettings> >, bool) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageMergeTree.cpp:80:5 10 0x1393e5c8 in std::__1::shared_ptr<DB::StorageMergeTree> ext::shared_ptr_helper<DB::StorageMergeTree>::create<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ColumnsDescription const&, DB::IndicesDescription&, DB::ConstraintsDescription const&, bool const&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, DB::MergeTreeData::MergingParams&, std::__1::unique_ptr<DB::MergeTreeSettings, std::__1::default_delete<DB::MergeTreeSettings> >, bool const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ColumnsDescription const&, DB::IndicesDescription&, DB::ConstraintsDescription const&, bool const&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, DB::MergeTreeData::MergingParams&, std::__1::unique_ptr<DB::MergeTreeSettings, std::__1::default_delete<DB::MergeTreeSettings> >&&, bool const&) /build/obj-x86_64-linux-gnu/../libs/libcommon/include/ext/shared_ptr_helper.h:19:39 11 0x1392c4ff in DB::create(DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp:648:16 12 0x13940444 in decltype(std::__1::forward<std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&)>(fp)(std::__1::forward<DB::StorageFactory::Arguments const&>(fp0))) std::__1::__invoke<std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&>(std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410:1 13 0x13940444 in std::__1::shared_ptr<DB::IStorage> std::__1::__invoke_void_return_wrapper<std::__1::shared_ptr<DB::IStorage> >::__call<std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&>(std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:317 14 0x13940444 in std::__1::__function::__alloc_func<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&), std::__1::allocator<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&)>, std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 15 0x13940444 in std::__1::__function::__func<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&), std::__1::allocator<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&)>, std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 16 0x131075c5 in std::__1::__function::__value_func<std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 17 0x131075c5 in std::__1::function<std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 18 0x131075c5 in DB::StorageFactory::get(DB::ASTCreateQuery&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, DB::Context&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, bool, bool) const /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageFactory.cpp:164 19 0x124414ad in DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/InterpreterCreateQuery.cpp:657:46 20 0x12446e45 in DB::InterpreterCreateQuery::execute() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/InterpreterCreateQuery.cpp:753:16 21 0x76760da in DB::SystemLog<DB::QueryLogElement>::prepareTable() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:438:21 22 0x767006d in DB::SystemLog<DB::QueryLogElement>::flushImpl(DB::SystemLog<DB::QueryLogElement>::EntryType) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:327:9 23 0x766eb18 in DB::SystemLog<DB::QueryLogElement>::threadFunction() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:300:17 24 0x766e445 in DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:187:51 25 0x766e445 in decltype(std::__1::forward<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&>(fp)()) std::__1::__invoke_constexpr<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4416 26 0x766e445 in decltype(auto) std::__1::__apply_tuple_impl<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1358 27 0x766e445 in decltype(auto) std::__1::apply<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1367 28 0x766e445 in ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:156 29 0x766e445 in decltype(std::__1::forward<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 30 0x766e445 in void std::__1::__invoke_void_return_wrapper<void>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:348 31 0x766e445 in std::__1::__function::__alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 32 0x766e445 in std::__1::__function::__func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 33 0x772d9c3 in std::__1::__function::__value_func<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 34 0x772d9c3 in std::__1::function<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 35 0x772d9c3 in ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:221 36 0x7735e87 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:73 37 0x7735e87 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 38 0x7735e87 in void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:341 39 0x7735e87 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:351 40 0x7ffff7fb3fb6 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8fb6) Thread T4 (SystemLogFlush) created by T0 here: 0 0x759ffad in pthread_create (/usr/bin/clickhouse+0x759ffad) 1 0x7733f3e in std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__threading_support:327:10 2 0x7733f3e in std::__1::thread::thread<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'(), void>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:367 3 0x772b172 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:35 4 0x772c613 in ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, int, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:138:5 5 0x766b5f6 in ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:149:38 6 0x766a214 in DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:187:21 7 0x75ecf52 in DB::QueryLog::QueryLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/QueryLog.h:79:39 8 0x75ecf52 in std::__1::__compressed_pair_elem<DB::QueryLog, 1, false>::__compressed_pair_elem<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&, 0ul, 1ul, 2ul, 3ul, 4ul>(std::__1::piecewise_construct_t, std::__1::tuple<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>, std::__1::__tuple_indices<0ul, 1ul, 2ul, 3ul, 4ul>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:2155 9 0x75ecf52 in std::__1::__compressed_pair<std::__1::allocator<DB::QueryLog>, DB::QueryLog>::__compressed_pair<std::__1::allocator<DB::QueryLog>&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(std::__1::piecewise_construct_t, std::__1::tuple<std::__1::allocator<DB::QueryLog>&>, std::__1::tuple<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:2258 10 0x75ecf52 in std::__1::__shared_ptr_emplace<DB::QueryLog, std::__1::allocator<DB::QueryLog> >::__shared_ptr_emplace<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(std::__1::allocator<DB::QueryLog>, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3671 11 0x75ecf52 in std::__1::shared_ptr<DB::QueryLog> std::__1::shared_ptr<DB::QueryLog>::make_shared<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:4330 12 0x75ecf52 in std::__1::enable_if<!(is_array<DB::QueryLog>::value), std::__1::shared_ptr<DB::QueryLog> >::type std::__1::make_shared<DB::QueryLog, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:4709 13 0x75ecf52 in std::__1::shared_ptr<DB::QueryLog> DB::(anonymous namespace)::createSystemLog<DB::QueryLog>(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.cpp:39 14 0x75ecf52 in DB::SystemLogs::SystemLogs(DB::Context&, Poco::Util::AbstractConfiguration const&) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.cpp:47 15 0x12350225 in void std::__1::__optional_storage_base<DB::SystemLogs, false>::__construct<DB::Context&, Poco::Util::AbstractConfiguration const&>(DB::Context&, Poco::Util::AbstractConfiguration const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/optional:323:54 16 0x12350225 in DB::SystemLogs& std::__1::optional<DB::SystemLogs>::emplace<DB::Context&, Poco::Util::AbstractConfiguration const&, void>(DB::Context&, Poco::Util::AbstractConfiguration const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/optional:826 17 0x12350225 in DB::Context::initializeSystemLogs() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/Context.cpp:1679 18 0x760b2c6 in DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /build/obj-x86_64-linux-gnu/../dbms/programs/server/Server.cpp:528:25 19 0x147fbce0 in Poco::Util::Application::run() /build/obj-x86_64-linux-gnu/../contrib/poco/Util/src/Application.cpp:335:8 20 0x75f5df5 in DB::Server::run() /build/obj-x86_64-linux-gnu/../dbms/programs/server/Server.cpp:149:25 21 0x76463e3 in mainEntryClickHouseServer(int, char**) /build/obj-x86_64-linux-gnu/../dbms/programs/server/Server.cpp:962:20 22 0x75eaa8b in main /build/obj-x86_64-linux-gnu/../dbms/programs/main.cpp:178:12 23 0x7ffff7e01bba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba) SUMMARY: AddressSanitizer: stack-use-after-scope /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3933:56 in std::__1::shared_ptr<DB::ContextShared>::operator->() const Shadow bytes around the buggy address: 0x10006bb0b3c0: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b3d0: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b3e0: f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 0x10006bb0b3f0: f2 f2 f2 f2 f2 f2 f8 f8 f2 f2 f8 f8 f8 f2 f2 f2 0x10006bb0b400: f2 f2 f8 f8 f8 f2 f2 f2 f2 f2 f8 f8 f8 f8 f8 f8 =>0x10006bb0b410:[f8]f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b420: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b430: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b440: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b450: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b460: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==1==ABORTING
2019-11-03 19:31:20 +00:00
/// We need keep InterpreterSelectQuery, until the processing will be finished, since:
///
/// - We copy Context inside InterpreterSelectQuery to support
/// modification of context (Settings) for subqueries
/// - InterpreterSelectQuery lives shorter than query pipeline.
/// It's used just to build the query pipeline and no longer needed
/// - ExpressionAnalyzer and then, Functions, that created in InterpreterSelectQuery,
/// **can** take a reference to Context from InterpreterSelectQuery
/// (the problem raises only when function uses context from the
/// execute*() method, like FunctionDictGet do)
/// - These objects live inside query pipeline (DataStreams) and the reference become dangling.
std::optional<InterpreterSelectQuery> select;
if (view.query)
{
2019-08-09 15:32:44 +00:00
/// We create a table with the same name as original table and the same alias columns,
/// but it will contain single block (that is INSERT-ed into main table).
/// InterpreterSelectQuery will do processing of alias columns.
Context local_context = *views_context;
local_context.addViewSource(
2019-12-10 19:48:16 +00:00
StorageValues::create(storage->getStorageID(), storage->getColumns(),
2019-08-09 15:32:44 +00:00
block));
Fix scope of the InterpreterSelectQuery for views with query ASAN report (s/#//): ================================================================= ==1==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fff5d89a080 at pc 0x0000123398bb bp 0x7fff5d8941b0 sp 0x7fff5d8941a8 READ of size 8 at 0x7fff5d89a080 thread T55 (AsyncBlockInput) 0 0x123398ba in std::__1::shared_ptr<DB::ContextShared>::operator->() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3933:56 1 0x123398ba in DB::Context::getLock() const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/Context.cpp:340 2 0x123398ba in DB::Context::hasDictionaryAccessRights(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/Context.cpp:711 3 0x88faf6b in DB::FunctionDictGet<DB::DataTypeNumber<unsigned short>, DB::NameDictGetUInt16>::executeImpl(DB::Block&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, unsigned long, unsigned long) (/usr/bin/clickhouse+0x88faf6b) 4 0x11da8091 in DB::PreparedFunctionImpl::executeWithoutLowCardinalityColumns(DB::Block&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) /build/obj-x86_64-linux-gnu/../dbms/src/Functions/IFunction.cpp:312:9 5 0x11da8091 in DB::PreparedFunctionImpl::execute(DB::Block&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) /build/obj-x86_64-linux-gnu/../dbms/src/Functions/IFunction.cpp:473 6 0x125278c5 in DB::ExpressionAction::execute(DB::Block&, bool) const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/ExpressionActions.cpp:381:23 7 0x1254250d in DB::ExpressionActions::execute(DB::Block&, bool) const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/ExpressionActions.cpp:762:16 8 0x129e9811 in DB::ExpressionBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/ExpressionBlockInputStream.cpp:43:21 9 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 10 0x12a46ef2 in DB::PartialSortingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PartialSortingBlockInputStream.cpp:12:34 11 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 12 0x129f3968 in DB::MergeSortingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/MergeSortingBlockInputStream.cpp:51:47 13 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 14 0x129e97a3 in DB::ExpressionBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/ExpressionBlockInputStream.cpp:41:34 15 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 16 0x125d5a29 in DB::MaterializingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/MaterializingBlockInputStream.cpp:25:46 17 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 18 0x12098079 in DB::SquashingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockInputStream.cpp:22:36 19 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 20 0x125c677b in DB::ConvertingBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/ConvertingBlockInputStream.cpp:95:34 21 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 22 0x125d043e in DB::PushingToViewsBlockOutputStream::process(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:230:41 23 0x125cedde in DB::PushingToViewsBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:147:13 24 0x125c8600 in DB::SquashingBlockOutputStream::finalize() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:30:17 25 0x125c89ed in DB::SquashingBlockOutputStream::writeSuffix() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:50:5 26 0x13402808 in DB::StorageBuffer::writeBlockToDestination(DB::Block const&, std::__1::shared_ptr<DB::IStorage>) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageBuffer.cpp:678:19 27 0x1340c4b2 in DB::BufferBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageBuffer.cpp:340:25 28 0x125ce657 in DB::PushingToViewsBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:116:21 29 0x125c8600 in DB::SquashingBlockOutputStream::finalize() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:30:17 30 0x125c89ed in DB::SquashingBlockOutputStream::writeSuffix() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:50:5 31 0x134652a0 in DB::DistributedBlockOutputStream::writeToLocal(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:550:19 32 0x1345d13f in DB::DistributedBlockOutputStream::writeAsyncImpl(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:513:13 33 0x1345abdd in DB::DistributedBlockOutputStream::writeAsync(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:111:5 34 0x1345abdd in DB::DistributedBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp:103 35 0x125ce657 in DB::PushingToViewsBlockOutputStream::write(DB::Block const&) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:116:21 36 0x125c8600 in DB::SquashingBlockOutputStream::finalize() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:30:17 37 0x125c89ed in DB::SquashingBlockOutputStream::writeSuffix() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/SquashingBlockOutputStream.cpp:50:5 38 0x1209ae2d in void DB::copyDataImpl<DB::copyData(DB::IBlockInputStream&, DB::IBlockOutputStream&, std::__1::atomic<bool>*)::$_0&, void (&)(DB::Block const&)>(DB::IBlockInputStream&, DB::IBlockOutputStream&, DB::copyData(DB::IBlockInputStream&, DB::IBlockOutputStream&, std::__1::atomic<bool>*)::$_0&, void (&)(DB::Block const&)) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/copyData.cpp:48:8 39 0x1209ae2d in DB::copyData(DB::IBlockInputStream&, DB::IBlockOutputStream&, std::__1::atomic<bool>*) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/copyData.cpp:61 40 0x125c1d43 in DB::NullAndDoCopyBlockInputStream::readImpl() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/NullAndDoCopyBlockInputStream.h:42:9 41 0x1205391a in DB::IBlockInputStream::read() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/IBlockInputStream.cpp:61:15 42 0x1204e769 in DB::AsynchronousBlockInputStream::calculate() /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/AsynchronousBlockInputStream.cpp:74:34 43 0x1204f7d6 in DB::AsynchronousBlockInputStream::next()::$_0::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/AsynchronousBlockInputStream.cpp:59:9 44 0x1204f7d6 in decltype(std::__1::forward<DB::AsynchronousBlockInputStream::next()::$_0&>(fp)()) std::__1::__invoke<DB::AsynchronousBlockInputStream::next()::$_0&>(DB::AsynchronousBlockInputStream::next()::$_0&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 45 0x1204f7d6 in void std::__1::__invoke_void_return_wrapper<void>::__call<DB::AsynchronousBlockInputStream::next()::$_0&>(DB::AsynchronousBlockInputStream::next()::$_0&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:348 46 0x1204f7d6 in std::__1::__function::__alloc_func<DB::AsynchronousBlockInputStream::next()::$_0, std::__1::allocator<DB::AsynchronousBlockInputStream::next()::$_0>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 47 0x1204f7d6 in std::__1::__function::__func<DB::AsynchronousBlockInputStream::next()::$_0, std::__1::allocator<DB::AsynchronousBlockInputStream::next()::$_0>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 48 0x77324d6 in std::__1::__function::__value_func<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 49 0x77324d6 in std::__1::function<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 50 0x77324d6 in ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:221 51 0x773ad16 in void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:73 52 0x773ad16 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke_constexpr<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'() const&>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4416 53 0x773ad16 in decltype(auto) std::__1::__apply_tuple_impl<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'() const&, std::__1::tuple<> const&>(void&&, std::__1::tuple<> const&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1358 54 0x773ad16 in decltype(auto) std::__1::apply<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'() const&, std::__1::tuple<> const&>(void&&, std::__1::tuple<> const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1367 55 0x773ad16 in ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:156 56 0x773ad16 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()&>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 57 0x773ad16 in void std::__1::__invoke_void_return_wrapper<void>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:348 58 0x773ad16 in std::__1::__function::__alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 59 0x773ad16 in std::__1::__function::__func<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 60 0x772d9c3 in std::__1::__function::__value_func<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 61 0x772d9c3 in std::__1::function<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 62 0x772d9c3 in ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:221 63 0x7735e87 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:73 64 0x7735e87 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 65 0x7735e87 in void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:341 66 0x7735e87 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:351 67 0x7ffff7fb3fb6 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8fb6) 68 0x7ffff7ed52ee in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfa2ee) Address 0x7fff5d89a080 is located in stack of thread T55 (AsyncBlockInput) at offset 4448 in frame 0 0x125cf5df in DB::PushingToViewsBlockOutputStream::process(DB::Block const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp:199 This frame has 18 object(s): [32, 48) 'in' (line 204) [64, 4112) 'local_context' (line 211) [4240, 4256) 'ref.tmp' (line 212) [4272, 4296) 'ref.tmp6' (line 212) [4336, 4360) 'ref.tmp10' (line 212) [4400, 9136) 'select' (line 215) <== Memory access at offset 4448 is inside this variable [9392, 9416) 'ref.tmp33' (line 215) [9456, 9480) 'ref.tmp36' (line 215) [9520, 9840) 'ref.tmp43' (line 216) [9904, 9960) 'ref.tmp71' (line 223) [10000, 10056) 'result_block' (line 230) [10096, 10120) 'ref.tmp126' (line 240) [10160, 10184) 'ref.tmp127' (line 240) [10224, 10248) 'ref.tmp128' (line 240) [10288, 10312) 'ref.tmp129' (line 240) [10352, 10368) 'ref.tmp130' (line 240) [10384, 10408) 'ref.tmp138' (line 240) [10448, 10464) 'ref.tmp139' (line 240) HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) Thread T55 (AsyncBlockInput) created by T4 (SystemLogFlush) here: 0 0x759ffad in pthread_create (/usr/bin/clickhouse+0x759ffad) 1 0x7733f3e in std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__threading_support:327:10 2 0x7733f3e in std::__1::thread::thread<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'(), void>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:367 3 0x772b172 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:35 4 0x772c613 in ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, int, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:138:5 5 0x77383c2 in ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:149:38 6 0x772f1de in void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:35 7 0x772e8db in ThreadPoolImpl<ThreadFromGlobalPool>::scheduleOrThrowOnError(std::__1::function<void ()>, int) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:126:5 8 0x134e4d0e in DB::MergeTreeData::loadDataParts(bool) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/MergeTree/MergeTreeData.cpp:805:14 9 0x1318d956 in DB::StorageMergeTree::StorageMergeTree(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ColumnsDescription const&, DB::IndicesDescription const&, DB::ConstraintsDescription const&, bool, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, std::__1::shared_ptr<DB::IAST> const&, DB::MergeTreeData::MergingParams const&, std::__1::unique_ptr<DB::MergeTreeSettings, std::__1::default_delete<DB::MergeTreeSettings> >, bool) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageMergeTree.cpp:80:5 10 0x1393e5c8 in std::__1::shared_ptr<DB::StorageMergeTree> ext::shared_ptr_helper<DB::StorageMergeTree>::create<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ColumnsDescription const&, DB::IndicesDescription&, DB::ConstraintsDescription const&, bool const&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, DB::MergeTreeData::MergingParams&, std::__1::unique_ptr<DB::MergeTreeSettings, std::__1::default_delete<DB::MergeTreeSettings> >, bool const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ColumnsDescription const&, DB::IndicesDescription&, DB::ConstraintsDescription const&, bool const&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, std::__1::shared_ptr<DB::IAST>&, DB::MergeTreeData::MergingParams&, std::__1::unique_ptr<DB::MergeTreeSettings, std::__1::default_delete<DB::MergeTreeSettings> >&&, bool const&) /build/obj-x86_64-linux-gnu/../libs/libcommon/include/ext/shared_ptr_helper.h:19:39 11 0x1392c4ff in DB::create(DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../dbms/src/Storages/MergeTree/registerStorageMergeTree.cpp:648:16 12 0x13940444 in decltype(std::__1::forward<std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&)>(fp)(std::__1::forward<DB::StorageFactory::Arguments const&>(fp0))) std::__1::__invoke<std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&>(std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410:1 13 0x13940444 in std::__1::shared_ptr<DB::IStorage> std::__1::__invoke_void_return_wrapper<std::__1::shared_ptr<DB::IStorage> >::__call<std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&>(std::__1::shared_ptr<DB::IStorage> (*&)(DB::StorageFactory::Arguments const&), DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:317 14 0x13940444 in std::__1::__function::__alloc_func<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&), std::__1::allocator<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&)>, std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 15 0x13940444 in std::__1::__function::__func<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&), std::__1::allocator<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&)>, std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 16 0x131075c5 in std::__1::__function::__value_func<std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 17 0x131075c5 in std::__1::function<std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 18 0x131075c5 in DB::StorageFactory::get(DB::ASTCreateQuery&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, DB::Context&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, bool, bool) const /build/obj-x86_64-linux-gnu/../dbms/src/Storages/StorageFactory.cpp:164 19 0x124414ad in DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/InterpreterCreateQuery.cpp:657:46 20 0x12446e45 in DB::InterpreterCreateQuery::execute() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/InterpreterCreateQuery.cpp:753:16 21 0x76760da in DB::SystemLog<DB::QueryLogElement>::prepareTable() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:438:21 22 0x767006d in DB::SystemLog<DB::QueryLogElement>::flushImpl(DB::SystemLog<DB::QueryLogElement>::EntryType) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:327:9 23 0x766eb18 in DB::SystemLog<DB::QueryLogElement>::threadFunction() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:300:17 24 0x766e445 in DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:187:51 25 0x766e445 in decltype(std::__1::forward<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&>(fp)()) std::__1::__invoke_constexpr<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4416 26 0x766e445 in decltype(auto) std::__1::__apply_tuple_impl<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1358 27 0x766e445 in decltype(auto) std::__1::apply<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'() const&, std::__1::tuple<> const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/tuple:1367 28 0x766e445 in ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:156 29 0x766e445 in decltype(std::__1::forward<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()&>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 30 0x766e445 in void std::__1::__invoke_void_return_wrapper<void>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__functional_base:348 31 0x766e445 in std::__1::__function::__alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1527 32 0x766e445 in std::__1::__function::__func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&)::'lambda'()>, void ()>::operator()() /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1651 33 0x772d9c3 in std::__1::__function::__value_func<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:1799:16 34 0x772d9c3 in std::__1::function<void ()>::operator()() const /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/functional:2347 35 0x772d9c3 in ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:221 36 0x7735e87 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:73 37 0x7735e87 in decltype(std::__1::forward<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/type_traits:4410 38 0x7735e87 in void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>&, std::__1::__tuple_indices<>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:341 39 0x7735e87 in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:351 40 0x7ffff7fb3fb6 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8fb6) Thread T4 (SystemLogFlush) created by T0 here: 0 0x759ffad in pthread_create (/usr/bin/clickhouse+0x759ffad) 1 0x7733f3e in std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/__threading_support:327:10 2 0x7733f3e in std::__1::thread::thread<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'(), void>(void&&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/thread:367 3 0x772b172 in void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:102:35 4 0x772c613 in ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, int, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:138:5 5 0x766b5f6 in ThreadFromGlobalPool::ThreadFromGlobalPool<DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()>(DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long)::'lambda'()&&) /build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.h:149:38 6 0x766a214 in DB::SystemLog<DB::QueryLogElement>::SystemLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.h:187:21 7 0x75ecf52 in DB::QueryLog::QueryLog(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/QueryLog.h:79:39 8 0x75ecf52 in std::__1::__compressed_pair_elem<DB::QueryLog, 1, false>::__compressed_pair_elem<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&, 0ul, 1ul, 2ul, 3ul, 4ul>(std::__1::piecewise_construct_t, std::__1::tuple<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>, std::__1::__tuple_indices<0ul, 1ul, 2ul, 3ul, 4ul>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:2155 9 0x75ecf52 in std::__1::__compressed_pair<std::__1::allocator<DB::QueryLog>, DB::QueryLog>::__compressed_pair<std::__1::allocator<DB::QueryLog>&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(std::__1::piecewise_construct_t, std::__1::tuple<std::__1::allocator<DB::QueryLog>&>, std::__1::tuple<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:2258 10 0x75ecf52 in std::__1::__shared_ptr_emplace<DB::QueryLog, std::__1::allocator<DB::QueryLog> >::__shared_ptr_emplace<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(std::__1::allocator<DB::QueryLog>, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3671 11 0x75ecf52 in std::__1::shared_ptr<DB::QueryLog> std::__1::shared_ptr<DB::QueryLog>::make_shared<DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:4330 12 0x75ecf52 in std::__1::enable_if<!(is_array<DB::QueryLog>::value), std::__1::shared_ptr<DB::QueryLog> >::type std::__1::make_shared<DB::QueryLog, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&>(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:4709 13 0x75ecf52 in std::__1::shared_ptr<DB::QueryLog> DB::(anonymous namespace)::createSystemLog<DB::QueryLog>(DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Util::AbstractConfiguration const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.cpp:39 14 0x75ecf52 in DB::SystemLogs::SystemLogs(DB::Context&, Poco::Util::AbstractConfiguration const&) /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/SystemLog.cpp:47 15 0x12350225 in void std::__1::__optional_storage_base<DB::SystemLogs, false>::__construct<DB::Context&, Poco::Util::AbstractConfiguration const&>(DB::Context&, Poco::Util::AbstractConfiguration const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/optional:323:54 16 0x12350225 in DB::SystemLogs& std::__1::optional<DB::SystemLogs>::emplace<DB::Context&, Poco::Util::AbstractConfiguration const&, void>(DB::Context&, Poco::Util::AbstractConfiguration const&) /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/optional:826 17 0x12350225 in DB::Context::initializeSystemLogs() /build/obj-x86_64-linux-gnu/../dbms/src/Interpreters/Context.cpp:1679 18 0x760b2c6 in DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /build/obj-x86_64-linux-gnu/../dbms/programs/server/Server.cpp:528:25 19 0x147fbce0 in Poco::Util::Application::run() /build/obj-x86_64-linux-gnu/../contrib/poco/Util/src/Application.cpp:335:8 20 0x75f5df5 in DB::Server::run() /build/obj-x86_64-linux-gnu/../dbms/programs/server/Server.cpp:149:25 21 0x76463e3 in mainEntryClickHouseServer(int, char**) /build/obj-x86_64-linux-gnu/../dbms/programs/server/Server.cpp:962:20 22 0x75eaa8b in main /build/obj-x86_64-linux-gnu/../dbms/programs/main.cpp:178:12 23 0x7ffff7e01bba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bba) SUMMARY: AddressSanitizer: stack-use-after-scope /build/obj-x86_64-linux-gnu/../contrib/libcxx/include/memory:3933:56 in std::__1::shared_ptr<DB::ContextShared>::operator->() const Shadow bytes around the buggy address: 0x10006bb0b3c0: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b3d0: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b3e0: f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 0x10006bb0b3f0: f2 f2 f2 f2 f2 f2 f8 f8 f2 f2 f8 f8 f8 f2 f2 f2 0x10006bb0b400: f2 f2 f8 f8 f8 f2 f2 f2 f2 f2 f8 f8 f8 f8 f8 f8 =>0x10006bb0b410:[f8]f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b420: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b430: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b440: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b450: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 0x10006bb0b460: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==1==ABORTING
2019-11-03 19:31:20 +00:00
select.emplace(view.query, local_context, SelectQueryOptions());
in = std::make_shared<MaterializingBlockInputStream>(select->execute().in);
2019-08-09 17:15:01 +00:00
/// Squashing is needed here because the materialized view query can generate a lot of blocks
/// even when only one block is inserted into the parent table (e.g. if the query is a GROUP BY
/// and two-level aggregation is triggered).
in = std::make_shared<SquashingBlockInputStream>(
in, context.getSettingsRef().min_insert_block_size_rows, context.getSettingsRef().min_insert_block_size_bytes);
2020-01-23 15:53:58 +00:00
in = std::make_shared<ConvertingBlockInputStream>(context, in, view.out->getHeader(), ConvertingBlockInputStream::MatchColumnsMode::Name);
}
2019-08-09 15:32:44 +00:00
else
in = std::make_shared<OneBlockInputStream>(block);
in->readPrefix();
while (Block result_block = in->read())
{
Nested::validateArraySizes(result_block);
view.out->write(result_block);
}
in->readSuffix();
}
catch (Exception & ex)
{
2019-12-05 11:42:13 +00:00
ex.addMessage("while pushing to view " + view.table_id.getNameForLogs());
throw;
}
}
}