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

Peace C edited comment on THRIFT-2525 at 5/13/14 8:58 PM:
----------------------------------------------------------

After investigating this extensively in the debugger and applying various 
band-aids, I'm convinced that the current named pipe transport in the C++ lib 
has not been properly tested. The Visual Studio project didn't even include the 
OverlappedSubmissionThread files (THRIFT-2523) which means no one could have 
exercised its functionality.

Until the Overlapped code has been vetted, I urge the admins to revert to the 
code before Ben Craig's patches. The working versions of the following files 
are from June 2013:
TPipe.h
TPipe.cpp
TPipeServer.h
TPipeServer.cpp


PS: I very much appreciate Ben's contribution to this and hope that his code 
can be used someday.


was (Author: peace):
After investigating this extensively in the debugger and applying various 
band-aids, I'm convinced that the current named pipe transport has not been 
properly tested. The Visual Studio project didn't even include the 
OverlappedSubmissionThread files (THRIFT-2523) which means no one could have 
exercised its functionality.

Until the Overlapped code has been vetted, I urge the admins to revert to the 
code before Ben Craig's patches. The working versions of the following files 
are from June 2013:
TPipe.h
TPipe.cpp
TPipeServer.h
TPipeServer.cpp


PS: I very much appreciate Ben's contribution to this and hope that his code 
can be used someday.

> 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