Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6852395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:21:56+00:00 2026-05-27T01:21:56+00:00

I have a simple use case for a Thrift Server( TSimpleServer ) wherein I

  • 0

I have a simple use case for a Thrift Server(TSimpleServer) wherein I have a couple of threads spawned(besides the main thread). One of the newly spawned threads enters the Thrift event loop (i.e server.serve()). Upon receiving a signal in the main thread I invoke server.stop() which is causing the error posted below.

At first I thought it was an uncaught exception. However wrapping both the invocations of server.serve() and server.stop() in try-catch‘es didn’t help isolate the problem. Any thoughts/suggestions(on what I should be doing)? Most Thrift tutorials/guides/examples seem to talk about server start but don’t seem to mention the stop scenario, any pointers/best-practices/suggestions in this regard would be great. Thanks.

Also, I am using thrift-0.7.0.

Error details:

Thrift: Fri Nov 18 21:22:47 2011 TServerTransport died on accept: TTransportExc\
eption: Interrupted
*** glibc detected *** ./build/mc_daemon: munmap_chunk(): invalid poi\
nter: 0x0000000000695f18 ***
Segmentation fault (core dumped)

Also here’s the stack-trace:

#0  0x00007fb751c92f08 in ?? () from /lib/libc.so.6
#1  0x00007fb7524bb0eb in apache::thrift::server::TSimpleServer::serve (
    this=0x1e5bca0) at src/server/TSimpleServer.cpp:140
#2  0x000000000046ce15 in a::b::server_thread::operator() (
    this=0x695f18)
    at /path/to/server_thread.cpp:80
#3  0x000000000046c1a9 in boost::detail::thread_data<boost::reference_wrapper<a\
ds::data_load::server_thread> >::run (this=0x1e5bd80)
    at /usr/include/boost/thread/detail/thread.hpp:81
#4  0x00007fb7526f2b70 in thread_proxy ()
   from /usr/lib/libboost_thread.so.1.40.0
#5  0x00007fb7516fd9ca in start_thread () from /lib/libpthread.so.0
#6  0x00007fb7519fa70d in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Edit 1: I have added pseudo-code for the main thread, the thrift server thread and the background thread.

Edit 2: I seem to have resolved the original issue as noted in my answer below. However this solution leads to two rather undesirable/questionable design choices: (i) I had to introduce a thrift endpoint to enable a mechanism to stop the server (ii) The handler class for the thrift service(which is usually required to instantiate a server object) now requires a means to signal back to the server to stop, introducing a circular dependency of sorts.

Any suggestions on these design issues/choices would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:21:56+00:00Added an answer on May 27, 2026 at 1:21 am

    My problem seems to have stemmed from my code/design wherein I had signal-handler code in the main thread invoking stop on the server which was started in a ‘server thread’. Changing this behavior(as noted in the pastebin code-snippets) helped resolve this issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This one should be pretty simple. The use case is that I have a
My use case is very simple : I have a GUI application, and inside
I use SQL Server 2005. I have a simple logging table that my web
I'm trying to use a Thread in a simple winform. I have a ListBox
I have a simple yield use case and for some unknown reason the default
My use case is simple. I have a root domain object which references a
I have a simple use case <div id=contentDiv> <!-- This does not work -->
Imagine a simple banking application wherein a use case of fund transfer is being
I have a very simple use case. My app lets users send invitations to
I have a relatively simple use case which is failing. Consider the following code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.