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

(experimental transactions) An EXPLAIN query causes a segfault #63918

Closed
ttanay opened this issue May 15, 2024 · 0 comments · Fixed by #63926
Closed

(experimental transactions) An EXPLAIN query causes a segfault #63918

ttanay opened this issue May 15, 2024 · 0 comments · Fixed by #63926
Assignees
Labels
crash Crash / segfault / abort experimental feature Bug in the feature that should not be used in production

Comments

@ttanay
Copy link
Contributor

ttanay commented May 15, 2024

Describe what's wrong
Although not documented, an EXPLAIN CURRENT TRANSACTION query is possible.
Executing the query - EXPLAIN CURRENT TRANSACTION; causes a segmentation fault.
Query Result:

[32d3a7360825] 2024.05.15 19:31:26.025140 [ 713 ] <Fatal> BaseDaemon: ########################################
[32d3a7360825] 2024.05.15 19:31:26.025200 [ 713 ] <Fatal> BaseDaemon: (version 24.4.1.2088 (official build), build id: 8474BE9DB7BA90A8E303C2F4B836BA6EC5A57A63, git hash: 6d4b31322d168356c8b10c43b4cef157c82337ff) (from thread 48) (query_id: 3df1d272-0de9-4f11-bb12-116af1499d7e) (query: ) Received signal Segmentation fault (11)
[32d3a7360825] 2024.05.15 19:31:26.025241 [ 713 ] <Fatal> BaseDaemon: Address: NULL pointer. Access: read. Address not mapped to object.
[32d3a7360825] 2024.05.15 19:31:26.025268 [ 713 ] <Fatal> BaseDaemon: Stack trace: 0x0000000011117852 0x00000000111169ba 0x00000000122a59c4 0x00000000122c1fb9 0x0000000014c105b2 0x0000000014c113f9 0x0000000014d09a61 0x0000000014d07ffd 0x00007116d8389609 0x00007116d82a4353
[32d3a7360825] 2024.05.15 19:31:26.025340 [ 713 ] <Fatal> BaseDaemon: 2. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000011117852
[32d3a7360825] 2024.05.15 19:31:26.025392 [ 713 ] <Fatal> BaseDaemon: 3. DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x00000000111169ba
[32d3a7360825] 2024.05.15 19:31:26.025434 [ 713 ] <Fatal> BaseDaemon: 4. DB::TCPHandler::runImpl() @ 0x00000000122a59c4
[32d3a7360825] 2024.05.15 19:31:26.025482 [ 713 ] <Fatal> BaseDaemon: 5. DB::TCPHandler::run() @ 0x00000000122c1fb9
[32d3a7360825] 2024.05.15 19:31:26.025542 [ 713 ] <Fatal> BaseDaemon: 6. Poco::Net::TCPServerConnection::start() @ 0x0000000014c105b2
[32d3a7360825] 2024.05.15 19:31:26.025605 [ 713 ] <Fatal> BaseDaemon: 7. Poco::Net::TCPServerDispatcher::run() @ 0x0000000014c113f9
[32d3a7360825] 2024.05.15 19:31:26.025660 [ 713 ] <Fatal> BaseDaemon: 8. Poco::PooledThread::run() @ 0x0000000014d09a61
[32d3a7360825] 2024.05.15 19:31:26.025721 [ 713 ] <Fatal> BaseDaemon: 9. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000014d07ffd
[32d3a7360825] 2024.05.15 19:31:26.025764 [ 713 ] <Fatal> BaseDaemon: 10. ? @ 0x00007116d8389609
[32d3a7360825] 2024.05.15 19:31:26.025812 [ 713 ] <Fatal> BaseDaemon: 11. ? @ 0x00007116d82a4353
[32d3a7360825] 2024.05.15 19:31:26.144100 [ 713 ] <Fatal> BaseDaemon: Integrity check of the executable successfully passed (checksum: 1B4AB729A4BACA7860A3C947777632AD)
[32d3a7360825] 2024.05.15 19:31:26.144299 [ 713 ] <Fatal> BaseDaemon: Report this error to https://github.com/ClickHouse/ClickHouse/issues
[32d3a7360825] 2024.05.15 19:31:26.144425 [ 713 ] <Fatal> BaseDaemon: Changed settings: output_format_pretty_color = 0, output_format_pretty_grid_charset = 'ASCII'

Does it reproduce on the most recent release?
Yes. Links to fiddles:

How to reproduce
Running EXPLAIN CURRENT TRANSACTION; against the head version causes the segmentation fault.

Expected behavior
Since EXPLAIN CURRENT TRANSACTION; is not documented, the server should report its incorrect usage or that it is unsupported, instead of crashing.
If it is indeed supported, then either <no current transaction> or the description of the current transaction should be returned as the query result.

Error message and/or stacktrace

[32d3a7360825] 2024.05.15 19:31:26.025140 [ 713 ] <Fatal> BaseDaemon: ########################################
[32d3a7360825] 2024.05.15 19:31:26.025200 [ 713 ] <Fatal> BaseDaemon: (version 24.4.1.2088 (official build), build id: 8474BE9DB7BA90A8E303C2F4B836BA6EC5A57A63, git hash: 6d4b31322d168356c8b10c43b4cef157c82337ff) (from thread 48) (query_id: 3df1d272-0de9-4f11-bb12-116af1499d7e) (query: ) Received signal Segmentation fault (11)
[32d3a7360825] 2024.05.15 19:31:26.025241 [ 713 ] <Fatal> BaseDaemon: Address: NULL pointer. Access: read. Address not mapped to object.
[32d3a7360825] 2024.05.15 19:31:26.025268 [ 713 ] <Fatal> BaseDaemon: Stack trace: 0x0000000011117852 0x00000000111169ba 0x00000000122a59c4 0x00000000122c1fb9 0x0000000014c105b2 0x0000000014c113f9 0x0000000014d09a61 0x0000000014d07ffd 0x00007116d8389609 0x00007116d82a4353
[32d3a7360825] 2024.05.15 19:31:26.025340 [ 713 ] <Fatal> BaseDaemon: 2. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x0000000011117852
[32d3a7360825] 2024.05.15 19:31:26.025392 [ 713 ] <Fatal> BaseDaemon: 3. DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x00000000111169ba
[32d3a7360825] 2024.05.15 19:31:26.025434 [ 713 ] <Fatal> BaseDaemon: 4. DB::TCPHandler::runImpl() @ 0x00000000122a59c4
[32d3a7360825] 2024.05.15 19:31:26.025482 [ 713 ] <Fatal> BaseDaemon: 5. DB::TCPHandler::run() @ 0x00000000122c1fb9
[32d3a7360825] 2024.05.15 19:31:26.025542 [ 713 ] <Fatal> BaseDaemon: 6. Poco::Net::TCPServerConnection::start() @ 0x0000000014c105b2
[32d3a7360825] 2024.05.15 19:31:26.025605 [ 713 ] <Fatal> BaseDaemon: 7. Poco::Net::TCPServerDispatcher::run() @ 0x0000000014c113f9
[32d3a7360825] 2024.05.15 19:31:26.025660 [ 713 ] <Fatal> BaseDaemon: 8. Poco::PooledThread::run() @ 0x0000000014d09a61
[32d3a7360825] 2024.05.15 19:31:26.025721 [ 713 ] <Fatal> BaseDaemon: 9. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000014d07ffd
[32d3a7360825] 2024.05.15 19:31:26.025764 [ 713 ] <Fatal> BaseDaemon: 10. ? @ 0x00007116d8389609
[32d3a7360825] 2024.05.15 19:31:26.025812 [ 713 ] <Fatal> BaseDaemon: 11. ? @ 0x00007116d82a4353
[32d3a7360825] 2024.05.15 19:31:26.144100 [ 713 ] <Fatal> BaseDaemon: Integrity check of the executable successfully passed (checksum: 1B4AB729A4BACA7860A3C947777632AD)
[32d3a7360825] 2024.05.15 19:31:26.144299 [ 713 ] <Fatal> BaseDaemon: Report this error to https://github.com/ClickHouse/ClickHouse/issues
[32d3a7360825] 2024.05.15 19:31:26.144425 [ 713 ] <Fatal> BaseDaemon: Changed settings: output_format_pretty_color = 0, output_format_pretty_grid_charset = 'ASCII'
@ttanay ttanay added the potential bug To be reviewed by developers and confirmed/rejected. label May 15, 2024
@ttanay ttanay changed the title An EXPLAIN query causes a segmentation fault An EXPLAIN query causes a segfault May 15, 2024
@CurtizJ CurtizJ added the crash Crash / segfault / abort label May 15, 2024
@CurtizJ CurtizJ self-assigned this May 15, 2024
@alexey-milovidov alexey-milovidov added experimental feature Bug in the feature that should not be used in production and removed potential bug To be reviewed by developers and confirmed/rejected. labels May 16, 2024
@alexey-milovidov alexey-milovidov changed the title An EXPLAIN query causes a segfault (experimental transactions) An EXPLAIN query causes a segfault May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Crash / segfault / abort experimental feature Bug in the feature that should not be used in production
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants