From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#11585: 24.0.50; corrupted byte compiled files Date: Wed, 30 May 2012 22:45:45 +0800 Message-ID: <87sjeh7mna.fsf@gnu.org> References: <20120530.085706.183065156.devel@pollock-nageoire.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1338389206 7596 80.91.229.3 (30 May 2012 14:46:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 May 2012 14:46:46 +0000 (UTC) Cc: 11585@debbugs.gnu.org To: Pierre Lorenzon Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 30 16:46:45 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SZkAe-0005pX-3r for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2012 16:46:44 +0200 Original-Received: from localhost ([::1]:34174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZkAd-0004fH-Sr for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 May 2012 10:46:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZkAa-0004Xa-Ag for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 10:46:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZkAT-00076k-Cr for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 10:46:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZkAT-00076c-9f for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 10:46:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SZkBt-0002jA-Us for bug-gnu-emacs@gnu.org; Wed, 30 May 2012 10:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 May 2012 14:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11585 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11585-submit@debbugs.gnu.org id=B11585.133838924710429 (code B ref 11585); Wed, 30 May 2012 14:48:01 +0000 Original-Received: (at 11585) by debbugs.gnu.org; 30 May 2012 14:47:27 +0000 Original-Received: from localhost ([127.0.0.1]:50385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZkBL-0002iA-4b for submit@debbugs.gnu.org; Wed, 30 May 2012 10:47:27 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:57632 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZkBI-0002i1-Kt for 11585@debbugs.gnu.org; Wed, 30 May 2012 10:47:25 -0400 Original-Received: from cm162.gamma80.maxonline.com.sg ([202.156.80.162]:42505 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SZk9p-0002z9-Cz; Wed, 30 May 2012 10:45:54 -0400 In-Reply-To: <20120530.085706.183065156.devel@pollock-nageoire.net> (Pierre Lorenzon's message of "Wed, 30 May 2012 08:57:06 +0200 (CEST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list 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:60521 Archived-At: Pierre Lorenzon writes: > It seems that a part of the .elc file is missing as if a part of the > character strream was discarded. This is certainly one of the most interesting bugs I've come across in quite some time. Congrats on finding it. The problem is that `byte-compile-fix-header' tries to insert a message within a fixed amount of space (in order to preserve file positions of the actual bytecode), so long file names embedded in the message will cause it to fail. Your proposed fix would not preserve file positions, but here is another way to fix it. Stefan, I think this problem is serious enough, and the solution straightforward enough, that we ought to include it in emacs-24 even though it is not a regression. WDYT? === modified file 'lisp/emacs-lisp/bytecomp.el' *** lisp/emacs-lisp/bytecomp.el 2012-03-26 19:10:00 +0000 --- lisp/emacs-lisp/bytecomp.el 2012-05-30 14:40:25 +0000 *************** *** 1956,1966 **** ;; don't try to check the version number. " (< (aref emacs-version (1- (length emacs-version))) ?A)\n" (format " (string-lessp emacs-version \"%s\")\n" minimum-version) ! " (error \"`" ! ;; prin1-to-string is used to quote backslashes. ! (substring (prin1-to-string (file-name-nondirectory filename)) ! 1 -1) ! (format "' was compiled for Emacs %s or later\"))\n\n" minimum-version)) ;; Now compensate for any change in size, to make sure all ;; positions in the file remain valid. --- 1956,1965 ---- ;; don't try to check the version number. " (< (aref emacs-version (1- (length emacs-version))) ?A)\n" (format " (string-lessp emacs-version \"%s\")\n" minimum-version) ! ;; Because the header must fit in a fixed width, we cannot ! ;; insert arbitrary-length file names: ! (format ! " (error \"Unable to load library compiled for Emacs %s or later\"))\n\n" minimum-version)) ;; Now compensate for any change in size, to make sure all ;; positions in the file remain valid.