From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6435 invoked by alias); 11 Nov 2013 05:38:40 -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 6079 invoked by uid 48); 11 Nov 2013 05:38:34 -0000 From: "y.gribov at samsung dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/59063] [4.9 Regression] ASAN: segfault in __interceptor_clock_gettime Date: Mon, 11 Nov 2013 05:38: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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: y.gribov at samsung dot com 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: cc 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: 2013-11/txt/msg01012.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59063 Yury Gribov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |y.gribov at samsung dot com --- Comment #1 from Yury Gribov --- (In reply to Joost VandeVondele from comment #0) > with -fsanitize=address the following code works on 4.8 branch bug segfaults > with 4.9 I can confirm. Here is what's happening: clock_gettime is defined in librt.so which is _not_ linked to the executable. On the other hand, libasan.so defines this symbol in sanitizer_common_interceptors.inc. This interceptor will try to call the original clock_gettime. The symbol will not be found which will result in jump to NULL. I'm not sure how to address this, perhaps we should link libasan against librt.so on Linux? I'd also suggest to make libasan issue warning in case "real" symbol obtained in GetRealFunctionAddress is NULL. This would allow us to detect errors like this faster. -Y