You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2019/07/18 05:17:27 UTC

[GitHub] [incubator-brpc] ehds opened a new issue #847: 关于异步请求response分配问题导致的纯虚函数调用错误。

ehds opened a new issue #847: 关于异步请求response分配问题导致的纯虚函数调用错误。
URL: https://github.com/apache/incubator-brpc/issues/847
 
 
   **Describe the bug (描述bug)**
   在官方示例asynchronous_echo_c++中,经response分配在栈上,异步请求在回调的Closure中不传入response即:
   ```
   void HandleEchoResponse(brpc::Controller* cntl) {...}
   ```
   开启-O2选项,正常执行(猜测:response虽然在请求后被析构,但是done中没有使用所以正常执行)
   但是关闭-O2编译选项后出现
   ```
   pure virtual method called
   terminate called without an active exception
   ```
   猜测:没有优化会引发未定义行为?
   **To Reproduce (复现方法)**
   在官方示例asynchronous_echo_c++中,将response在栈上分配,并且回调函数只传入Controller,关闭-O2选项。
   
   **Expected behavior (期望行为)**
   
   
   **Versions (各种版本)**
   OS: ubuntu19.04
   Compiler: GNU 8.3.0 
   brpc: 0.9.6
   protobuf: 3.6.1
   
   **Additional context/screenshots (更多上下文/截图)**
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org