From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 50786386F020 for ; Thu, 11 Feb 2021 18:46:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 50786386F020 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-157-yISFmMArOtKOs1UGkF-a1w-1; Thu, 11 Feb 2021 13:46:11 -0500 X-MC-Unique: yISFmMArOtKOs1UGkF-a1w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 421408710E2; Thu, 11 Feb 2021 18:46:10 +0000 (UTC) Received: from t14s.localdomain (ovpn-112-59.phx2.redhat.com [10.3.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0A0F60BF1; Thu, 11 Feb 2021 18:46:09 +0000 (UTC) Message-ID: <1c6963f183cf7ee49a86f6c8139d55bfb19a8ce1.camel@redhat.com> Subject: Re: GCC GSoC 2021 - Static analyzer project From: David Malcolm To: Adharsh Kamath Cc: gcc@gcc.gnu.org Date: Thu, 11 Feb 2021 13:46:08 -0500 In-Reply-To: References: <403dd5de93ec353eaf3b2e7a1e206e6af5637544.camel@redhat.com> User-Agent: Evolution 3.38.3 (3.38.3-1.fc33) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2021 18:46:17 -0000 On Thu, 2021-02-11 at 22:35 +0530, Adharsh Kamath wrote: > Hi David, > > > Building GCC from source and stepping through it in the > > debugger would be good next steps.  You'll need plenty of disk > > space. > >  "run_checkers" is a good breakpoint to set if you're looking for > > the > > entrypoint to the analyzer. > > > > I tried this and I understood the control flow in the analyzer. > > > There's an example plugin in that patch.  The kernel source tree > > already has some plugins, so hopefully, those together give some > > pointers on how to write a "hello world" analyzer plugin that runs > > as > > part of the kernel build, which would be another next step, I > > guess. > > > > I implemented a very simple hello world plugin here - > https://github.com/adharshkamath/Hello-world-plugin. > > It just prints a Hello message while building the Linux Kernel, if > the > -fanalyzer option is enabled. I referred to the example plugin in the > static analyzer > and the plugins in the kernel source to do this. Excellent. > > See:: > >   * "How to write system-specific, static checkers in Metal" > > (Benjamin > > Chelf, Dawson R Engler, Seth Hallem), from 2002 > >   * "Checking system rules using system-specific, programmer- > > written > > compiler extensions" Proceedings of Operating Systems Design and > > Implementation (OSDI), September 2000. D. Engler, B. Chelf, A. > > Chou, > > and S. Hallem. > >   * "Using Programmer-Written Compiler Extensions to Catch Security > > Holes" (Ken Ashcraft, Dawson Engler) from 2002 > > > > These were useful and interesting to read. Thank you for suggesting > them. > Adharsh Great. I believe you're in a position to write a strong application to GSoC for yourself for this project; you're well ahead of the timeline, as I understand it: https://summerofcode.withgoogle.com/how-it-works/#timeline Dave