From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86663 invoked by alias); 21 Jun 2018 07:58:07 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 86598 invoked by uid 89); 21 Jun 2018 07:58:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lf0-f65.google.com Received: from mail-lf0-f65.google.com (HELO mail-lf0-f65.google.com) (209.85.215.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Jun 2018 07:58:01 +0000 Received: by mail-lf0-f65.google.com with SMTP id n24-v6so3326869lfh.3; Thu, 21 Jun 2018 00:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kEa6Nslliovc5lKznaVZ36AI+tpeJDj6gXFDQ3ijyBc=; b=Q55TadUJitPanrls+tPkFtfMe7HilcExyCZ6cqSGtyPyyXMZSYMde1pAMO8MMNsGcW x0t9AtWgvWX6aJPOCodg9s/vhKAyVA9tpwC+JD9WnN/MUgYjT4OUSZS8ZhvHJYYybkDG 6yJK+jvVO+X5yRFiftYolaZvCQanX3VRaGScrnxLzOUhcQFfCNQJEHV+RM3nIsXELpUz v9JxWBf76850pfMlIMRC9aXQbOYLj283q4CaDKCIzEAn6/ul5E8oFiiCd6T+rsW8ve4k kXWGec+sE6RoL8mYotHg18HcufiWOw4D9QyUzT4lcFG1ykfi7N1ogIcKX/lUeYybBuct 5B/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kEa6Nslliovc5lKznaVZ36AI+tpeJDj6gXFDQ3ijyBc=; b=Nt5ABi/SB1mH9GOUoJ+QiPID1/OGIl6IEpeL0Zmb6wVY0fKVbF50ipBEBeh+Yr/7ns C34I6KvmnK7XK2CKH3RELSjutkzbzPd3vziaEC0EuvzOu1KBHjpqYnVExrzH+IcO3s+t VXU4QPFR16A6ruWIkM+4Z0yxw3yPNtt46pBzTh0RLqaClQ6uN5Yax8NcDFyeu3shM7jk 1HdwNyIxHMYSvvz0ADIuXwFiua5rOgRin9cJaQLlCkA8tulVbJKQxibw4iqL8oyX1Ieb je5uiRE89nR76pogA3Tu2bk+xz4w22DUykxfZlQoebsxlBItNNM2EzYlioh/dZay5u/H a2gg== X-Gm-Message-State: APt69E0uC9N952FSBNwVDOxa0AKCn7Wwori+Wt/wmIrRQjeW0JhXAZ8T 1Tqkr/voXBUclKmYNUyXnNLWEfiDG4kpw9nqKrDyEw== X-Google-Smtp-Source: ADUXVKKFK9oaR7Zww6r80o6C4vw2K4/E0wFhqnf4eohBYW9doz3CYpRAqK7939i1GlhdEsxswvWfN/2POa+iVBoa+z8= X-Received: by 2002:a19:9486:: with SMTP id o6-v6mr7480290lfk.38.1529567879463; Thu, 21 Jun 2018 00:57:59 -0700 (PDT) MIME-Version: 1.0 References: <1b1d2bd3-3536-5525-1660-09a7b18a9ecd@gmail.com> <1529538619-47020-1-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1529538619-47020-1-git-send-email-dmalcolm@redhat.com> From: Richard Biener Date: Mon, 01 Jan 2018 00:00:00 -0000 Message-ID: Subject: Re: [PATCH] Fix IPA crash in libgccjit To: David Malcolm Cc: GCC Patches , jit@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-q2/txt/msg00007.txt.bz2 On Thu, Jun 21, 2018 at 1:07 AM David Malcolm wrote: > > All/most of the jit.dg testcases are segfaulting on cleanup of > the 2nd in-process iteration: > > PATH=.:$PATH LD_LIBRARY_PATH=. LIBRARY_PATH=. \ > gdb --args \ > testsuite/jit/test-factorial.c.exe > > Starting program: /home/david/coding-3/gcc-git-static-analysis/build/gcc/testsuite/jit/test-factorial.c.exe > PASSED: test-factorial.c.exe iteration 1 of 5: set_up_logging: logfile is non-null > NOTE: test-factorial.c.exe iteration 1 of 5: writing reproducer to /home/david/coding-3/gcc-git-static-analysis/build/gcc/testsuite/jit/test-factorial.c.exe.reproducer.c > Detaching after fork from child process 35787. > Detaching after fork from child process 35789. > PASSED: test-factorial.c.exe iteration 1 of 5: verify_code: result is non-null > PASSED: test-factorial.c.exe iteration 1 of 5: verify_code: my_factorial is non-null > NOTE: my_factorial returned: 3628800 > PASSED: test-factorial.c.exe iteration 1 of 5: verify_code: actual: val == expected: 3628800 > PASSED: test-factorial.c.exe iteration 2 of 5: set_up_logging: logfile is non-null > NOTE: test-factorial.c.exe iteration 2 of 5: writing reproducer to /home/david/coding-3/gcc-git-static-analysis/build/gcc/testsuite/jit/test-factorial.c.exe.reproducer.c > > Program received signal SIGSEGV, Segmentation fault. > 0x00007ffff71abc75 in ipcp_driver () at ../../src/gcc/ipa-cp.c:5091 > 5091 delete edge_clone_summaries; > > This appears to be due to recent(?) IPA changes that appear to assume > that the IPA code is only initialized and cleaned up once. > > This patch fixes the crashes: > > Changes to jit.sum > ------------------ > > FAIL: 65->0 (-65) > PASS: 3186->10290 (+7104) > UNRESOLVED: 1->0 (-1) > > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. > > OK for trunk? OK. RIchard. > gcc/ChangeLog: > * ipa-cp.c (ipcp_driver): Set edge_clone_summaries to NULL after > deleting it. > * ipa-reference.c (ipa_reference_c_finalize): Delete > ipa_ref_opt_sum_summaries and set it to NULL. > --- > gcc/ipa-cp.c | 1 + > gcc/ipa-reference.c | 6 ++++++ > 2 files changed, 7 insertions(+) > > diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c > index c192e84..42dd4cc 100644 > --- a/gcc/ipa-cp.c > +++ b/gcc/ipa-cp.c > @@ -5089,6 +5089,7 @@ ipcp_driver (void) > /* Free all IPCP structures. */ > free_toporder_info (&topo); > delete edge_clone_summaries; > + edge_clone_summaries = NULL; > ipa_free_all_structures_after_ipa_cp (); > if (dump_file) > fprintf (dump_file, "\nIPA constant propagation end\n"); > diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c > index 9a9e94c..43bbdae 100644 > --- a/gcc/ipa-reference.c > +++ b/gcc/ipa-reference.c > @@ -1230,6 +1230,12 @@ make_pass_ipa_reference (gcc::context *ctxt) > void > ipa_reference_c_finalize (void) > { > + if (ipa_ref_opt_sum_summaries != NULL) > + { > + delete ipa_ref_opt_sum_summaries; > + ipa_ref_opt_sum_summaries = NULL; > + } > + > if (ipa_init_p) > { > bitmap_obstack_release (&optimization_summary_obstack); > -- > 1.8.5.3 >