all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Jorgen Schaefer <Jorgen.Schaefer@gmail.com>, 21666@debbugs.gnu.org
Subject: bug#21666: 25.0.50; Random segfaults
Date: Tue, 13 Oct 2015 09:09:16 -0700	[thread overview]
Message-ID: <561D2CAC.40404@cs.ucla.edu> (raw)
In-Reply-To: <87si5fugvw.fsf@loki.jorgenschaefer.de>

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

Those two backtraces both have a call to mapcar1 with a long list (leni=2544 in 
one, leni=2502 in the other).  When Fmapcar uses SAFE_ALLOCA_LISP, it'll ask for 
(say) 2502*8 bytes, or 20016 bytes, and this is more than the 16 KiB MAX_ALLOCA 
limit, which means SAFE_ALLOCA_LISP will invoke xmalloc and make_save_memory 
rather than invoking AVAIL_ALLOCA.  One possibility is that the xmalloced memory 
isn't being properly analyzed by the garbage collector.  To test that theory, 
can you please try something like the attached patch?  This wouldn't fix the 
bug, but it would mean mapcar should work for larger lists and you won't get a 
backtrace until the list gets about twice as large.


[-- Attachment #2: t.diff --]
[-- Type: text/plain, Size: 345 bytes --]

diff --git a/src/fns.c b/src/fns.c
index dfd48a2..bb0af4a 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2584,6 +2584,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string.  */)
   register Lisp_Object *args;
   Lisp_Object ret;
   USE_SAFE_ALLOCA;
+  sa_avail = 32 * 1024;
 
   len = Flength (sequence);
   if (CHAR_TABLE_P (sequence))

  reply	other threads:[~2015-10-13 16:09 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11  6:50 bug#21666: 25.0.50; Random segfaults Jorgen Schaefer
2015-10-12  0:30 ` Paul Eggert
2015-10-13 11:50 ` Jorgen Schaefer
2015-10-13 16:09   ` Paul Eggert [this message]
2015-10-15 11:05     ` Jorgen Schäfer
2015-10-16  8:03       ` Jorgen Schäfer
2015-10-16  8:05         ` Paul Eggert
2015-10-16  9:03           ` Eli Zaretskii
2015-10-16 22:28             ` Paul Eggert
2015-10-17  8:06               ` Eli Zaretskii
2015-10-23  9:41           ` Jorgen Schäfer
2015-10-23 10:04             ` Eli Zaretskii
2015-10-23 10:26               ` Eli Zaretskii
     [not found] ` <handler.21666.B.144458332816487.ack@debbugs.gnu.org>
2015-11-29 19:13   ` bug#21666: Acknowledgement (25.0.50; Random segfaults) Jorgen Schäfer
2016-03-09 10:14 ` bug#21666: Bug is indeed undo-list and GC related Jorgen Schäfer
2016-03-09 15:15   ` Eli Zaretskii
2016-03-09 15:21     ` Jorgen Schäfer
2016-03-09 15:43       ` Phillip Lord
2016-03-09 16:37       ` Eli Zaretskii
2016-03-09 16:46         ` Jorgen Schäfer
2016-03-12 14:43           ` Jorgen Schäfer
2016-03-12 16:22             ` Eli Zaretskii
2016-03-12 23:44               ` Phillip Lord
2016-03-13  9:26                 ` martin rudalics
2016-03-13 19:58                   ` Phillip Lord
2016-03-13 20:12                     ` martin rudalics
2016-03-14 19:56 ` bug#21666: Correction, emacs-25 *is* broken Jorgen Schäfer
2016-03-14 20:09   ` Eli Zaretskii
2016-03-14 20:21     ` Jorgen Schäfer
2016-03-14 20:53       ` Eli Zaretskii
2016-03-14 20:28   ` Phillip Lord
2016-03-14 20:41     ` Jorgen Schäfer
2018-06-12 23:01   ` bug#21666: 25.0.50; Random segfaults Noam Postavsky
2018-06-13  7:52     ` Jorgen Schäfer
2018-06-13 10:31       ` Noam Postavsky
2016-03-14 21:20 ` bug#21666: Backtrace Jorgen Schäfer
2016-03-14 22:19   ` Jorgen Schäfer
2016-03-15  3:36     ` 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=561D2CAC.40404@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=21666@debbugs.gnu.org \
    --cc=Jorgen.Schaefer@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.