From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29782 invoked by alias); 3 Feb 2013 00:10:38 -0000 Received: (qmail 29518 invoked by uid 48); 3 Feb 2013 00:10:13 -0000 From: "howarth at nitro dot med.uc.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/55617] static constructors are not being instrumented correctly on darwin Date: Sun, 03 Feb 2013 00:10: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: howarth at nitro dot med.uc.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-02/txt/msg00164.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55617 --- Comment #46 from Jack Howarth 2013-02-03 00:10:02 UTC --- (In reply to comment #40) Also with the patch in Comment 42, the failing test case converted into a shared library loaded via dlopen works fine... % cat libcov.C struct c18 { virtual void bar() { } }; c18 ret; % cat covmain_dl.C #include #include #include int main () { void *lib_handle; lib_handle = dlopen("./libcov.dylib", RTLD_LAZY); if (!lib_handle) { fprintf(stderr, "%s\n", dlerror()); exit(1); } dlclose(lib_handle); } % ./dist/bin/g++-fsf-4.8 -shared -fsanitize=address covmain_dl.C % ./dist/bin/g++-fsf-4.8 -fsanitize=address covmain_dl.C % ./a.out % This also works for a libcov.C compiled into a shared module loaded in covmain_dl.C as libcov.so... % ./dist/bin/g++-fsf-4.8 -bundle -fsanitize=address -o libcov.so libcov.C % ./dist/bin/g++-fsf-4.8 -fsanitize=address covmain_dl.C % a.out %