From nobody Sun Nov 13 22:21:34 2022 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 4N9Rk66BH3z4hJGG for ; Sun, 13 Nov 2022 22:21:34 +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 4N9Rk63P71z3NMD for ; Sun, 13 Nov 2022 22:21:34 +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=1668378094; 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=d6Z11HNezd3ytO4BqHt1TPVdMu7QOinejH1UzBMrWh0=; b=SYW9ggqoUFNlSVn5Yl8TBBV7sIY8oiCQ0ErRjq6/IWpOF1Nt+bIAEwd/GQXSDFlL1qrdu6 b+JTh38ATbGlRJc9ZgyoH95X37cxt0JkIiBfoRSBtNll0f+n+nM/ClHggPcfw4FZzug+XZ jvSuNVKNaMUGR9GpnTubPPpakH6GNpl/6KmzPSR5PTlBq9pba+pfw7unWJXxCUDgBiuMl5 Ez0s4rUacJ0B+p9phf7pdA4J+1GLegPpsqdnfXDPhFGyOEVAizwJgCqSyvle11rjXwVihc uP82GOPqKNT1FyitWxnzHYSbMxPoMyt2HXA1/aORywW4yilKERhWp275SJKwLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668378094; a=rsa-sha256; cv=none; b=rRp/wJ02rk2PYY1HG01mbN/VUciKktnHLeDgBeQ5gYGFWYFAdgcMeLgc6Z8ZrAbeXWtNkS UjH719gj/lNGuaoys0s+KZsNo5Q3Wc4tKM7GU88JWbddBf/6XQalOhUiuNKyvcSiF5swXh Ux20rN77oOa3lV2UtVijHZura+tLNcaifwlU27g53k8JV2KoCb8RclQTN3KouzG2BekLUW SKu+a3Zlth+gJJvXpRajkMXrrdHH9HFpJ7CUg+0UTjnyb5stO7QOiSx+FPUZiDTk8QZ/w7 LjvIunBF/pKxmvB4qLntKXNLbOw/4HaTSb5x4EsABlvW8FuchfF1i0ClZ3hVOA== 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 4N9Rk62SBSzJQC for ; Sun, 13 Nov 2022 22:21:34 +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 2ADMLYOd093692 for ; Sun, 13 Nov 2022 22:21:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2ADMLY4f093691 for ports-bugs@FreeBSD.org; Sun, 13 Nov 2022 22:21:34 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 267752] devel/valgrind: Valgrind fails on programs compiled with -fsanitize=address Date: Sun, 13 Nov 2022 22:21:34 +0000 X-Bugzilla-Reason: AssignedTo 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: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pjfloyd@wanadoo.fr X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback+ 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: 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=3D267752 --- Comment #4 from Paul Floyd --- 'valgrind' is just a small exe. It modifies the environment to add some LD_PRELOADs and adds an env var called VALGRIND_LAUNCHER. Then it execs the tool (memcheck-amd64-freebsd for instance). The tool code that fails is VG_(debugLog)(1, "main", "Getting launcher's name ...\n"); VG_(name_of_launcher) =3D VG_(getenv)(VALGRIND_LAUNCHER); if (VG_(name_of_launcher) =3D=3D NULL) { VG_(printf)("valgrind: You cannot run '%s' directly.\n", argv[0]); VG_(printf)("valgrind: You should use $prefix/bin/valgrind.\n"); VG_(exit)(1); } And here is the launcher code /* Figure out the name of this executable (viz, the launcher), so we can tell stage2. stage2 will use the name for recursive invocations of valgrind on child processes. */ memset(launcher_name, 0, PATH_MAX+1); oid[0] =3D CTL_KERN; oid[1] =3D KERN_PROC; oid[2] =3D KERN_PROC_PATHNAME; oid[3] =3D getpid(); len =3D PATH_MAX; r =3D sysctl(oid, 4, launcher_name, &len, 0, 0); if (r !=3D 0) { fprintf(stderr, "valgrind: warning (non-fatal): " "sysctl(\"kern.proc.pathname\") failed.\n"); fprintf(stderr, "valgrind: continuing, however --trace-children=3Dyes= " "will not work.\n"); } /* tediously augment the env: VALGRIND_LAUNCHER=3Dlauncher_name */ new_line =3D malloc(strlen(VALGRIND_LAUNCHER) + 1 + strlen(launcher_name) + 1); if (new_line =3D=3D NULL) barf("malloc of new_line failed."); strcpy(new_line, VALGRIND_LAUNCHER); strcat(new_line, "=3D"); strcat(new_line, launcher_name); for (j =3D 0; envp[j]; j++) ; new_env =3D malloc((j+2) * sizeof(char*)); Does your exe run a bit and then fork/exec? You you set --trace-children=3Dyes (in your valgrind ini file)? I don't know how the sanitized exe is interfering with this, it is all well before the guest even gets loaded. Either the sysctl isn't working correctl= y or the env var is getting corrupted. --=20 You are receiving this mail because: You are the assignee for the bug.=