Hello,
When I run http server in a single core, I modifed in seastar code to run seastar::thread.
In the thread, I wrote a function for processing msg from main http server using seastar queue
future<> tm::process_Msg( )
{
keep_doing([this]{
std::cout << "Loop"<< std::endl;
return _queueTM->pop_eventually().then ([this] (temporary_buffer<char> fr){
return this->read_queue_msg(std::move(fr));
});
//return make_ready_future<>();
});
return make_ready_future<>();
}
++++++++++++++++++++++++++++++
Process_Msg is made to get the msg from queue all the time. I used keep_doing abstraction.
The code compiled. Pop_eventually() got a first message. When second time, it throws segmentation fault.
The place the execption is thrown here:
Program received signal SIGSEGV, Segmentation fault.
pop (this=0x600000088bd0) at /home/sothy/netbricks/seastar/core/queue.hh:143
143 T data = std::move(_q.front());
(gdb) bt
#0 pop (this=0x600000088bd0) at /home/sothy/netbricks/seastar/core/queue.hh:143
#1 pop_eventually (this=0x600000088bd0) at /home/sothy/netbricks/seastar/core/queue.hh:160
#2 operator() (__closure=0x600000120638) at topology/topologymanager.cc:47
Do you have any idea why second time, it throws segmentaitob fault?
Thanks and I can provide more details. I am using bit old seastar code (nearly one year ago, I downloaded and playing when I am getting error).
Best regards
Sothy
--
You received this message because you are subscribed to the Google Groups "seastar-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seastar-dev+unsubscribe@googlegroups.com.
To post to this group, send email to seast...@googlegroups.com.
Visit this group at https://groups.google.com/group/seastar-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/seastar-dev/1a7d08a1-daf6-4d36-8348-b431c5472f6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Sun, Apr 9, 2017 at 12:06 PM, sothy shan <soth...@gmail.com> wrote:Hello,
When I run http server in a single core, I modifed in seastar code to run seastar::thread.
In the thread, I wrote a function for processing msg from main http server using seastar queue
future<> tm::process_Msg( )
{
keep_doing([this]{
std::cout << "Loop"<< std::endl;
return _queueTM->pop_eventually().then ([this] (temporary_buffer<char> fr){
return this->read_queue_msg(std::move(fr));
});
//return make_ready_future<>();
});
return make_ready_future<>();Are you sure that the tm object remains alive for as long as keep_doing() runs? Note that process_Msg() returns and its resulting future resolves immediately.
My understanding is that, instead of creating thread, you ask me to create the a single async operation. I took ur main method into my main function. I run the code.
Now I got the segmentation fault error again.
Program received signal SIGSEGV, Segmentation fault.
memory::small_pool::allocate (this=0x7ffff7fcce48) at core/memory.cc:852
852 _free = _free->next;
(gdb) bt
#0 memory::small_pool::allocate (this=0x7ffff7fcce48) at core/memory.cc:852
#1 0x00000000004a67be in memory::allocate (size=36) at core/memory.cc:970
#2 0x00000000004a68c5 in operator new[] (size=<optimized out>) at core/memory.cc:1282
Now I got the segmentation fault error again.
Program received signal SIGSEGV, Segmentation fault.
memory::small_pool::allocate (this=0x7ffff7fcce48) at core/memory.cc:852
852 _free = _free->next;
(gdb) bt
#0 memory::small_pool::allocate (this=0x7ffff7fcce48) at core/memory.cc:852
#1 0x00000000004a67be in memory::allocate (size=36) at core/memory.cc:970
#2 0x00000000004a68c5 in operator new[] (size=<optimized out>) at core/memory.cc:1282Looks like a memory corruption, which could be caused by use-after-free errors.In such cases it's often productive to run a debug-mode build with the sanitizers enabled, they should catch such errors earlier and give more details about the cause.