Peace C created THRIFT-2525:
-------------------------------

             Summary: 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.

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