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

Ben Craig commented on THRIFT-2525:
-----------------------------------

Sorry this didn't work out of the box for you Peace C :(
I have done testing in the C++ / C++ case, but not with the project that is 
included in the source tree, and with C#.  My company has it's own build 
process, and I tend to focus my efforts on that side, and on ensuring that my 
changes don't break the Apache continuous integration build.  The Visual Studio 
project doesn't get used for the continuous integration build.

If you are willing to look at this more, then I can give you some ideas at 
things to look at.  I am pretty sure that readOverlap_.last_error = 6 
(ERROR_INVALID_HANDLE) originates in TOverlappedWorkItem::process()  
(OverlappedSubmissionThread.cpp:73).  I would like to know the state of 'h' and 
'overlap'.  If they look reasonable, then that suggests that a different thread 
closed a handle before ReadFile could get to it.  

> C# client connecting to C++ server via named pipe transport gets 
> TTransportException
> ------------------------------------------------------------------------------------
>
>                 Key: THRIFT-2525
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2525
>             Project: Thrift
>          Issue Type: Bug
>          Components: C# - Library, C++ - Library
>    Affects Versions: 0.9.1
>         Environment: Windows
>            Reporter: Peace C
>             Fix For: 0.9.2
>
>
> A C# client using TNamedPipeClientTransport, connecting to a C++ server using 
> TPipeServer, causes the following exception as reported by the debugger:
> ------------------------------------------------------------------------------
> First-chance exception at 0x7703C41F in MyApp.exe: Microsoft C++ exception: 
> apache::thrift::transport::TTransportException at memory location 0x00D0EF80.
> First-chance exception at 0x7703C41F in MyApp.exe: Microsoft C++ exception: 
> apache::thrift::transport::TTransportException at memory location 0x00D0EF80.
> First-chance exception at 0x779C12F7 in MyApp.exe: 0xC0000008: An invalid 
> handle was specified.
> ------------------------------------------------------------------------------
> Call Stack:
> ------------------------------------------------------------------------------
>       ntdll.dll!77b6f9d2()    Unknown
>       [Frames below may be incorrect and/or missing, no symbols loaded for 
> ntdll.dll] 
>       [External Code] 
>       MyApp.exe!apache::thrift::TAutoHandle::~TAutoHandle() Line 83   C++
>       [External Code] 
> >     
> > MyApp.exe!apache::thrift::transport::TWaitableNamedPipeImpl::beginAsyncRead(unsigned
> >  char * buf, unsigned int len) Line 149     C++
>       
> MyApp.exe!apache::thrift::transport::TWaitableNamedPipeImpl::TWaitableNamedPipeImpl(void
>  * pipehandle) Line 108 C++
>       MyApp.exe!apache::thrift::transport::TPipe::TPipe(void * Pipe) Line 239 
> C++
>       MyApp.exe!apache::thrift::transport::TNamedPipeServer::acceptImpl() 
> Line 307    C++
>       MyApp.exe!apache::thrift::transport::TPipeServer::acceptImpl() Line 215 
> C++
>       MyApp.exe!apache::thrift::transport::TServerTransport::accept() Line 57 
> C++
>       MyApp.exe!apache::thrift::server::TThreadedServer::serve() Line 159     
> C++
>       MyApp.exe!thriftServerFunc() Line 87    C++
>       MyApp.exe!boost::detail::thread_data<void (__cdecl*)(void)>::run() Line 
> 117     C++
>       MyApp.exe!boost::`anonymous namespace'::thread_start_function(void * 
> param) Line 217    C++
>       [External Code] 
> ------------------------------------------------------------------------------
> The exception is thrown in TPipe.cpp, with readOverlap_.success = FALSE and 
> readOverlap_.last_error = 6 (ERROR_INVALID_HANDLE).
> ------------------------------------------------------------------------------
> void TWaitableNamedPipeImpl::beginAsyncRead(uint8_t* buf, uint32_t len)
> {
>   begin_unread_idx_ = end_unread_idx_ = 0;
>   readOverlap_.reset(buf, len, ready_event_.h);
>   thread_->addWorkItem(&readOverlap_);
>   if(readOverlap_.success == FALSE && readOverlap_.last_error != 
> ERROR_IO_PENDING)
>   {
>     GlobalOutput.perror("TPipe ::ReadFile errored GLE=", 
> readOverlap_.last_error);
>     throw TTransportException(TTransportException::UNKNOWN, "TPipe: ReadFile 
> failed");
>   }
> }
> ------------------------------------------------------------------------------



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

Reply via email to