From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 80A9A158041 for ; Fri, 8 Mar 2024 19:23:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D0EBFE2A00; Fri, 8 Mar 2024 19:22:56 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BB28AE2A00 for ; Fri, 8 Mar 2024 19:22:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0C4B133BEBE for ; Fri, 8 Mar 2024 19:22:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3ECEA14FC for ; Fri, 8 Mar 2024 19:22:52 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1709925725.d49991905031dbe78494f500730da8a43cd2763c.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/files/, dev-util/hip/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch dev-util/hip/hip-5.7.1-r2.ebuild X-VCS-Directories: dev-util/hip/files/ dev-util/hip/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: d49991905031dbe78494f500730da8a43cd2763c X-VCS-Branch: master Date: Fri, 8 Mar 2024 19:22:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a4be142f-c238-4c59-bf84-019677fc12b5 X-Archives-Hash: 1a3af71c38d5680872bbff36853f45c8 commit: d49991905031dbe78494f500730da8a43cd2763c Author: Sv. Lockal gmail com> AuthorDate: Sat Jan 20 15:25:20 2024 +0000 Commit: Sam James gentoo org> CommitDate: Fri Mar 8 19:22:05 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4999190 dev-util/hip: add backported fix for OOM check Fixes failure of oidnTest from media-libs/oidn with HIP from https://github.com/gentoo/gentoo/pull/34869 Signed-off-by: Sv. Lockal gmail.com> Signed-off-by: Sam James gentoo.org> .../hip/files/hip-5.7.1-fix-mmap-oom-check.patch | 41 ++++++++++++++++++++++ dev-util/hip/hip-5.7.1-r2.ebuild | 1 + 2 files changed, 42 insertions(+) diff --git a/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch b/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch new file mode 100644 index 000000000000..dbafe4e11a74 --- /dev/null +++ b/dev-util/hip/files/hip-5.7.1-fix-mmap-oom-check.patch @@ -0,0 +1,41 @@ +Backport of SWDEV-417691 - Error handling for MemoryMap OS calls. +The issue was fixed in rocclr 6.0.0. +https://github.com/ROCm/clr/commit/7a10423a44b8b353f67539dc1ae14c0b99c209b8 +--- a/rocclr/os/os_posix.cpp ++++ b/rocclr/os/os_posix.cpp +@@ -214,7 +214,7 @@ address Os::reserveMemory(address start, size_t size, size_t alignment, MemProt + MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS, 0, 0); + + // check for out of memory +- if (mem == NULL) return NULL; ++ if (mem == MAP_FAILED) return NULL; + + address aligned = alignUp(mem, alignment); + +@@ -842,7 +842,7 @@ bool Os::MemoryMapFileDesc(FileDesc fdesc, size_t fsize, size_t foffset, const v + } + + *mmap_ptr = mmap(NULL, fsize, PROT_READ, MAP_SHARED, fdesc, foffset); +- return true; ++ return (*mmap_ptr == MAP_FAILED) ? false : true; + } + + bool Os::MemoryUnmapFile(const void* mmap_ptr, size_t mmap_size) { +@@ -874,7 +874,7 @@ bool Os::MemoryMapFile(const char* fname, const void** mmap_ptr, size_t* mmap_si + + close(fd); + +- if (*mmap_ptr == nullptr) { ++ if (*mmap_ptr == MAP_FAILED) { + return false; + } + +@@ -899,7 +899,7 @@ bool Os::MemoryMapFileTruncated(const char* fname, const void** mmap_ptr, size_t + + close(fd); + +- if (*mmap_ptr == nullptr) { ++ if (*mmap_ptr == MAP_FAILED) { + return false; + } + \ No newline at end of file diff --git a/dev-util/hip/hip-5.7.1-r2.ebuild b/dev-util/hip/hip-5.7.1-r2.ebuild index f91ef2a7083c..034378272f53 100644 --- a/dev-util/hip/hip-5.7.1-r2.ebuild +++ b/dev-util/hip/hip-5.7.1-r2.ebuild @@ -47,6 +47,7 @@ PATCHES=( "${FILESDIR}/${PN}-5.7.1-disable-stack-protector.patch" "${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch" "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch" + "${FILESDIR}/${PN}-5.7.1-fix-mmap-oom-check.patch" ) S="${WORKDIR}/clr-rocm-${PV}/"