-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Avoid null dereference after "Unknown packet X from server" #8071
Merged
alexey-milovidov
merged 2 commits into
ClickHouse:master
from
azat:Connection-sendCancel-SIGSEGV
Dec 6, 2019
Merged
Avoid null dereference after "Unknown packet X from server" #8071
alexey-milovidov
merged 2 commits into
ClickHouse:master
from
azat:Connection-sendCancel-SIGSEGV
Dec 6, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stracktrace: ... 2 DB::WriteBuffer::nextIfAtEnd (this=0x0) at ../dbms/src/IO/WriteBuffer.h:66 3 DB::writeVarUInt (ostr=..., x=3) at ../dbms/src/IO/VarInt.h:191 4 DB::Connection::sendCancel (this=0x7f0b7f5e5610) at ../dbms/src/Client/Connection.cpp:444 5 0x0000561738d0b565 in DB::MultiplexedConnections::sendCancel (this=0x7f0c9b0173e0) at ../dbms/src/Client/MultiplexedConnections.cpp:174 6 0x00005617387d22df in DB::RemoteBlockInputStream::tryCancel (this=0x7f0cc45f9810, reason=<optimized out>) at /usr/include/c++/9/bits/unique_ptr.h:352 7 0x00005617387d2a37 in DB::RemoteBlockInputStream::cancel (this=<optimized out>, kill=false) at ../dbms/src/DataStreams/RemoteBlockInputStream.cpp:121 8 0x000056173891f10c in DB::ParallelInputsProcessor<DB::UnionBlockInputStream::Handler>::cancel (this=0x7f0c370ec168, kill=kill@entry=false) 9 0x000056173892cfce in DB::UnionBlockInputStream::cancel (kill=false, this=<optimized out>) at ../dbms/src/DataStreams/UnionBlockInputStream.h:99 10 DB::UnionBlockInputStream::Handler::onException (this=0x7f0c370ec160, exception=...) at ../dbms/src/DataStreams/UnionBlockInputStream.h:240 11 DB::ParallelInputsProcessor<DB::UnionBlockInputStream::Handler>::thread (this=0x7f0c370ec168, thread_group=..., thread_num=<optimized out>) at ../dbms/src/DataStreams/ParallelInputsProcessor.h:217 And in onException frame there is: (gdb) p ((DB::Exception *)exception._M_exception_object)._msg._M_dataplus._M_p $6 = (...) 0x7f0c9b1e7a40 "Unknown packet 9 from server HOSTNAME:PORT" And on "Unknown packet" there is disconnect() before, see default in switch statement at Connection::receivePacket().
alexey-milovidov
approved these changes
Dec 6, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
There is no test, but it will be difficult to provide (a fake server). So, no need for test.
KochetovNicolai
added
the
pr-bugfix
Pull request with bugfix, not backported by default
label
Dec 16, 2019
KochetovNicolai
pushed a commit
that referenced
this pull request
Dec 17, 2019
Avoid null dereference after "Unknown packet X from server" (cherry picked from commit bef3a0d)
KochetovNicolai
pushed a commit
that referenced
this pull request
Dec 19, 2019
Avoid null dereference after "Unknown packet X from server" (cherry picked from commit bef3a0d)
KochetovNicolai
pushed a commit
that referenced
this pull request
Dec 20, 2019
Avoid null dereference after "Unknown packet X from server" (cherry picked from commit bef3a0d)
vitlibar
pushed a commit
that referenced
this pull request
Dec 26, 2019
Avoid null dereference after "Unknown packet X from server" (cherry picked from commit bef3a0d)
vitlibar
pushed a commit
that referenced
this pull request
Dec 27, 2019
Avoid null dereference after "Unknown packet X from server" (cherry picked from commit bef3a0d)
One more symptom of the same bug reported:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (up to few sentences, required except for Non-significant/Documentation categories):
Avoid null dereference after "Unknown packet X from server"
Detailed description (optional):
stracktrace:
And in
onException
frame there is:And on "Unknown packet" there is
disconnect()
before, see default inswitch statement at
Connection::receivePacket()
.