public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: Dave Korn <dave.korn.cygwin@googlemail.com>
Cc: Kai Tietz <ktietz70@googlemail.com>,
	Andrew Pinski <pinskia@gmail.com>,
	        gcc@gcc.gnu.org, java@gcc.gnu.org
Subject: Re: RFA: libjava seems to miss some files for win32
Date: Sun, 19 Jul 2009 15:23:00 -0000	[thread overview]
Message-ID: <4A633A6A.8010306@redhat.com> (raw)
In-Reply-To: <4A631FB6.1090908@gmail.com>

On 07/19/2009 02:29 PM, Dave Korn wrote:
> Kai Tietz wrote:
> 
>> There are a lot of issues about casting HANDLE values into jint types,
>> which is for x86 valid, but for x64 can lead potential to pointer
>> truncations. Those part need some review by libjava maintainers. My
>> patch simply casts those kind of pointers via __UINTPTR_TYPE__ into
>> integer scalar before casting it into jint. I put comments at those
>> places, where some rework is necessary.
> 
>   Argh.  You're replacing a bunch of warnings that draw attention to a real
> problem by a bunch of silent fixmes in the code.  That's a bit scary to me.

Me too.  That patch will not be accepted.

>> Index: gcc/libjava/gnu/java/net/natPlainSocketImplWin32.cc
>> ===================================================================
>> --- gcc.orig/libjava/gnu/java/net/natPlainSocketImplWin32.cc	2009-07-19 12:06:54.200476000 +0200
>> +++ gcc/libjava/gnu/java/net/natPlainSocketImplWin32.cc	2009-07-19 12:13:45.727476500 +0200
>> @@ -58,7 +58,8 @@
>>  
>>    // We use native_fd in place of fd here.  From leaving fd null we avoid
>>    // the double close problem in FileDescriptor.finalize.
>> -  native_fd = (jint) hSocket;
>> +  // Fixme, it isn't correct to cast a HANDLE to integer scalar here for x64
>> +  native_fd = (jint) (__UINTPTR_TYPE__) hSocket;
>>  }
> 
> 
>   Question is, can we change the sizes of the members of class objects, such
> as gnu::java::net::PlainSocketImpl::native_fd, or do these objects and their
> layout form part of an ABI, and/or do they ever get serialised?  The Java guys
> will be able to tell us.

Yes, you can change them.  Yes, they are part of an ABI.  native_fd should be
a jlong.

Andrew.

  parent reply	other threads:[~2009-07-19 15:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <90baa01f0907180506h1a58152du5d45d66628043ad9@mail.gmail.com>
2009-07-18 13:53 ` Dave Korn
2009-07-18 16:01   ` Kai Tietz
2009-07-18 17:09     ` Dave Korn
2009-07-18 17:27       ` Kai Tietz
2009-07-18 18:15         ` Dave Korn
2009-07-18 19:09           ` Andrew Haley
2009-07-18 19:19             ` Andrew Pinski
2009-07-18 19:23               ` Kai Tietz
2009-07-18 19:29                 ` Andrew Pinski
2009-07-19 11:13                   ` Kai Tietz
2009-07-19 13:16                     ` Dave Korn
2009-07-19 13:31                       ` Kai Tietz
2009-07-19 13:45                         ` Dave Korn
2009-07-19 13:55                           ` Kai Tietz
2009-07-19 14:39                             ` Dave Korn
2009-07-19 15:23                       ` Andrew Haley [this message]
2009-07-19 17:07                         ` Dave Korn
2009-07-18 19:23               ` Dave Korn
2009-07-18 19:27                 ` Kai Tietz
2009-07-18 18:27         ` Dave Korn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A633A6A.8010306@redhat.com \
    --to=aph@redhat.com \
    --cc=dave.korn.cygwin@googlemail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=java@gcc.gnu.org \
    --cc=ktietz70@googlemail.com \
    --cc=pinskia@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).