You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Lars Benner (JIRA)" <ji...@apache.org> on 2014/03/28 17:14:17 UTC

[jira] [Commented] (THRIFT-2430) Crash during TThreadPoolServer shutdown

    [ https://issues.apache.org/jira/browse/THRIFT-2430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13950956#comment-13950956 ] 

Lars Benner commented on THRIFT-2430:
-------------------------------------

Hi Lars,

just create a JIRA ticket and add the patch file as outlined in http://thrift.apache.org/docs/HowToContribute

Thanks,
JensG



-----Ursprüngliche Nachricht-----
From: Lars Benner
Sent: Tuesday, March 25, 2014 7:02 PM
To: user@thrift.apache.org
Subject: RE: C++ TThreadPoolServer shutdown

Hi,

I rebuild the Thrift lib today, just to make sure my lib wasn't corrupted.

During the rebuild I got a warning, that no public symbols are available for TTransportException. For removing this warning I moved the implementation of
TTransportException::what() from the header file to the cpp file. After doing this and rebuilding the complete application the problem was gone.

I not quite sure if I have enough insight in the compiler and linker stuff. 
But I assume that somehow the code generated for TTransportException for the lib and in my application did not match. Which would also explain the lack off a call stack. And by moving at least one method into the cpp file and thus into the lib, the lib code was used for building the actual application.

Anyway, I prefer implementations of virtual functions in the cpp files. So what is the best way for getting my changes into the next version?

Thanks again for all your comments and help,
- Lars

-----Original Message-----
From: Nevo Hed [mailto:nhed+thriftusr@aereo.com]
Sent: Tuesday, March 25, 2014 4:51 PM
To: Thrift Users
Subject: Re: C++ TThreadPoolServer shutdown

ignore me, I didn't even pay attention to which threads are being joined etc


On Tue, Mar 25, 2014 at 11:48 AM, Nevo Hed <nh...@aereo.com> wrote:

> Never used this class nor look at trace but I think join is called 
> already from serve (so you should not call it again)
>
>
>   // If stopped manually, join the existing threads
>
>
>   if (stop_) {
>     try {
>       serverTransport_->close();
>       threadManager_->join();
>     } catch (TException &tx) {
>       string errStr = string("TThreadPoolServer: Exception shutting down:
> ") + tx.what();
>       GlobalOutput(errStr.c_str());
>
>
>
>
>
>
> On Mon, Mar 24, 2014 at 4:38 PM, Lars Benner <LB...@tomtec.de> wrote:
>
>> Hi,
>>
>> I am having a problem, while shutting down a multithreaded thrift 
>> session. Basically I am setting up a TThreadPoolServer with a 
>> TPipeServer.
>> Therefore, I call in a separate thread, the serve function of
>> TThreadPoolServer:
>>
>> void run()
>> {
>>   ...
>>
>>   d->pServer->serve();
>> }
>>
>> For shutting down the server, this is done:
>>
>> void shutdown()
>> {
>>   d->pServer->stop();
>>
>>   d->serverThread.join();
>> }
>>
>> If I debug the shutdown function, stepping in or over the stop call 
>> works without a problem. But while waiting for the thread to 
>> terminate I get an unhandled exception:
>>
>> "Unhandled exception at ...: Access violation reading location 
>> 0xffffffff."
>>
>> I figured out that exceptions are used for closing the connection. It 
>> actually looks like, that the Visual Studio debugger is able to catch 
>> the exception as intended, but if I tried to do the next step, I see 
>> the exception above.
>>
>> Has anybody observed a similar issue or has an idea what is going wrong?
>>
>> Please let me additionally note that everything else is working 
>> great, including several thousand calls from the client to the server.
>>
>> You might want also some additional information:
>>
>> Thrift version: 0.9.1
>> Visual Studio 2008
>> Boost version: 1.54.0
>>
>> Thanks,
>> - Lars


> Crash during TThreadPoolServer shutdown
> ---------------------------------------
>
>                 Key: THRIFT-2430
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2430
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.1
>         Environment: Windows 7
> Visual Studio 2008
> 32 bit build
>            Reporter: Lars Benner
>             Fix For: 0.9.2
>
>
> While destroying a TThreadPoolServer instance, an unhandled exception occurred. For more details please see the comment, with the according mailing list thread.



--
This message was sent by Atlassian JIRA
(v6.2#6252)