From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66375: 30.0.50; (error "Maximum buffer size exceeded") from (insert-file-contents "/dev/null") Date: Sat, 07 Oct 2023 08:54:55 +0300 Message-ID: <83o7hb0yfk.fsf@gnu.org> References: <87cyxru14o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28115"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66375@debbugs.gnu.org To: sds@gnu.org, Po Lu , Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 07:56:05 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qp0IH-00071V-I7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 07:56:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp0I7-0003Ho-5O; Sat, 07 Oct 2023 01:55:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp0Hv-0003Be-H8 for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 01:55:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qp0Hu-00082s-FF for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 01:55:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qp0ID-0000bT-LU for bug-gnu-emacs@gnu.org; Sat, 07 Oct 2023 01:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Oct 2023 05:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66375 X-GNU-PR-Package: emacs Original-Received: via spool by 66375-submit@debbugs.gnu.org id=B66375.16966581122245 (code B ref 66375); Sat, 07 Oct 2023 05:56:01 +0000 Original-Received: (at 66375) by debbugs.gnu.org; 7 Oct 2023 05:55:12 +0000 Original-Received: from localhost ([127.0.0.1]:53191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp0HQ-0000a9-7K for submit@debbugs.gnu.org; Sat, 07 Oct 2023 01:55:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qp0HN-0000Zs-S1 for 66375@debbugs.gnu.org; Sat, 07 Oct 2023 01:55:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp0Gy-0007mg-5T; Sat, 07 Oct 2023 01:54:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=M660/3MsB/JuQ2H/0PGIor0kn8PdpFuGhuaEPAPsw1g=; b=jbC5up10ofkjB1Sti7sV xNqF80lmkEpZEFuj8ATQsg/F0U9Ag2+NOhCzy8DH72m89qsqWw+rUj7h9zMVYHoxExFwp6CSvqHQm kueRp9n3R5zHiPTSoSEgI4plsMVR7yj2KS/gAGWCAwgHWpfM40XvwfWN/KCDPdcLFLh1J/cPADh17 H1U2Z0qjYb5wfb9vIWHvJN8ARri9AlkKY2hs1fdR/iQFfvpv+RSsQCJ/jPoi5AMZ6LyuN4nVG6wWP 2DHErJGDMScLVZucB/QPVi4lfT4uXWSdOPX8oYN6QGlovJWdWxDMm7z/A7ZOrzPrieMf/IWrSYE+1 XulwPqaPUiWsaA==; In-Reply-To: <87cyxru14o.fsf@gnu.org> (message from Sam Steingold on Fri, 06 Oct 2023 13:11:35 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271972 Archived-At: > From: Sam Steingold > Date: Fri, 06 Oct 2023 13:11:35 -0400 > > > emacs -Q > > (insert-file-contents "/dev/null") > ==> > Debugger entered--Lisp error: (error "Maximum buffer size exceeded") > insert-file-contents("/dev/null") This is a "feature". From the doc string: When inserting data from a special file (e.g., /dev/urandom), you can’t specify VISIT or BEG, and END should be specified to avoid inserting unlimited data into the buffer from some special files which otherwise could supply infinite amounts of data. Maybe we could make a special exception for the null-device, whose name we generally know on each supported system. Technically, the problem is that the null device is seekable, so this: if (seekable || !NILP (end)) total = end_offset - beg_offset; computes 'total' to be a very large value, and then this: /* Ensure the gap is at least one byte larger than needed for the estimated file size, so that in the usual case we read to EOF without reallocating. */ if (GAP_SIZE <= total) make_gap (total - GAP_SIZE + 1); attempts to make a gap very large, which errors out. And that is before we try to read even a single byte from the file. Po Lu and Paul, any ideas?