Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add signal handlers in client and local #61109

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

tavplubix
Copy link
Member

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Print stacktrace and diagnostic info if clickhouse-client or clickhouse-local crashes

@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-improvement Pull request with some product improvements label Mar 8, 2024
@robot-ch-test-poll1
Copy link
Contributor

robot-ch-test-poll1 commented Mar 8, 2024

This is an automated comment for commit ec3f24e with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integrational tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help❌ failure
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
Mergeable CheckChecks if all other necessary checks are successful❌ failure
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
Unit testsRuns the unit tests for different release types❌ error

@nikitamikhaylov nikitamikhaylov self-assigned this Mar 11, 2024
@nikitamikhaylov
Copy link
Member

@tavplubix I need this PR to debug a very interesting issue with fuzzer and that's why I'm pushing to your branch.

@tavplubix
Copy link
Member Author

It's okay. Btw, I made this PR specifically for the issue with fuzzer

@nikitamikhaylov
Copy link
Member

nikitamikhaylov commented Mar 12, 2024

The same stacktrace as in #61062 and nothing more interesting.

Fuzzing step 0 out of 1
Query succeeded, using this AST as a start
Fuzzing step 0 out of 1
Query succeeded, using this AST as a start
Fuzzing step 0 out of 1000
Logical error: 'table'.
########## Short fault info ############
(version 24.3.1.1030, build id: , git hash: ) (from thread 1324) Received signal 6
Signal description: Aborted

Stack trace: 0x00007f2cf307d9fc 0x00007f2cf3029476 0x00007f2cf300f7f3 0x0000564ea072a688 0x0000564eb0d2ad9f 0x0000564eb0baa754 0x0000564eacfed87c 0x0000564eb0c794f6 0x0000564ea0a5b065 0x0000564eaf9156d5 0x0000564eaf9184da 0x0000564eaf91dff2 0x0000564ea0a514b2 0x0000564eb2e352b3 0x0000564ea0a6caa7 0x0000564e943ac15c 0x00007f2cf3010d90 0x00007f2cf3010e40 0x0000564e94393e6e
########################################
(version 24.3.1.1030, build id: , git hash: ) (from thread 1324) (no query) Received signal Aborted (6)

Stack trace: 0x00007f2cf307d9fc 0x00007f2cf3029476 0x00007f2cf300f7f3 0x0000564ea072a688 0x0000564eb0d2ad9f 0x0000564eb0baa754 0x0000564eacfed87c 0x0000564eb0c794f6 0x0000564ea0a5b065 0x0000564eaf9156d5 0x0000564eaf9184da 0x0000564eaf91dff2 0x0000564ea0a514b2 0x0000564eb2e352b3 0x0000564ea0a6caa7 0x0000564e943ac15c 0x00007f2cf3010d90 0x00007f2cf3010e40 0x0000564e94393e6e
3. ? @ 0x00007f2cf307d9fc
4. ? @ 0x00007f2cf3029476
5. ? @ 0x00007f2cf300f7f3
6. ./build_docker/./src/Common/Exception.cpp:43: DB::abortOnFailedAssertion(String const&) @ 0x0000000024e28688
7. ./src/Parsers/ASTQueryWithTableAndOutput.h:65: DB::ASTQueryWithTableAndOutputImpl<DB::ASTShowCreateDatabaseQueryIDAndQueryNames>::formatQueryImpl(DB::IAST::FormatSettings const&, DB::IAST::FormatState&, DB::IAST::FormatStateStacked) const @ 0x0000000035428d9f
8. ./build_docker/./src/Parsers/ASTQueryWithOutput.cpp:42: DB::ASTQueryWithOutput::formatImpl(DB::IAST::FormatSettings const&, DB::IAST::FormatState&, DB::IAST::FormatStateStacked) const @ 0x00000000352a8754
9.0. inlined from ./contrib/llvm-project/libcxx/include/__tree:1088: std::__tree<std::tuple<DB::IAST const*, String, CityHash_v1_0_2::uint128>, std::less<std::tuple<DB::IAST const*, String, CityHash_v1_0_2::uint128>>, std::allocator<std::tuple<DB::IAST const*, String, CityHash_v1_0_2::uint128>>>::__root[abi:v15000]() const
9.1. inlined from ./contrib/llvm-project/libcxx/include/__tree:1788: ~__tree
9.2. inlined from ./contrib/llvm-project/libcxx/include/set:676: ~set
9.3. inlined from ./src/Parsers/IAST.h:240: ~FormatState
9. ./src/Parsers/IAST.h:267: DB::IAST::format(DB::IAST::FormatSettings const&) const @ 0x00000000316eb87c
10. ./build_docker/./src/Parsers/IAST.cpp:0: DB::IAST::formatWithPossiblyHidingSensitiveData(unsigned long, bool, bool) const @ 0x00000000353774f6
11. ./build_docker/./programs/client/Client.cpp:782: DB::Client::processWithFuzzing(String const&) @ 0x0000000025159065
12. ./build_docker/./src/Client/ClientBase.cpp:2148: DB::ClientBase::executeMultiQuery(String const&) @ 0x00000000340136d5
13. ./build_docker/./src/Client/ClientBase.cpp:0: DB::ClientBase::processMultiQueryFromFile(String const&) @ 0x00000000340164da
14. ./build_docker/./src/Client/ClientBase.cpp:0: DB::ClientBase::runNonInteractive() @ 0x000000003401bff2
15. ./build_docker/./programs/client/Client.cpp:0: DB::Client::main(std::vector<String, std::allocator<String>> const&) @ 0x000000002514f4b2
16. ./build_docker/./base/poco/Util/src/Application.cpp:0: Poco::Util::Application::run() @ 0x00000000375332b3
17. ./build_docker/./programs/client/Client.cpp:0: mainEntryClickHouseClient(int, char**) @ 0x000000002516aaa7
18. ./build_docker/./programs/main.cpp:0: main @ 0x0000000018aaa15c
19. ? @ 0x00007f2cf3010d90
20. ? @ 0x00007f2cf3010e40
21. _start @ 0x0000000018a91e6e
This ClickHouse version is not official and should be upgraded to the official build.
timeout: the monitored command dumped core

@Algunenano
Copy link
Member

Looking at the coredump, the problem comes when fuzzing SHOW DATABASE t_2710_db;

Repro for that coredump (just give it a couple of seconds):

timeout -s TERM --preserve-status 30m clickhouse client --max_memory_usage_in_client=1000000000 --receive_timeout=10 --receive_data_timeout_ms=10000 --stacktrace --query-fuzzer-runs=1000 --create-query-fuzzer-runs=50 --queries-file tests/queries/0_stateless/02710_show_table.sql

Anyhow, let's merge this as it's super useful

@Algunenano
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants