From nobody Sun Dec 12 19:13:03 2021 X-Original-To: toolchain@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 6163918D6EBA for ; Sun, 12 Dec 2021 19:13:03 +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 4JBvRg0nJrz3vjm for ; Sun, 12 Dec 2021 19:13:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 EFF2E2634A for ; Sun, 12 Dec 2021 19:13:02 +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 1BCJD2v1013954 for ; Sun, 12 Dec 2021 19:13:02 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1BCJD2ws013953 for toolchain@FreeBSD.org; Sun, 12 Dec 2021 19:13:02 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: toolchain@FreeBSD.org Subject: [Bug 260364] Toolchain creates the shared library that SEGVs on load: Invalid permissions for mapped object. Date: Sun, 12 Dec 2021 19:13:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: marklmi26-fbsd@yahoo.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Maintenance of FreeBSD s integrated toolchain List-Archive: https://lists.freebsd.org/archives/freebsd-toolchain List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639336383; 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=CePb+n/jx/hYyO/t5qTA06TRkARHubYFAXHibnKI678=; b=DIL+4JaqxR1mKLdXx8ttSSd3822gIvKgdOiUZqA7ylkZOF3hLT5nG5mAqmhsKMqzxDmyWk 8aU0s1sPLl3X9nXAN9YFfmcL7cVpiMNoo62Lf0xghW5cFG7P55faa9J5n6Gqj/Kd6nlh1o NzJqDvxzrGadJL1coh9cklW4sDTds9TucqkMEuRYhKWqeshUa3bLteZlad08hjUTvWnbqE tGzWe3n0qooug/E7MEy4mTFJKyaEPkl+l4+ETnrkwo2aeg4GHX+riIq+aorO+b/gr9pvqo gL6LPIrmZB9iJqGINba+LURTxGmK8Icr/FS6WKSW7kACgYp4RinJg0eCWqt7Jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639336383; a=rsa-sha256; cv=none; b=RY2LpO5HtM0yVlkgzrgL4nj84FTVtxGxWQfRoa7hP2oW+15dOS7Vdq5okxI9ogmO69PyWo ExL1pNS6xZMPaYNn1XHpaKR/3RBUNiXOSt3+3G4WsR7XSHPdwkWQahvUjVApmPuGW2wBWD OR84/xyU8MDyWEQVF4kahvLHbQbN+PwLyX/c9/Hcgd9DvvLBMDMOVTP/1jh0S5wPRJWaeY E2Kwf2K+b++PWrkDBxsit5W1xEiJFISW77f+kal0cfZ+2YFRzOIVYYNBEoynXm42nAGJ1M cDcKBf98rtZoV5A2G/pnUrEXrtBwflrR8MQ2P//9VVsd48rcTxVd79F+H1oBwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260364 Mark Millard changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marklmi26-fbsd@yahoo.com --- Comment #5 from Mark Millard --- (In reply to Yuri Victorovich from comment #0) The backtrace shows an incoherent mix of system C++ libraries and gcc10 C++ libraries: /lib/libcxxrt.so.1 and: /usr/local/lib/gcc10/libstdc++.so.6 in use. Can show report the output of using ldd on the program that you built and also for work/stage/usr/local/lib/calf/libcalf.so ? gcc's /usr/local/lib/gcc10/libstdc++.so.6 is not designed to be used with non-gcc c++ infrastructure libraries like: /lib/libcxxrt.so.1 . Absent the ldd outputs I will show some examples of what to expect in ldd output: Because of what compilers I happen to have around I'll use gcc11 for illustration --without involving a use of dlopen. # more trivial.cpp // # c++ -v -o trival trivial.cpp int main() { } Correctly built with gcc11: # g++11 -Wl,-rpath=3D/usr/local/lib/gcc11 trivial.cpp # ldd a.out a.out: libstdc++.so.6 =3D> /usr/local/lib/gcc11/libstdc++.so.6 (0x42400000) libm.so.5 =3D> /lib/libm.so.5 (0x409a9000) libgcc_s.so.1 =3D> /usr/local/lib/gcc11/libgcc_s.so.1 (0x41072000) libc.so.7 =3D> /lib/libc.so.7 (0x43f5a000) Correctly built with system clang (main [so: 14] context): # c++ trivial.cpp # ldd a.out a.out: libc++.so.1 =3D> /usr/lib/libc++.so.1 (0x419b3000) libcxxrt.so.1 =3D> /lib/libcxxrt.so.1 (0x41c4d000) libm.so.5 =3D> /lib/libm.so.5 (0x428aa000) libc.so.7 =3D> /lib/libc.so.7 (0x43af3000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x42d20000) Note the /lib/libcxxrt.so.1 is only there for the system c++ build that uses /usr/lib/libc++.so.1 instead of using /usr/local/lib/gcc11/libstdc++.so.6. Comparing/contrasting the two there is also: /usr/local/lib/gcc11/libgcc_s.so.1 for gcc11 use vs.: /lib/libgcc_s.so.1 for system c++ use. An odd mix happens for the following incorrect build: # g++11 trivial.cpp # ldd a.out a.out: libstdc++.so.6 =3D> /usr/local/lib/gcc11/libstdc++.so.6 (0x42600000) libm.so.5 =3D> /lib/libm.so.5 (0x40c8a000) libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x419b2000) libc.so.7 =3D> /lib/libc.so.7 (0x430fe000) /usr/local/lib/gcc11/libgcc_s.so.1 should be in use when /usr/local/lib/gcc11/libstdc++.so.6 is in use. But that does not happen without the use of: -Wl,-rpath=3D/usr/local/lib/gcc11 --=20 You are receiving this mail because: You are the assignee for the bug.=