From: Thomas Schwinge <thomas@codesourcery.com>
To: David Malcolm <dmalcolm@redhat.com>
Cc: Martin Jambor <mjambor@suse.cz>, <gcc@gcc.gnu.org>
Subject: Re: GCC GSoC 2022: Call for project ideas and mentors
Date: Sun, 20 Feb 2022 12:19:18 +0100 [thread overview]
Message-ID: <875yp9pyyx.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <b00301678aff772683af92a200aa2bf96619933e.camel@redhat.com>
Hi David!
On 2022-01-07T12:41:17-0500, David Malcolm via Fortran <fortran@gcc.gnu.org> wrote:
> I'd like to (again) mentor a project relating to the GCC static
> analyzer:
> https://gcc.gnu.org/wiki/DavidMalcolm/StaticAnalyzer
>
> I've updated the analyzer task ideas on:
> https://gcc.gnu.org/wiki/SummerOfCode
> but the ideas there are suggestions
May I suggest -- and add to that page if you agree to co-mentor :-) --
another GCC static analyzer project? Responding to your initial
"RFC: Add a static analysis framework to GCC", in
<http://mid.mail-archive.com/yxfpy2wfv9hq.fsf@hertz.schwinge.homeip.net>
I had said:
On 2019-11-16T21:42:25+0100, I wrote:
> On 2019-11-15T20:22:47-0500, David Malcolm <dmalcolm@redhat.com> wrote:
>> [...]
>> Specific state machines include:
>> - a checker for malloc/free, for detecting double-free, resource leaks,
>> use-after-free, etc (sm-malloc.cc), and
>
> I can immediately see how this can be useful for a bunch of
> 'malloc'/'free'-like etc. OpenACC Runtime Library calls as well as source
> code directives. ..., and this would've flagged existing code in the
> libgomp OpenACC tests, which recently has given me some grief. Short
> summary/examples:
>
> In addition to host-side 'malloc'/'free', there is device-side (separate
> memory space) 'acc_malloc'/'acc_free'. Static checking example: don't
> mix up host-side and device-side pointers. (Both are normal C/C++
> pointers. Hmm, maybe such checking could easily be implemented even
> outside of your checker by annotating the respective function
> declarations with an attribute describing which in/out arguments are
> host-side vs. device-side pointers.)
>
> Then, there are functions to "map" host-side and device-side memory:
> 'acc_map_data'/'acc_unmap_data'. Static checking example: you must not
> 'acc_free' memory spaces that are still mapped.
>
> Then, there are functions like 'acc_create' (or equivalent directives
> like '#pragma acc create') doing both 'acc_malloc', 'acc_map_data'
> (plus/depending on internal reference counting). Static checking
> example: for a pointer returned by 'acc_create" etc., you must use
> 'acc_delete' etc. instead of 'acc_free', which first does
> 'acc_unmap_data' before interal 'acc_free' (..., and again all that
> depending on reference counting). (Might be "interesting" to teach your
> checker about the reference counting -- if that is actually necessary;
> needs further thought.)
So, something like: "Extend the GCC static analyzer to understand OpenACC
host vs. device memory" (plus an example or two, similar to what I quoted
above). The project can scale depending on what we/applicant intends to
do. I'm happy to advise on the OpenACC bits, but will need you for the
general analyzer infrastructure. Opinions?
Grüße
Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
next prev parent reply other threads:[~2022-02-20 11:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-06 16:20 Martin Jambor
2022-01-07 17:41 ` David Malcolm
2022-02-20 11:19 ` Thomas Schwinge [this message]
2022-02-21 18:01 ` David Malcolm
2022-01-12 9:53 ` Martin Jambor
2022-01-12 10:01 ` Martin Jambor
2022-03-09 14:39 ` Martin Jambor
2022-03-10 2:09 ` Jerry D
2022-03-10 16:13 ` Damian Rouson
2022-03-10 16:22 ` Martin Jambor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875yp9pyyx.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=dmalcolm@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=mjambor@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).