Re: [PATCH] Use correct type for glibc.malloc.perturb in tst-tunconf1.c

"Andreas K. Huettel" <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Organization Gentoo Linux
Message-ID <[email protected]>
Am Samstag, 11. Juli 2026, 01:35:30 Japanische Normalzeit schrieb DJ Delorie:
> Stefan Liebler <[email protected]> writes:
> > According to elf/dl-tunables.list, glibc.malloc.perturb is of type
> > int32_t (4byte) and not size_t (8byte) which was used for
> > TUNABLE_GET_FULL inside the testcase.  Therefore the correct 32bit
> > value 0x2a=42 is written to the to the wrong place and leads to the
> > comparison failure.
> 
> I'm wondering how it passed for me...  does it only show up on MSB systems?

I only saw it on s390x too.

> 
> > +  printf("perturb is %d (should be 42, from /etc)\n",
> > +	 perturb);
> 
> Do we know that %d matches int32_t on all platforms?  Or should we cast
> this to (int) ?

Best I could find in a draft of the C standard floating on the internets, 
in the section on fprintf %d is specified to be of type int.

Which is, to my best knowledge, 32bit everywhere we can run Linux.

> 
> 


-- 
PD Dr. Andreas K. Hüttel
[email protected]
Gentoo Linux developer 
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge
signature.asc (application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE-----

iQJPBAABCAA5FiEE/Rnm0xsZLuTcY+rT3CsWIV7VQSoFAmpTjuEbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJENwrFiFe1UEqodsQAM0A61MZ1BOFUC/pHj2m
9sb7YJtUdpA06v+KqJmxRsaXk0TiUpBcxGcH4kmeyBVWk7dvk+HmXSzba5centoh
k1oHJNwP+zd6m9OCAkgCPrffgV0To56EHP3jnhqGLd3N4Ar2L+NMOaHP3hrjtQuF
8dRAm4RtQGeQH3Qp/N0QRc6NkT585eWaOZFedsQyHyppFTzY78Oidtk/szMtBpaC
UNpinYrh3YTmKrrc+hz8AqLECWA9RtI1qzw30ZADLz8M+e6wt15+HfA2iVwY9Bs9
FE1EUzlBgBO3Iu46DB/nFnDJ0kyqmWWeDwSBHBlfacZPAbNY4lF1s2N5dvQkD20Z
w4jLxA82c0p1Pbyxb9yxgaXAfsmdlAv2eenhBOIkU+EnWeyTpECJmH7j0kIDoNDx
eajUBFid8LfS8RtlRSqtmKA1zkqdwMT0mbjbvFlEz9iQlqiwm1zsmGUQPAZ72q9I
EKofs3b7/QcEGVjr8h52CG5n1Ei1jGenMz/sRon7cNWcmdm3/RYYt1ES4F+WyC4F
iNQ9A/qI8jCbWmOP7CtbvcxPW2ER2Ho49pxBQlfVPsTVMdVaOhP/W603hwiUU+Ty
vDEBbrw5GaLjQ2AsdJldz8mYwj6OaIQDMztOTde0Z6O7EKfNMgNo8NL6rm+VFoWE
sYX5zDJV0jY6+spfQyZelJ02
=hkSR
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.