From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 29233385AC0A for ; Fri, 19 Nov 2021 12:51:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29233385AC0A Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 2F3372177B; Fri, 19 Nov 2021 12:51:41 +0000 (UTC) Received: from murzim.suse.de (murzim.suse.de [10.160.4.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 27B97A3B81; Fri, 19 Nov 2021 12:51:41 +0000 (UTC) Date: Fri, 19 Nov 2021 13:51:41 +0100 (CET) From: Richard Biener To: Bernhard Reutner-Fischer cc: Richard Biener via Gcc-patches , Alexandre Oliva , Giuliano Belinassi , matz@suse.com Subject: Re: [PATCH] Do not abort compilation when dump file is /dev/* In-Reply-To: <20211119132531.6ac44ea4@nbbrfq> Message-ID: <3rr2o071-ro3n-8665-6295-9425160r96s@fhfr.qr> References: <20211116165231.11822-1-gbelinassi@suse.de> <20211119132531.6ac44ea4@nbbrfq> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2021 12:51:43 -0000 On Fri, 19 Nov 2021, Bernhard Reutner-Fischer wrote: > On Fri, 19 Nov 2021 10:35:26 +0100 (CET) > Richard Biener via Gcc-patches wrote: > > > On Fri, 19 Nov 2021, Alexandre Oliva wrote: > > > > > On Nov 18, 2021, Richard Biener 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.