all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: ynyaaa@gmail.com, 31549@debbugs.gnu.org
Subject: bug#31549: 25.3; bytecompile fails with eval-when-compile
Date: Thu, 24 May 2018 17:18:17 -0400	[thread overview]
Message-ID: <87603chhwm.fsf@gmail.com> (raw)
In-Reply-To: <83fu2hatxv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 24 May 2018 19:40:12 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> --- 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?

Sorry, if my initial response confused things, but I'm fairly certain
now that there is no way to trigger this error by compiling a Lisp
program in Emacs 26.  It would have to require a stack depth of 2^63 (or
2^31 on 32 bit builds), I imagine actual memory exhaustion would happen
first.

Actually, even though memory_full probably isn't correct, maybe we
should just leave it.  Triggering this error probably indicates some bug
in Emacs, so the first thing to do after hitting it would be to set a
breakpoint in gdb; this is a bit more convenient to do with memory_full
than Fsignal or error: fewer false positives.





  reply	other threads:[~2018-05-24 21:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22  9:00 bug#31549: 25.3; bytecompile fails with eval-when-compile ynyaaa
2018-05-22 23:33 ` Noam Postavsky
2018-05-23 15:08   ` Eli Zaretskii
2018-05-23 22:34     ` Noam Postavsky
2018-05-24 16:40       ` Eli Zaretskii
2018-05-24 21:18         ` Noam Postavsky [this message]
2018-05-25  6:19           ` Eli Zaretskii
2018-05-27 15:09             ` Noam Postavsky
2018-05-27 16:22               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87603chhwm.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=31549@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ynyaaa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.