all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Darren Hoo <darren.hoo@gmail.com>
Cc: 16127@debbugs.gnu.org
Subject: bug#16127: 24.3.50; emacs crashes with macfont_free_entity
Date: Fri, 13 Dec 2013 10:40:36 +0400	[thread overview]
Message-ID: <52AAABE4.4020203@yandex.ru> (raw)
In-Reply-To: <m2fvpx4ge5.fsf@gmail.com>

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

On 12/13/2013 06:46 AM, Darren Hoo wrote:

> Process 17619 launched: '/Volumes/disk/emacs/src/emacs' (x86_64)
> Process 17619 stopped
> * thread #1: tid = 0x1f0644, 0x00000001001ac8cb emacs`macfont_free_entity [inlined] XCDR(c=9053142519906304, obj=9053142519906304, n=0) + 4 at lisp.h:2007, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
>      frame #0: 0x00000001001ac8cb emacs`macfont_free_entity [inlined] XCDR(c=9053142519906304, obj=9053142519906304, n=0) + 4 at lisp.h:2007
>     2004	XSAVE_POINTER (Lisp_Object obj, int n)
>     2005	{
>     2006	  eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER);
> -> 2007	  return XSAVE_VALUE (obj)->data[n].pointer;
>     2008	}
>     2009	INLINE void
>     2010	set_save_pointer (Lisp_Object obj, int n, void *val)

Hm...double call to macfont_free_entity for the same entity?

Can you compile with --enable-checking and this patch?

Dmitry


[-- Attachment #2: test_bug16127.patch --]
[-- Type: text/x-patch, Size: 575 bytes --]

=== modified file 'src/macfont.m'
--- src/macfont.m	2013-12-12 14:26:06 +0000
+++ src/macfont.m	2013-12-13 06:37:01 +0000
@@ -2435,11 +2435,14 @@
 {
   Lisp_Object val = assq_no_quit (QCfont_entity,
 				  AREF (entity, FONT_EXTRA_INDEX));
-  CFStringRef name = XSAVE_POINTER (XCDR (val), 0);
+  if (CONSP (val) && SAVE_VALUE_P (XCDR (val)))
+    {
+      CFStringRef name = XSAVE_POINTER (XCDR (val), 0);
 
-  block_input ();
-  CFRelease (name);
-  unblock_input ();
+      block_input ();
+      CFRelease (name);
+      unblock_input ();
+    }
 }
 
 static Lisp_Object


  reply	other threads:[~2013-12-13  6:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13  2:46 bug#16127: 24.3.50; emacs crashes with macfont_free_entity Darren Hoo
2013-12-13  6:40 ` Dmitry Antipov [this message]
2013-12-13  8:27   ` Darren Hoo
2013-12-13  9:31     ` Dmitry Antipov
2016-09-11 10:08 ` Alan Third
2019-08-23  6:13 ` Stefan Kangas

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=52AAABE4.4020203@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=16127@debbugs.gnu.org \
    --cc=darren.hoo@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.