public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: David Malcolm <dmalcolm@redhat.com>,
	Mir Immad <mirimnan017@gmail.com>,
	gcc@gcc.gnu.org
Subject: Re: GSoC: Getting started
Date: Tue, 7 Jun 2022 09:13:59 +0530	[thread overview]
Message-ID: <baed2d96-47ef-a480-7f6f-41683e54e44a@gotplt.org> (raw)
In-Reply-To: <69f2466b2bbcf360a027b8deff234dbc99df5348.camel@redhat.com>

On 02/06/2022 00:20, David Malcolm wrote:
> (2) find a list of system calls (e.g. those implemented on Linux), and
> see which ones relate to file descriptors e.g. acquiring them, using
> them, releasing them, and duplicating them.  Look for patterns of usage
> that could be expressed using function attributes.  Probably ignore
> "ioctl" for now.
> 
> (3) probably talk to glibc's developers about this, since glibc
> provides headers that wrap system calls, which would want to use the
> attributes if we provide them

There are a significant number of interfaces that use file descriptors, 
not just limited to syscall interfaces. Another area I can think of is 
stdio, i.e. FILE interfaces.  There are interfaces (e.g. fdopen) that 
interact with file descriptors and they may require some special handling.

> (4) implement the attributes, so that the analyzer doesn't have
> hardcoded function names, and can instead rely on function attributes.
> GCC's attributes are implemented in gcc/c-family/c-attribs.cc; see the
> big c_common_attribute_table array, which associates the string names
> of the attrbutes with properties, including a handler callback.  These
> either set flags of a decl, or the attribute itself is appended to a
> singly-linked list on that decl (for those things that don't directly
> relate to fields of a decl).
> 
> I believe Siddhesh Poyarekar has been looking at attributes from the
> glibc side of things, so I'm CCing him in case he has input on this.
> 
> I'm wondering if other people on this list have ideas for projects that
> make heavy use of syscalls/file-descriptors that would benefit from
> having this analyzer feature.  Maybe systemd?

Systemd AFAIK doesn't bypass glibc's syscall interfaces, so annotating 
glibc headers ought to be good start for a GSoC project.  If this is 
done before time we can explore server software, e.g. sshd, httpd, etc. 
to see if there's scope for additional annotations there.  I'll be happy 
to help on the glibc and interfaces front.

Siddhesh

  reply	other threads:[~2022-06-07  3:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 17:52 Mir Immad
2022-06-01 18:50 ` David Malcolm
2022-06-07  3:43   ` Siddhesh Poyarekar [this message]
2022-06-16 15:27   ` David Malcolm

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=baed2d96-47ef-a480-7f6f-41683e54e44a@gotplt.org \
    --to=siddhesh@gotplt.org \
    --cc=dmalcolm@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=mirimnan017@gmail.com \
    /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).