public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org>,
	 Alexandre Oliva <oliva@gnu.org>,
	Giuliano Belinassi <gbelinassi@suse.de>,
	 matz@suse.com
Subject: Re: [PATCH] Do not abort compilation when dump file is /dev/*
Date: Fri, 19 Nov 2021 13:51:41 +0100 (CET)	[thread overview]
Message-ID: <3rr2o071-ro3n-8665-6295-9425160r96s@fhfr.qr> (raw)
In-Reply-To: <20211119132531.6ac44ea4@nbbrfq>

On Fri, 19 Nov 2021, Bernhard Reutner-Fischer wrote:

> On Fri, 19 Nov 2021 10:35:26 +0100 (CET)
> Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> > On Fri, 19 Nov 2021, Alexandre Oliva wrote:
> > 
> > > On Nov 18, 2021, Richard Biener <rguenther@suse.de> wrote:
> > >   
> > > > IMHO a more reasonable thing to do would be to not treat
> > > > -o /dev/null as a source for -dumpdir and friends.  Alex?  
> > > 
> > > +1
> > > 
> > > I think we already have some special-casing for /dev/null somewhere.  
> > 
> > Grepping finds me the following in system.h which is already checked
> > for in gcc.c in a few places indeed.
> > 
> > /* Provide a default for the HOST_BIT_BUCKET.
> >    This suffices for POSIX-like hosts.  */
> > 
> > #ifndef HOST_BIT_BUCKET
> > #define HOST_BIT_BUCKET "/dev/null"
> > #endif
> > 
> > 
> > > > You did the last re-org, where'd we put such special casing?  
> > > 
> > > I think we're missing something like this, to avoid messing with dumpdir
> > > with -o /dev/null.  We already use the same function when computing
> > > outbase just below this.  
> > 
> > Ah yeah, not_actual_file_p should do the trick indeed.  Giuliano, can
> > you update the patch like below?  I think we should still adjust
> > documentation as you did.
> 
> But that wouldn't cater for the general problem that the dumpdir is not
> writable, no? Why not just simply check access W_OK of the dumpdir?
> 
> Otherwise a dumpdir /dev/full or anyother such path will cause the same
> thing i guess.

I think those cases are OK to diagnose.  Just choosing a
not_actual_file_p output as base to derive the dump directory is
bad.

Richard.

  reply	other threads:[~2021-11-19 12:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 16:52 Giuliano Belinassi
2021-11-18  9:43 ` Richard Biener
2021-11-18 12:52   ` Giuliano Belinassi
2021-11-18 14:24     ` Richard Biener
2021-11-18 21:35       ` [PATCH v2] " Giuliano Belinassi
2021-11-19  8:11         ` Richard Biener
2021-11-19  9:22   ` [PATCH] " Alexandre Oliva
2021-11-19  9:35     ` Richard Biener
2021-11-19 12:25       ` Bernhard Reutner-Fischer
2021-11-19 12:51         ` Richard Biener [this message]
2021-11-19 13:42     ` [PATCH v3] " Giuliano Belinassi
2021-11-19 14:12       ` Richard Biener
2021-11-19 14:47         ` Bernhard Reutner-Fischer
2021-11-21  3:47         ` Alexandre Oliva
2021-11-22 12:35           ` Giuliano Belinassi
2021-11-18 11:48 ` [PATCH] " Martin Liška

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=3rr2o071-ro3n-8665-6295-9425160r96s@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gbelinassi@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=matz@suse.com \
    --cc=oliva@gnu.org \
    --cc=rep.dot.nop@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).