From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#9800: Incomplete truncated file buffers from the /proc filesystem Date: Thu, 20 Oct 2011 01:59:42 +0300 Organization: JURTA Message-ID: <877h40vb8h.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1319065330 26083 80.91.229.12 (19 Oct 2011 23:02:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 Oct 2011 23:02:10 +0000 (UTC) To: 9800@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 20 01:02:04 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RGf9A-0004oR-48 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2011 01:02:04 +0200 Original-Received: from localhost ([::1]:58895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGf99-0000wm-IT for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Oct 2011 19:02:03 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGf95-0000wR-AF for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 19:02:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGf93-0007nu-5m for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 19:01:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGf93-0007no-0Z for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 19:01:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RGfA5-0006mf-NH for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 19:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Oct 2011 23:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9800 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.131906537526062 (code B ref -1); Wed, 19 Oct 2011 23:03:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Oct 2011 23:02:55 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGf9z-0006mJ-2Z for submit@debbugs.gnu.org; Wed, 19 Oct 2011 19:02:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGf9w-0006m7-JD for submit@debbugs.gnu.org; Wed, 19 Oct 2011 19:02:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGf8n-0007m3-8e for submit@debbugs.gnu.org; Wed, 19 Oct 2011 19:01:42 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:51120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGf8n-0007lz-7G for submit@debbugs.gnu.org; Wed, 19 Oct 2011 19:01:41 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGf8m-0000u7-1r for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 19:01:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGf8i-0007l0-LC for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 19:01:39 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]:59312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGf8i-0007kv-Du for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 19:01:36 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 8DFA56E808C for ; Wed, 19 Oct 2011 16:01:35 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id D8E73AC9400A for ; Wed, 19 Oct 2011 16:01:34 -0700 (PDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 19 Oct 2011 19:03:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52884 Archived-At: Large files from the /proc filesystem are visited incompletely, their file buffers are truncated at the position 65536. One possible test case to reproduce this is to load enough libraries with e.g. (imagemagick-register-types) and visit Emacs's maps file in /proc/$PID/maps. Andreas said in http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00782.html that it's due to this code in `insert-file-contents': /* The file size returned from stat may be zero, but data may be readable nonetheless, for example when this is a file in the /proc filesystem. */ if (end_offset == 0) end_offset = READ_BUF_SIZE; How this could be fixed? Should it keep reading while more data can be read from the file?