Skip to content

Logical error: false && "WriteBuffer is neither finalized nor canceled in destructor." #75520

@PedroTadim

Description

@PedroTadim

Describe the bug

This issue happens with a combination of settings: memory_tracker_fault_probability = 1.000000, log_query_views = 0, materialized_views_ignore_errors = 1 and a Set table.

How to reproduce

The INSERT query is large, so I leave a query file here:

issue.txt

Error message and/or stacktrace

Stack trace:

<Error> WriteBuffer: WriteBuffer is neither finalized nor canceled when destructor is called. No exceptions in flight are detected. The file might not be written at all or might be truncated.Stack trace:
0. src/Common/StackTrace.cpp:381: StackTrace::tryCapture() @ 0x00000000264d1397
1. src/Common/StackTrace.h:48: DB::WriteBuffer::~WriteBuffer() @ 0x0000000026553489
2. src/Storages/StorageSet.cpp:93: DB::SetOrJoinSink::~SetOrJoinSink() @ 0x000000003582198d
3. std::__shared_weak_count::__release_shared[abi:ne180100]() @ 0x000000001963387e
4. contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:648: std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>::__base_destruct_at_end[abi:ne180100](std::shared_ptr<DB::IProcessor>*) @ 0x000000002afc5845
5. contrib/llvm-project/libcxx/include/vector:920: void std::__shared_ptr_emplace<std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>, std::allocator<std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>>>::__on_zero_shared_impl[abi:ne180100]<std::allocator<std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>>, 0>() @ 0x00000000313e8ab7
6. std::__shared_weak_count::__release_shared[abi:ne180100]() @ 0x000000001963387e
7. contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:648: DB::QueryPipeline::~QueryPipeline() @ 0x00000000313ee4f9
8. src/QueryPipeline/QueryPipeline.cpp:699: DB::QueryPipeline::reset() @ 0x00000000313f7da5
9. src/Server/TCPHandler.cpp:0: DB::TCPHandler::runImpl() @ 0x0000000036706e85
10. src/Server/TCPHandler.cpp:2624: DB::TCPHandler::run() @ 0x0000000036735b0e
11. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x000000003a9b1d82
12. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x000000003a9b2a52
13. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000003a91c997
14. base/poco/Foundation/src/Thread_POSIX.cpp:335: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000003a9183ce
15. ? @ 0x00007ffff7ca1e2e
16. ? @ 0x00007ffff7d33a4c

<Fatal> : Logical error: 'false && "WriteBuffer is neither finalized nor canceled in destructor."'.
<Fatal> : Stack trace (when copying this message, always include the lines below):

0. src/Common/StackTrace.cpp:381: StackTrace::tryCapture() @ 0x00000000264d1397
1. src/Common/StackTrace.h:48: DB::abortOnFailedAssertion(String const&) @ 0x00000000264875f7
2. src/IO/WriteBuffer.cpp:30: DB::WriteBuffer::~WriteBuffer() @ 0x0000000026553927
3. src/Storages/StorageSet.cpp:93: DB::SetOrJoinSink::~SetOrJoinSink() @ 0x000000003582198d
4. std::__shared_weak_count::__release_shared[abi:ne180100]() @ 0x000000001963387e
5. contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:648: std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>::__base_destruct_at_end[abi:ne180100](std::shared_ptr<DB::IProcessor>*) @ 0x000000002afc5845
6. contrib/llvm-project/libcxx/include/vector:920: void std::__shared_ptr_emplace<std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>, std::allocator<std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>>>::__on_zero_shared_impl[abi:ne180100]<std::allocator<std::vector<std::shared_ptr<DB::IProcessor>, std::allocator<std::shared_ptr<DB::IProcessor>>>>, 0>() @ 0x00000000313e8ab7
7. std::__shared_weak_count::__release_shared[abi:ne180100]() @ 0x000000001963387e
8. contrib/llvm-project/libcxx/include/__memory/shared_ptr.h:648: DB::QueryPipeline::~QueryPipeline() @ 0x00000000313ee4f9
9. src/QueryPipeline/QueryPipeline.cpp:699: DB::QueryPipeline::reset() @ 0x00000000313f7da5
10. src/Server/TCPHandler.cpp:0: DB::TCPHandler::runImpl() @ 0x0000000036706e85
11. src/Server/TCPHandler.cpp:2624: DB::TCPHandler::run() @ 0x0000000036735b0e
12. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x000000003a9b1d82
13. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x000000003a9b2a52
14. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000003a91c997
15. base/poco/Foundation/src/Thread_POSIX.cpp:335: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000003a9183ce
16. ? @ 0x00007ffff7ca1e2e
17. ? @ 0x00007ffff7d33a4c

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official releasefuzzProblem found by one of the fuzzers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions