Skip to content

Conversation

@larsewi
Copy link
Contributor

@larsewi larsewi commented Nov 19, 2025

Signed-off-by: Lars Erik Wik [email protected]

Signed-off-by: Lars Erik Wik <[email protected]>
On HP-UX IA-64, mixing 32-bit (%d) and 64-bit (%jd/%ju) format
specifiers in variadic arguments causes stack misalignment. In
StatFile(), cf_makeholes, cf_ino, and cf_nlink were passed as uncast
32-bit integers among 64-bit arguments, causing all subsequent values
(including cf_size) to be read from incorrect stack positions.

This resulted in the client receiving a corrupted file size value (e.g.,
212668465 instead of 821 bytes), triggering false "file corrupted in
transit" errors during file copy operations.

Fixed by casting cf_makeholes, cf_ino, and cf_nlink to (intmax_t) and
changing their format specifiers from %d to %jd, ensuring consistent
64-bit alignment for all variadic arguments after the first parameter.

Ticket: ENT-13508
Changelog: Title
Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <[email protected]>
@cf-bottom
Copy link

Thanks for submitting a PR! Maybe @craigcomstock can review this?

@larsewi larsewi closed this Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants