From nobody Fri Dec 20 10:37:20 2024 X-Original-To: emulation@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 4YF3lG3Krzz5hlRr for ; Fri, 20 Dec 2024 10:37:30 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YF3lG20Shz4STG for ; Fri, 20 Dec 2024 10:37:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734691050; 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: in-reply-to:in-reply-to:references:references; bh=oAYZ3R2sdhi7ge3mZGPdtIrJSV1Fu+R1Os2HsyGvd8c=; b=CBvx50SizbB5mSQPhGZ2TDaOUIUII6kW/XZV8SJGJkA0XHAWV0Odwh9yUChRnllskmROVY sOBi/K/oQK5+1HkajMhQz01uuvAhzwiBbd/e9zhibTTeOiNWYo+6N2gQuECSs2ZN4CbcW4 WFu1Z3aiVRg5RYG9o6rGM8hGXf6QQ1wKYgPGg7be7HjFSNM9SvqkJIQ0aMr3ttOAsK4zp2 pjFcEvRIODQDTByE76Udf/6x4YXD3PcvEqMmX5gJ1fOrmObSSIzU+AdVZcoTAHXrfkNhcl oeRqq3gl4EFborYEpGyWj887jbC/28WnhOSPRFMh/Q2IU0vvPG2J6S2JLDw0/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734691050; a=rsa-sha256; cv=none; b=O75b0XagOfJlo1BVinRJ0bUyBruA7N5BVTPTNaHarQbHC8LD6lG8JI3XhmvRwZmhb8Xkqx IO399+sGMgqtJqazrPVz8iB21/SKzZo8lmw/RCSBTkttnp0NG6zrWE5QNIMsUsMDFxhHly UDd5wjcR1ZOv7EXo2Hbq3KRKlYdxA21gx9M9c0s3oeeeTfj38VVHMBOaGqwtrptCZ1g15f adFOJxX5DDzdDfy3RK4F+KBYo0nLEzxNtntqXVZtm/2Cz4/cc0b4UdoMEnYsYZYgi6B0JX uaztQrHmIQHv6qT2j/3i9dSx76aXVO/CXD9FCBDLZp5HO9PZnhoHR0ouyG4xmg== 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 4YF3lG1JkKzb3k for ; Fri, 20 Dec 2024 10:37:30 +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 4BKAbUsh097937 for ; Fri, 20 Dec 2024 10:37:30 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4BKAbU5v097936 for emulation@FreeBSD.org; Fri, 20 Dec 2024 10:37:30 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: emulation@FreeBSD.org Subject: [Bug 271146] emulators/virtualbox-ose{-*}: update to 7.1.4 Date: Fri, 20 Dec 2024 10:37:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: needs-patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: bugs@rufus.in-berlin.de X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: vbox@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Development of Emulators of other operating systems List-Archive: https://lists.freebsd.org/archives/freebsd-emulation List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-emulation@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271146 --- Comment #46 from Frank Reisert --- Status: no progress. I'm still stuck at the same point only a wee bit wise= r. It all happens in file src/VBox/Runtime/common/ldr/ldrELFRelocateble.cpp.h = in function RTLDRELF_NAME(RelocateSectionRel). From extended logging I can ta= ke these numbers: Value=3D000001ff1b262c95 SymValue=3Dffffffff82862ca0 *pAddrW=3D0347f6c31b262c95 (int32_t)Value=3D455486613 *(int32_t *)pAddrW=3D455486613 (Elf_Addr)*(int32_t *)pAddrw=3D000000001b262c95 Now, (Elf_Addr)*(int32_t *)pAddrw should be equal to Value, which it isn't.= =20=20 Value is being calculated from SymValue, BaseAddr, SecAddr, paRels[iRel].r_offset and paRels[iRel].r_addend. The latter two are being = read from the ELF headers of VMMR0.r0 (at least I think so). BaseAddr is the ba= se address which the module is being fixedup to. SecAddr is the section addre= ss.=20 This is the address the relocations are relative to. Which leaves me with SymValue which in turn brings me (via RTLDRELF_NAME(Symbol)) to pfnGetImpo= rt.=20 pfnGetImport is a function pointer which I cannot resolve because I'm not a= ble to follow the chain of functions up to the point where a function is called with the respective function pointer as argument. So I can't tell where SymValue originates from. Is it being miscalculated, then why? Is it read from somewhere in VMMR0.r0? If so, where and what's wrong there and why? All I can say is that '$ readelf -a VMMR0.r0' doesn't give me a match to "ffffffff82862ca0" or even "82862ca0". At this point I won't ask upstream for help because I can't rule out llvm/ld/the_whole_shebang as the cause of this. If anybody can, please step in! Just to see how it would play out, I've tried to build VBox with gcc which opened another whole can of worms. So I've abandoned this idea. regards -Frank PS: below are copied the corresponding lines from ldrELFRelocateble.cpp.h: static int RTLDRELF_NAME(RelocateSectionRel)(PRTLDRMODELF pModElf, Elf_Addr BaseAddr, PFNRTLDRIMPORT pfnGetImport, void *pvUser, const Elf_Addr SecAddr, Elf_Size cbSec, const uint8_t *pu8SecBaseR, uint8_t *pu8SecBaseW, const void *pvRelocs, Elf_Size cbRelocs) { ... const Elf_Reloc *paRels =3D (const Elf_Reloc *)pvRelocs; Elf_Addr SymValue =3D 0; int rc =3D RTLDRELF_NAME(Symbol)(pModElf, BaseAddr, pfnGetImport, pvUser,ELF_R_SYM(paRels[iRel].r_info), &pSym, &SymValue); const Elf_Addr SourceAddr =3D SecAddr + paRels[iRel].r_offset + BaseAddr; const Elf_Addr Value =3D SymValue + paRels[iRel].r_addend - SourceAddr; *(int32_t *)pAddrW =3D (int32_t)Value; AssertMsgReturn((Elf_Addr)*(int32_t *)pAddrW =3D=3D Value, ("Value=3D" FMT_= ELF_ADDR "\n", Value), VERR_SYMBOL_VALUE_TOO_BIG); ... } static int RTLDRELF_NAME(Symbol)(PRTLDRMODELF pModElf, Elf_Addr BaseAddr, PFNRTLDRIMPORT pfnGetImport, void *pvUser, Elf_Size iSym, const Elf_Sym **ppSym, Elf_Addr *pSymValue) { ... int rc =3D pfnGetImport(&pModElf->Core, "", pszName, ~0U, &Value, pvUser); *pSymValue =3D (Elf_Addr)Value; ... } --=20 You are receiving this mail because: You are on the CC list for the bug.=