From nobody Mon Dec 15 02:04:44 2025 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dV3KT1016z6K1pX for ; Mon, 15 Dec 2025 02:04:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dV3KT0Btlz446g for ; Mon, 15 Dec 2025 02:04:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765764285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YCVBHptowuSCo4U1/As5dwHIjLm9jX+2asAqxE4Zm3Y=; b=wmd3jYB1q7wZ7cmB79rw4aM9kL5d/9nvMSYGDrHy+R4sipDiFhaZ3xxKTnMP1RDKVuIx6J O0d/bzYYSSpSPPja6YC87xXW3f+s4j1zyLocPMAbdCInEUVYVOmKirFJdQjDQ8E4OqCJdm VcFtXgx4QS2i1UmoKMYOfYqoItozX/KMWwbhhbmHGvh/YLrOoVLDRmaOqDS+Uqc+u5cvCH zcWU1Ff3fMCxBiEndVkFzudOmrQJ17pvhZsSPcg/8snmaI85ZbwW0o7xwPgj7jbYvt8EnX 0ybhnMKrDQMCqQ9rrL+17BuMyjtk9aeDfBPLfRWG2xO0gLUqnr6PwCuAmYkiVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765764285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YCVBHptowuSCo4U1/As5dwHIjLm9jX+2asAqxE4Zm3Y=; b=YcZS2Lmk4YiGadK2RrAaMX8JcbPjTLklq/pFf6FxZWsmJIc9HGChzauj/cp2wdZ67wYq3P N9Cm6aWtu63EZ2W3XJWjPIfQxgDnShvkJAJzQ+Q1m7ti0hUmKyZO8LoRiMay/QrZsP5DQd h6Sk2f8/s83HoMFCSFE8u8mNe21feBB9BFJn6SNgAhbqUyB+SDS2U+JC2D92JrBH0zUTIA pXv/1U60D3ydHON7UbqSqEas7AFBObPzJ2afKMI4MKRyaaFd6cwBQ/8MWYsfv/POL2vaVT /iRNEIXEApnq+0TYHTJwdyxmCObjVFFko9n2eJap2O22ws6VI5Kf8GbHuJ1oSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765764285; a=rsa-sha256; cv=none; b=J/Ujc16Gl2IK8o1mc9YNZQUJYz1oUceVdNLlbAK1c6MNDcqSnNPTaCewEB97hzfQlGJ/sP oRMdNt5R6t4e1ZpHHNKCBxYvOV6O9j7LMyJwfGr1bjT+kOuXQABp5ixVvcJC45cvmJ3Wpk 3B0Tgz8D8ttzBEJoZeTBxCAp45M2X/Yt2dJ3QkXhbfBpHWukeFJK/GfLEutyu0hSX2hi6X 78RO7DHd3aC1ZK/SgRvf8XxSi0i86EzlmrO+ntVZs++F2M1oXzIyNk8Igs/qwX/XFlsL5n Qz6GG8gEo6oSeDtc4unbDbjhFBkYANPDu7bDNDuEj/WsBWxr8/9oVKNu+wfVag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4dV3KS6NJzz10Wc for ; Mon, 15 Dec 2025 02:04:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 5BF24igW074070 for ; Mon, 15 Dec 2025 02:04:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 5BF24id2074069 for bugs@FreeBSD.org; Mon, 15 Dec 2025 02:04:44 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 291677] FreeBSD 15.0 realloc does not set errno for large size values Date: Mon, 15 Dec 2025 02:04:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: collin.funk1@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D291677 Bug ID: 291677 Summary: FreeBSD 15.0 realloc does not set errno for large size values Product: Base System Version: 15.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: collin.funk1@gmail.com Using the following test program: ``` $ cat main.c=20 #include #include #include #include int main (int argc, char *argv[]) { errno =3D 1729; void *p =3D malloc (1); printf ("p =3D 0x%jx, errno =3D %d\n", (uintmax_t) p, errno); p =3D realloc (p, PTRDIFF_MAX); printf ("p =3D 0x%jx, errno =3D %d\n", (uintmax_t) p, errno); } ``` Here is the output on FreeBSD 14.3: ``` $ uname -r && cc main.c && ./a.out=20 14.3-RELEASE-p5 p =3D 0x2bf54fe08008, errno =3D 1729 p =3D 0x0, errno =3D 12 ``` Here is the output on FreeBSD 15.0: ``` $ uname -r && cc main.c && ./a.out=20 15.0-RELEASE p =3D 0x1b6e8dc08000, errno =3D 1729 p =3D 0x0, errno =3D 1729 ``` So for large size values on FreeBSD 15.0 `realloc` fails but does not set `errno` to `ENOMEM` like FreeBSD 14.3. This was found in the Gnulib test suite by Bruno Haible [1]. He wrote: > The reason is that realloc (p, size) sets errno when failing only when > size <=3D 0x700000000000000; it leaves errno untouched if > size > 0x700000000000000. [1] https://lists.gnu.org/archive/html/bug-gnulib/2025-12/msg00021.html --=20 You are receiving this mail because: You are the assignee for the bug.=