From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31549: 25.3; bytecompile fails with eval-when-compile Date: Thu, 24 May 2018 19:40:12 +0300 Message-ID: <83fu2hatxv.fsf@gnu.org> References: <8636yknjy1.fsf@gmail.com> <87sh6jgtao.fsf@gmail.com> <83po1mcsty.fsf@gnu.org> <87k1rugfxd.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1527179948 10841 195.159.176.226 (24 May 2018 16:39:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 24 May 2018 16:39:08 +0000 (UTC) Cc: ynyaaa@gmail.com, 31549@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 24 18:39:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLtGX-0002eU-AF for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 May 2018 18:39:01 +0200 Original-Received: from localhost ([::1]:39765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLtIe-0007kP-BX for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 May 2018 12:41:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLtIX-0007k2-Fu for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 12:41:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLtIU-0002ba-7K for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 12:41:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLtIU-0002bU-3O for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 12:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fLtIT-0003u9-Pa for bug-gnu-emacs@gnu.org; Thu, 24 May 2018 12:41: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: Thu, 24 May 2018 16:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31549 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31549-submit@debbugs.gnu.org id=B31549.152718001314945 (code B ref 31549); Thu, 24 May 2018 16:41:01 +0000 Original-Received: (at 31549) by debbugs.gnu.org; 24 May 2018 16:40:13 +0000 Original-Received: from localhost ([127.0.0.1]:46690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLtHf-0003sy-Rt for submit@debbugs.gnu.org; Thu, 24 May 2018 12:40:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fLtHd-0003sj-Tf for 31549@debbugs.gnu.org; Thu, 24 May 2018 12:40:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLtHV-0001zx-Du for 31549@debbugs.gnu.org; Thu, 24 May 2018 12:40:04 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLtHV-0001zr-Al; Thu, 24 May 2018 12:40:01 -0400 Original-Received: from [176.228.60.248] (port=3952 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fLtHU-0004r7-OX; Thu, 24 May 2018 12:40:01 -0400 In-reply-to: <87k1rugfxd.fsf@gmail.com> (message from Noam Postavsky on Wed, 23 May 2018 18:34:06 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:146487 Archived-At: > From: Noam Postavsky > Cc: ynyaaa@gmail.com, 31549@debbugs.gnu.org > Date: Wed, 23 May 2018 18:34:06 -0400 > > > How about simply signaling a special error instead of memory_full? > > Something like > > > > error ("Lisp stack overflow"); > > Still might be worth considering changing the error, although stack > overflow doesn't describe it correctly anymore. As far as I can tell, > SAFE_ALLOCA_LISP_EXTRA will only signal memory_full if the number of > bytes to allocate won't fit in a ptrdiff_t variable. That should be > pretty much impossible, barring some strange bugs. So maybe: > > --- i/src/lisp.h > +++ w/src/lisp.h > @@ -4662,7 +4662,7 @@ egetenv (const char *var) > if (INT_MULTIPLY_WRAPV (nelt, word_size, &alloca_nbytes) \ > || INT_ADD_WRAPV (alloca_nbytes, extra, &alloca_nbytes) \ > || SIZE_MAX < alloca_nbytes) \ > - memory_full (SIZE_MAX); \ > + error ("Oversize allocation (0x%lX)", (size_t) alloca_nbytes); \ > else if (alloca_nbytes <= sa_avail) \ > (buf) = AVAIL_ALLOCA (alloca_nbytes); \ > else \ I agree that memory_full is suboptimal here, but "Oversize allocation" with a number is too technical to be useful to the programmer who bumps into this problem. We need some text which will indicate that the program is too "complex" (a better word is needed here) and should be simplified. Can you come up with something along those lines?