Tencent / flare

Flare是广泛投产于腾讯广告后台的现代化C++开发框架,包含了基础库、RPC、各种客户端等。主要特点为易用性强、长尾延迟低。
Other
1.33k stars 200 forks source link

coredump when http overloaded #89

Closed xuexcy closed 1 year ago

xuexcy commented 1 year ago

https://github.com/Tencent/flare/blob/193b1f9b5a4b5175d2e5d326a4947475a87baf1a/flare/rpc/protocol/protobuf/message.cc#L51 这上面是不是要 return std::make_unique(std::move(meta), std::monostate());

在 http overloaded 后调用 NormalConnectionHandler::WriteOverloaded https://github.com/Tencent/flare/blob/193b1f9b5a4b5175d2e5d326a4947475a87baf1a/flare/rpc/internal/normal_connection_handler.cc#L347-L351

然后一直执行到在下面 msg.msg_or_buffer.index() == 1 后拿到的 pb 是个空的, https://github.com/Tencent/flare/blob/193b1f9b5a4b5175d2e5d326a4947475a87baf1a/flare/rpc/protocol/protobuf/proto_over_http_protocol.cc#L902-L906 导致 ProtoMessageToJson coredump https://github.com/Tencent/flare/blob/193b1f9b5a4b5175d2e5d326a4947475a87baf1a/flare/rpc/protocol/protobuf/gdt_json_proto_conversion.cc#L117

0x804d8000 commented 1 year ago

这里确实有问题,表示“没有body”出现了1) “body为nullptr” 2) “std::monostate”两种case。理想情况下应该是统一起来,std::monostate确实是比较合适的选择。

我看看这儿。

0x804d8000 commented 1 year ago

Fixed by #90。感谢反馈🙏