
I am using Boost Asio and hitting a segmentation fault crash in ubuntu. I don't have any issue when this is run in the windows. it runs and after half an hour, it hits this crash. Below is the code that starts from beginning to the place that the segmentation fault happened.
The interesting part is that I use io_strand all over the code and I don't see any thread-safety issue. In the program I use 2 threads that run the worker io_servece.run().
I also put some printf in the HandleSend() just before the crash. i can see that itr pointer is not valid even though m_pending_sends has one element in the list that is supposed to be this itr pointer.
What could be wrong here?
Is it possible that m_pending_sends changes between StartSend and HandleSend?