From nobody Fri Sep 17 10:41:42 2021 X-Original-To: ports-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 9359E17D1DF3 for ; Fri, 17 Sep 2021 10:41:42 +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 4H9r9L3X8Xz51Nf for ; Fri, 17 Sep 2021 10:41:42 +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 5B1B313A43 for ; Fri, 17 Sep 2021 10:41:42 +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 18HAfg2r040783 for ; Fri, 17 Sep 2021 10:41:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 18HAfgpo040782 for ports-bugs@FreeBSD.org; Fri, 17 Sep 2021 10:41:42 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: ports-bugs@FreeBSD.org Subject: [Bug 258556] devel/llvm12: overwriting static memory Date: Fri, 17 Sep 2021 10:41:42 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dinoex@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: brooks@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name 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: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258556 Bug ID: 258556 Summary: devel/llvm12: overwriting static memory Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: brooks@FreeBSD.org Reporter: dinoex@FreeBSD.org Assignee: brooks@FreeBSD.org Flags: maintainer-feedback?(brooks@FreeBSD.org) With OpenSSL from ports I build a new version of tinyfuge (5.1.1): Sources: https://github.com/ingwarsw/tinyfugue The compiled code fails on starting the SSL connection. Output: % Trying to connect to ap: XXXX:f840::42 8889. % SSL: cert verify depth exceeded: allowed=3D0 actual=3D2 % SSL: cert verify error: err=3D22 'certificate chain too long' depth:2 cn:/C=3DUS/O=3DInternet Security Research Group/CN=3DISRG Root X1 % Intermediate connection to ap failed: SSL/lib: error:1416F086:SSL While debugging with gcc the static memory of the application gets overwrit= ten. ssl_options is overwritten with bad data. The code of the application seems fine, -Wall does not show any hints. Once I enabled "-g" in CFLAGS the application runs. Output: % Trying to connect to ap: XXXX:f840::42 8889. % SSL: chain: depth:2 cn:/C=3DUS/O=3DInternet Security Research Group/CN=3D= ISRG Root X1 % SSL: chain: depth:1 cn:/C=3DUS/O=3DLet's Encrypt/CN=3DR3 % SSL: chain: depth:0 cn:/CN=3Dap.XXXX.org % SSL: cert verified: OK ret=3D0 % Connected to ap using cipher TLS_AES_256_GCM_SHA384. I tested a few compilers: clang version 10.0.1 (base) clang version 12.0.1 (devel/llvm12) gcc10 (FreeBSD Ports Collection) 10.3.0 The Problem happens with: clang clang12 clang -O1 clang12 -O1 The application runs with: clang -g clang -O0 clang12 -O0 gcc10 -O2 gcc10 -O3 The structure on FreeBSD 12.2 has an address of: 0x7fffffffe4c0 (fail) 0x7fffffffe340 (ok) I guess there is something going wrong with the memory mapping. --=20 You are receiving this mail because: You are the assignee for the bug.=