From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61995 invoked by alias); 2 Mar 2015 23:58:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 61930 invoked by uid 48); 2 Mar 2015 23:58:31 -0000 From: "peter at lekensteyn dot nl" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/65285] __asan_describe_address crashes when used with global variable Date: Mon, 02 Mar 2015 23:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: peter at lekensteyn dot nl X-Bugzilla-Status: UNCONFIRMED 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00228.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65285 --- Comment #5 from Peter Wu --- (In reply to Kostya Serebryany from comment #4) > I think I know what your problem is. > In C, the globals by default have common linkage and asan does not > instrument them at all and thus can not properly report them. > > Use -fno-common with C. > https://code.google.com/p/address-sanitizer/wiki/Flags That seems to work, but if the flag is not set, can't something smarter be done instead of crashing? How does your GCC behave with the test case? The sanitizer code in GCC is imported from Clang, I believe, so it probably does not crash either?