Return-Path: X-Original-To: apmail-thrift-dev-archive@www.apache.org Delivered-To: apmail-thrift-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89AB0D661 for ; Tue, 13 Nov 2012 19:34:13 +0000 (UTC) Received: (qmail 99674 invoked by uid 500); 13 Nov 2012 19:34:13 -0000 Delivered-To: apmail-thrift-dev-archive@thrift.apache.org Received: (qmail 99313 invoked by uid 500); 13 Nov 2012 19:34:12 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 99085 invoked by uid 99); 13 Nov 2012 19:34:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 19:34:12 +0000 Date: Tue, 13 Nov 2012 19:34:12 +0000 (UTC) From: "Peace C (JIRA)" To: dev@thrift.apache.org Message-ID: <209398530.109567.1352835252333.JavaMail.jiratomcat@arcas> In-Reply-To: <1171569390.57901.1347287047572.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (THRIFT-1690) Sockets and Pipe Handles truncated on Win64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/THRIFT-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496471#comment-13496471 ] Peace C commented on THRIFT-1690: --------------------------------- The fixes are very much appreciated. We're not building 64-bit yet but when the time comes this will be beneficial. A consequence of the restructuring (wrapping the Pipe classes with #ifdef _WIN32 and typedef'ing the name for *NIX) is that it's more difficult to implement anonymous pipes for *NIX. It'll be alot of duplicated code since all the Pipe related methods will need to be replicated for *NIX. It also makes the calling code less platform-agnostic. With these changes, the calling code can't be cross-platform for Windows & *NIX because, for example, setPipename doesn't exist in TServerSocket. You've just moved the burden of the #ifdefs from the abstract Pipe class to the calling code. That was the motivation for casting HANDLE to int and vice-versa. Perhaps we could cast between IntPtr instead? > Sockets and Pipe Handles truncated on Win64 > ------------------------------------------- > > Key: THRIFT-1690 > URL: https://issues.apache.org/jira/browse/THRIFT-1690 > Project: Thrift > Issue Type: Bug > Components: C++ - Library > Affects Versions: 0.9 > Environment: 64-bit Windows > Reporter: Ben Craig > Assignee: Roger Meier > Attachments: lib_socket_typedef.patch, libthrift_pipe_size.patch, libthrift_warning_purge.patch > > Original Estimate: 48h > Remaining Estimate: 48h > > On 64-bit Windows, "int" is a 32-bit value. SOCKET and HANDLE are 64-bit. > All of the files dealing with sockets in thrift use "int" as the type of a socket, as this is the idiomatic way to handle sockets on POSIX systems. For portability, a SOCKET typedef is probably needed. > For the Pipe Server and Pipe Transport, HANDLEs are cast to ints to store as member variables for some reason (maybe to avoid #including in a header?). > Both of these situations can result in invalid handles being used (and valid handles being leaked) when the system is under load. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira