On Wed, 7 Jan 2026 11:44:24 GMT, Martin Doerr <[email protected]> wrote:

>> \What happens if you create a user on AIX with a uid bigger than 2^31 and 
>> call `getpwuid_r` on it (by hardcoding `tmpUid` as a negative number)?
>
> I haven't tried (not my machine), but it's undefined behavior. There's no 
> guarantee that `getpwuid_r` does what we expect. We should never use 
> undefined behavior. Also note that not only AIX is affected.

> It's unfortunate that the FFM doesn't provide a good abstraction for passing 
> `uint32_t`. Maybe we should implement an enhancement?

Indeed, the status quo with respect to unsigned values passed to downcalls is a 
bit suboptimal, esp. in certain ABIs where sign/zero extension is required. 
This is tracked here:

https://bugs.openjdk.org/browse/JDK-8336664

(apologies -- this link was already shared by @dmlloyd )

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28931#discussion_r2668596071

Reply via email to