yitian108 commented on issue #9796:
URL: https://github.com/apache/pulsar/issues/9796#issuecomment-791089244


   @BewareMyPower Hello Mr Xu, I use the const MAX_COUNT just for testing the 
running times just like your 'for' loop, the following code is original:
   
   `
   int cnt = 0;
   while(true)
   {
        Message msg = MessageBuilder().setContent("content").setProperty("x", 
"1").build();
        producer.sendAsync(msg, callback);
   
        if (++cnt == MAX_COUNT )
             break;
        std::cout << "Current times: " << cnt << std::endl;
        std::this_thread::sleep_for(std::chrono::seconds(1));
   }
   `
   However, it seems nothing to do with the counter, and inexplicably, when I 
use the send() method , it works ok, but async method, it usually run some 
times, the segment fault occurs:
   
   some case like this:
   
   2021-03-05 09:48:21.752 INFO  [140688852817664] ProducerImpl:170 | 
[persistent://kgl/kts/KGL_KTS_TRADE_CENTER_REQUEST, ] Created producer on 
broker [127.0.0.1:56648 -> 127.0.0.1:6650] 
   Compute 10000 requests
   Current times: 1
   Current times: 2
   Current times: 3
   Current times: 4
   Current times: 5
   Current times: 6
   Current times: 7
   Current times: 8
   Current times: 9
   Current times: 10
   Current times: 11
   Current times: 12
   Segmentation fault (core dumped)
   
   Attached 
   
![core](https://user-images.githubusercontent.com/3113836/110056418-c2680f80-7d99-11eb-8b37-acfbc7a8358b.png)
    file is gdb core , hopefully, it can support the case.


----------------------------------------------------------------
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:
[email protected]


Reply via email to