From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AA3343858417; Tue, 19 Dec 2023 17:18:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA3343858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703006288; bh=jSXZ6QT5XQMNHmd81EXzKNuEGWyiFxljSmSYixbUZL8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CPCHm+rftFC2ERmJmBJXxIMjwALllQKHneBzqijMpysGPnShrKIkxx4prDVogny3Q fkSxe+RXzFhO1HmLEOl7fkC34FGIKGt6OSxM6Yny1rloFK11u5OHMQB211U7EscaVD 1VLFo6e3xZpASBRCtxNtAgpKGE+PG6H1Di0ge7t8= From: "mark at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113045] armv7l-unknown-linux-gnueabihf: valgrind error during build of libcc1 Date: Tue, 19 Dec 2023 17:18:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113045 --- Comment #19 from Mark Wielaard --- (In reply to David Binderman from comment #18) > (In reply to Mark Wielaard from comment #17) > > I am surprised valgrind memcheck doesn't produce more output, normally = it > > would tell you why & where it found the address invalid.=20 >=20 > The valgrind output I gave originally looks to be in the usual valgrind > format to me. > Perhaps you are assuming some other debugging tool like asan or ubsan ? Normally valgrind adds something like: Address 0xaaaaaa is x bytes inside a block of size y free'd please a stacktrace where that block was allocated/freed In this case I would expect to say something like that the address that is being access is after a block. Assuming it is indeed not accessible. The read of 4 bytes is interesting, it seems to mean that valgrind decided = to chop up this read into smaller blocks. > > I assume somehow > > valgrind memcheck believes it is reading past the end of a data buffer, > > while the code assumes this is fine because it will mask off the bits it > > won't use. >=20 > valgrind doesn't normally produce an error for copying around un-initiali= sed > bytes. >=20 > However, it will produce an error if those bytes are used in a decision > like an if statement. Or it will produce an error if it is an unaddressible location. Which seems= to be the case here. I would try to figure out which address exactly it is, what the exact arm/n= eon (?) instruction it is that is being executed. How many bytes it is supposed= to read and if that many bytes are actually available. If this is an overread then you might try --partial-loads-ok=3Dyes (althoug= h that should be the default these days). If that doesn't work then valgrind might have chopped up the read into smaller blocks, so memcheck cannot see that i= t is a larger load and the backend (VEX/priv/guest_arm_toIR.c) might have to be adjusted.=