From nobody Thu Jun 06 18:51:24 2024 X-Original-To: standards@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 4VwD244dMwz5LMST for ; Thu, 06 Jun 2024 18:51:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VwD241JGxz4Yvy for ; Thu, 6 Jun 2024 18:51:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717699884; a=rsa-sha256; cv=none; b=WOCG9vcjRnqlYuu6pu6p7Ic0SxDNwXAnhHk0d9r+RjnP6JPqy+ApuUXcL52XTbjsN3/K+P YaWH3fSSsS5/8G1bYTLtIsR5OXEOhG7onXgLdSHVzZ0myuGlg9/hnz5NULzXngJk5dNuQU pK3RtjN70M6oJNpIYRS7ZiF+zOcJy9e9tCD+Uz0cu3w9te6XQsaiuKdtsEVwqCEoV13Kgg +KYTUQIyVhJPpLG58XFcv/cPOnptbi/Mr3OzKpGkC22rD7hfvqOkHv6yKT9XScMNGSZmuj 5MbIaEIdK+Zx6Uc2kjzpCmktk2BL7unbgY+93L6STP+fErEnlkWMHrhe2C6P1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717699884; 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=ZvUKGKfNt99isU623bVfuhS1oYTirCOBz9FW6+YRSU0=; b=JE9Mnn5B8ZZgKVb0OUmhZgtnUVtIp6o/MCGNq8dZSgBC8SMrYk2mO/8IHL7qBnb+8e7Z2D u4MRtJtAcQlzISxBimNNnqn2SaPPAN7O3Nlw+EN7Q70FQcRPtcA3l3X1o3uAtsJsw8dH5R E0oYu943DNDfgcsgA2RI1licUe0VuBvOq5zX0fvi5Nkm5ZugeXRjx9UZF3w73v0j3/f+I7 RA6xOOwU19jWsCq1NNZZgo9b2dcKXtT/hsZxqWBnVxualaH6OJ44e7u99e7KDAnH8R4yoc iCjMD/usQBfJi7s/S+BKoIhGJqJ0yZPYuNqv0pqwAp3bqxgfROPJsq+r7qysJw== 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 4VwD240rxlzxy4 for ; Thu, 6 Jun 2024 18:51:24 +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 456IpOZI087722 for ; Thu, 6 Jun 2024 18:51:24 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 456IpObD087721 for standards@FreeBSD.org; Thu, 6 Jun 2024 18:51:24 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: standards@FreeBSD.org Subject: [Bug 279560] FreeBSD 14.1 ships libc++ which passes wrong size to sized operator delete Date: Thu, 06 Jun 2024 18:51:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: alkondratenko@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-standards@freebsd.org Sender: owner-freebsd-standards@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279560 Bug ID: 279560 Summary: FreeBSD 14.1 ships libc++ which passes wrong size to sized operator delete Product: Base System Version: 14.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: standards Assignee: standards@FreeBSD.org Reporter: alkondratenko@gmail.com Hi. I maintain gperftools (https://github.com/gperftools/gperftools). I not= iced announcement of release of 14.1 and installed it in VM. When I run gperftoo= ls unit tests "debug" configurations pretty much ~all fail due to mismatch bet= ween requested allocation size and allocation size passed to sized delete. It should be straighforward to reproduce by simply git cloning from github = and running ./autogen.sh && ./configure && make check I don't have capacity to investigate more, but I have backtrace of allocati= on: #0 MallocBlock::Initialize (this=3Dthis@entry=3D0xc480f0, size=3Dsize@entr= y=3D25, type=3Dtype@entry=3D-21308287) at src/debugallocation.cc:382 #1 0x0000000000225e4c in MallocBlock::Allocate (size=3Dsize@entry=3D25, type=3D-21308287) at src/debugallocation.cc:560 #2 0x00000000002245d1 in DebugAllocate (size=3D25, type=3Dtype@entry=3D-21= 308287) at src/debugallocation.cc:1051 #3 0x000000000026eff4 in debug_cpp_alloc (size=3D12878064, new_type=3D-213= 08287, nothrow=3Dfalse) at src/debugallocation.cc:1220 #4 tc_new (size=3D12878064) at src/debugallocation.cc:1328 #5 0x0000000000256edd in std::__1::__libcpp_operator_new[abi:se180100](unsigned long) (__args=3D25) at /usr/include/c++/v1/new:271 #6 std::__1::__libcpp_allocate[abi:se180100](unsigned long, unsigned long) (__size=3D25, __align=3D1) at /usr/include/c++/v1/new:295 #7 std::__1::allocator::allocate[abi:se180100](unsigned long) (this=3D0x7fffffffd878, __n=3D25) at /usr/include/c++/v1/__memory/allocator= .h:125 #8 std::__1::__allocate_at_least[abi:se180100] >(std::__1::allocator&, unsigned long) (__alloc=3D..., __n=3D25) at /usr/include/c++/v1/__memory/allocate_at_least.h:55 #9 std::__1::basic_string, std::__1::allocator >::__init (this=3D0x7fffffffd878, __sz=3D23, __s=3D) at /usr/include/c++/v1/string:2212 #10 _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B8se180100= ILi0EEEPKc (this=3D0x7fffffffd878, __s=3D) at /usr/include/c++/v1/strin= g:954 #11 testing::internal::UnitTestImpl::GetTestSuite (this=3D0xc50020, test_suite_name=3D0xc4e021 "MallocExtensionTest", type_param=3D0x0, set_up_tc=3Dset_up_tc@entry=3D0x0,=20 tear_down_tc=3Dtear_down_tc@entry=3D0x0) at vendor/googletest/googletest/src/gtest.cc:5786 #12 0x000000000025d7d2 in testing::internal::UnitTestImpl::AddTestInfo (this=3D, set_up_tc=3D0x0, tear_down_tc=3D0x0, test_info=3Dtest_info@entry=3D0xc4e020) at ./vendor/googletest/googletest/src/gtest-internal-inl.h:690 #13 0x0000000000242ba3 in testing::internal::MakeAndRegisterTestInfo (test_suite_name=3D, name=3D0x209287 "Basics", type_param=3Dtype_param@entry=3D0x0,=20 value_param=3Dvalue_param@entry=3D0x0, code_location=3D..., fixture_class_id=3Dfixture_class_id@entry=3D0x4237f1 ::dummy_>, set_up_tc=3D0x0,= =20 tear_down_tc=3D0x0, factory=3D0xc4c020) at vendor/googletest/googletest/src/gtest.cc:2794 #14 0x0000000000221fdb in __cxx_global_var_init () at src/tests/malloc_extension_test.cc:47 #15 0x0000000000221fdb in _GLOBAL__sub_I_malloc_extension_test.cc () #16 0x000000080027df5d in objlist_call_init (list=3Dlist@entry=3D0x7fffffff= e9c8, lockstate=3Dlockstate@entry=3D0x7fffffffe7d8) at /usr/src/libexec/rtld-elf/rtld.c:3150 #17 0x000000080027cb89 in _rtld (sp=3D, exit_proc=3D0x7fffff= ffea40, objp=3D0x7fffffffea48) at /usr/src/libexec/rtld-elf/rtld.c:990 #18 0x0000000800279df9 in rtld_start () at /usr/src/libexec/rtld-elf/amd64/rtld_start.S:40 (we see it uses size of 25 bytes) and this is backtrace of deallocation (which passes 24 bytes): #0 0x0000000000227ecb in MallocBlock::CheckAndClear (this=3D0xc480f0, type=3D, given_size=3D24) at src/debugallocation.cc:417 #1 0x0000000000227d66 in MallocBlock::Deallocate (this=3D0x4, type=3D2, given_size=3D2138871) at src/debugallocation.cc:338 #2 0x0000000000224152 in DebugDeallocate (ptr=3D, type=3D2, given_size=3D2138871) at src/debugallocation.cc:1065 #3 0x000000000026f460 in tc_delete_sized (p=3D, size=3D) at src/debugallocation.cc:1350 #4 0x0000000000256f51 in std::__1::__libcpp_operator_delete[abi:se180100](void= *, unsigned long) (__args=3D2, __args=3D2) at /usr/include/c++/v1/new:280 #5 std::__1::__do_deallocate_handle_size[abi:se180100]<>(void*, unsigned l= ong) (__ptr=3D0x4, __size=3D2) at /usr/include/c++/v1/new:304 #6 std::__1::__libcpp_deallocate[abi:se180100](void*, unsigned long, unsig= ned long) (__ptr=3D0x4, __size=3D2, __align=3D1) at /usr/include/c++/v1/new:317 #7 std::__1::allocator::deallocate[abi:se180100](char*, unsigned lon= g) (this=3D0x7fffffffd878, __p=3D0x4 , __n=3D2) at /usr/include/c++/v1/__memory/allocator.h:139 #8 std::__1::allocator_traits >::deallocate[abi:se180100](std::__1::allocator&, char*, unsigned lon= g) (__a=3D...,=20 __p=3D0x4 , __n=3D2) at /usr/include/c++/v1/__memory/allocator_traits.h:289 #9 std::__1::basic_string, std::__1::allocator >::~basic_string (this=3D0x7fffffffd878) at /usr/include/c++/v1/string:1105 #10 testing::internal::UnitTestImpl::GetTestSuite (this=3D0xc50020, test_suite_name=3D0xc4e021 "MallocExtensionTest", type_param=3D0x0, set_up_tc=3Dset_up_tc@entry=3D0x0,=20 tear_down_tc=3Dtear_down_tc@entry=3D0x0) at vendor/googletest/googletest/src/gtest.cc:5786 #11 0x000000000025d7d2 in testing::internal::UnitTestImpl::AddTestInfo (this=3D, set_up_tc=3D0x0, tear_down_tc=3D0x0, test_info=3Dtest_info@entry=3D0xc4e020) at ./vendor/googletest/googletest/src/gtest-internal-inl.h:690 #12 0x0000000000242ba3 in testing::internal::MakeAndRegisterTestInfo (test_suite_name=3D, name=3D0x209287 "Basics", type_param=3Dtype_param@entry=3D0x0,=20 value_param=3Dvalue_param@entry=3D0x0, code_location=3D..., fixture_class_id=3Dfixture_class_id@entry=3D0x4237f1 ::dummy_>, set_up_tc=3D0x0,= =20 tear_down_tc=3D0x0, factory=3D0xc4c020) at vendor/googletest/googletest/src/gtest.cc:2794 #13 0x0000000000221fdb in __cxx_global_var_init () at src/tests/malloc_extension_test.cc:47 #14 0x0000000000221fdb in _GLOBAL__sub_I_malloc_extension_test.cc () #15 0x000000080027df5d in objlist_call_init (list=3Dlist@entry=3D0x7fffffff= e9c8, lockstate=3Dlockstate@entry=3D0x7fffffffe7d8) at /usr/src/libexec/rtld-elf/rtld.c:3150 #16 0x000000080027cb89 in _rtld (sp=3D, exit_proc=3D0x7fffff= ffea40, objp=3D0x7fffffffea48) at /usr/src/libexec/rtld-elf/rtld.c:990 #17 0x0000000800279df9 in rtld_start () at /usr/src/libexec/rtld-elf/amd64/rtld_start.S:40 Most likely, it is some sort of a bug in upstream clang's libc++ in whatever version you ship. Although it is somewhat odd, given that Google runs with sized deallocation enabled and with ~always latest clang/llvm bits, but may= be they exercise different configuration. --=20 You are receiving this mail because: You are the assignee for the bug.=