all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Nathan Froyd <froydnj@gmail.com>
Cc: 16502@debbugs.gnu.org
Subject: bug#16502: segmentation fault with org-capture
Date: Mon, 20 Jan 2014 13:30:47 +0400	[thread overview]
Message-ID: <52DCECC7.9080705@yandex.ru> (raw)
In-Reply-To: <52DCDC6B.9090209@yandex.ru>

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

On 01/20/2014 12:20 PM, Dmitry Antipov wrote:

> Could you please run undumped (temacs) under valgrind?

...and please try this patch (for trunk), if possible.

Dmitry



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bug16502.patch --]
[-- Type: text/x-patch; name="bug16502.patch", Size: 1740 bytes --]

=== modified file 'src/buffer.c'
--- src/buffer.c	2014-01-01 07:43:34 +0000
+++ src/buffer.c	2014-01-20 09:22:59 +0000
@@ -1867,6 +1867,7 @@
 
   if (b->base_buffer)
     {
+      INTERVAL i;
       /* Unchain all markers that belong to this indirect buffer.
 	 Don't unchain the markers that belong to the base buffer
 	 or its other indirect buffers.  */
@@ -1881,6 +1882,14 @@
 	  else
 	    mp = &m->next;
 	}
+      /* Intervals should be owned by the base buffer (Bug#16502).  */
+      i = buffer_intervals (b);
+      if (i)
+	{
+	  Lisp_Object owner;
+	  XSETBUFFER (owner, b->base_buffer);
+	  set_interval_object (i, owner);
+	}
     }
   else
     {

=== modified file 'src/intervals.c'
--- src/intervals.c	2014-01-01 07:43:34 +0000
+++ src/intervals.c	2014-01-20 09:21:55 +0000
@@ -60,16 +60,7 @@
 \f
 /* Utility functions for intervals.  */
 
-/* Use these functions to set Lisp_Object
-   or pointer slots of struct interval.  */
-
-static void
-set_interval_object (INTERVAL i, Lisp_Object obj)
-{
-  eassert (BUFFERP (obj) || STRINGP (obj));
-  i->up_obj = 1;
-  i->up.obj = obj;
-}
+/* Use these functions to set pointer slots of struct interval.  */
 
 static void
 set_interval_left (INTERVAL i, INTERVAL left)

=== modified file 'src/intervals.h'
--- src/intervals.h	2014-01-01 07:43:34 +0000
+++ src/intervals.h	2014-01-20 09:22:10 +0000
@@ -134,6 +134,14 @@
    or pointer slots of struct interval.  */
 
 INLINE void
+set_interval_object (INTERVAL i, Lisp_Object obj)
+{
+  eassert (BUFFERP (obj) || STRINGP (obj));
+  i->up_obj = 1;
+  i->up.obj = obj;
+}
+
+INLINE void
 set_interval_parent (INTERVAL i, INTERVAL parent)
 {
   i->up_obj = false;


  reply	other threads:[~2014-01-20  9:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-19 21:15 bug#16502: segmentation fault with org-capture Nathan Froyd
2014-01-20  8:20 ` Dmitry Antipov
2014-01-20  9:30   ` Dmitry Antipov [this message]
2014-01-20 15:29     ` Nathan Froyd
2014-01-20 17:13       ` Dmitry Antipov
2014-01-20 17:23         ` Nathan Froyd
2014-01-21  2:32           ` Dmitry Antipov

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=52DCECC7.9080705@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=16502@debbugs.gnu.org \
    --cc=froydnj@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.