Open flymysql opened 11 months ago
The reason for this problem is that the apache::thrift::HeaderServerChannel::HeaderRequest::isOneway()
function in the thrift library does not do null pointer verification
thrift\lib\cpp2\async\HeaderServerChannel.h
class HeaderRequest final : public ResponseChannelRequest {
public:
HeaderRequest(
HeaderServerChannel* channel,
std::unique_ptr<folly::IOBuf>&& buf,
std::unique_ptr<apache::thrift::transport::THeader>&& header,
const server::TServerObserver::SamplingStatus& samplingStatus);
bool isActive() const override {
DCHECK(false);
return true;
}
// Note: 这个函数里面应该做空指针校验
bool isOneway() const override {
return header_->getSequenceNumber() == ONEWAY_REQUEST_ID;
}
bool includeEnvelope() const override { return true; }
void setInOrderRecvSequenceId(uint32_t seqId) { InOrderRecvSeqId_ = seqId; }
need change to
// Note: 这个函数里面应该做空指针校验
bool isOneway() const override {
if (header_.get() == nullptr) {
return true;
}
return header_->getSequenceNumber() == ONEWAY_REQUEST_ID;
}
this is my patch
diff -ur a/thrift/lib/cpp2/async/HeaderServerChannel.h b/thrift/lib/cpp2/async/HeaderServerChannel.h
--- a/thrift/lib/cpp2/async/HeaderServerChannel.h 2022-08-18 16:27:45.353299307 +0800
+++ b/thrift/lib/cpp2/async/HeaderServerChannel.h 2022-08-18 16:27:28.453299912 +0800
@@ -108,6 +108,10 @@
}
bool isOneway() const override {
+ if (header_.get() == nullptr) {
+ LOG(ERROR) << "header request is null";
+ return true;
+ }
return header_->getSequenceNumber() == ONEWAY_REQUEST_ID;
}
Amazing @flymysql would you mind PR to https://github.com/vesoft-inc/nebula-third-party/tree/master/project/patches ?
@dutor could you please take a look at this?
THANKS!
Seems already addressed by https://github.com/vesoft-inc/nebula-third-party/blob/release-3.3/project/patches/fbthrift-2021-11-29.patch ?
Seems already addressed by https://github.com/vesoft-inc/nebula-third-party/blob/release-3.3/project/patches/fbthrift-2021-11-29.patch ?
Oh, that's great. Since I'm still using the v3.0 version, I didn't find it fixed.
This is a known issue, and we have fixed it with an adhoc patch.
Please check the FAQ documentation before raising an issue
I have the same problem as in the link below, but I am not using the nebula-go client side, I am using the nebula-java client side, but the call stack of graphd crash is still the same.
Describe the bug (required) https://discuss.nebula-graph.com.cn/t/topic/10101/13 https://github.com/vesoft-inc/nebula/issues/4635
Your Environments (required)
uname -a
g++ --version
orclang++ --version
lscpu
version v3.2.1 nebula-graphd version Git: bb2e684