unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: 17168@debbugs.gnu.org
Cc: theonewiththeevillook@yahoo.fr
Subject: bug#17168: 24.3.50; Segfault at mark_object
Date: Thu, 03 Apr 2014 10:59:50 +0400	[thread overview]
Message-ID: <533D06E6.2060001@yandex.ru> (raw)
In-Reply-To: <533C75A6.60900@dancol.org>

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

Hopefully I found the way to catch bogus object in 'function' slot
of a Lisp_Symbol.  100% reproducible for me, as of bzr revision 116934.

1. Apply this patch.

2. Compile with -O0 -g3 and --enable-checking.

3. Run 'emacs -Q', then M-x byte-force-recompile
    /path/to/trunk/lis/org

4. Crash ==>

#0  0x000000379220f62b in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1  0x0000000000569aff in terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at ../../trunk/src/emacs.c:382
#2  0x00000000005f089a in die (
     msg=0x70f498 "SYMBOLP (sym->s.function) || CONSP (sym->s.function) || COMPILEDP (sym->s.function) || SUBRP (sym->s.function)",
     file=0x70e420 "../../trunk/src/alloc.c", line=6613) at ../../trunk/src/alloc.c:6913
#3  0x00000000005f00b5 in sweep_symbols () at ../../trunk/src/alloc.c:6610
#4  0x00000000005f03bb in gc_sweep () at ../../trunk/src/alloc.c:6735
#5  0x00000000005ede1e in Fgarbage_collect () at ../../trunk/src/alloc.c:5632
#6  0x0000000000567706 in maybe_gc () at ../../trunk/src/lisp.h:4520
#7  0x000000000065b95f in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=2, args=0x7fff66de7f70)
     at ../../trunk/src/bytecode.c:954

[...next frames probably irrelevant...]

Dmitry


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

=== modified file 'src/alloc.c'
--- src/alloc.c	2014-04-03 00:37:51 +0000
+++ src/alloc.c	2014-04-03 06:42:53 +0000
@@ -6174,6 +6174,11 @@
 	  break;
 	CHECK_ALLOCATED_AND_LIVE (live_symbol_p);
 	ptr->gcmarkbit = 1;
+	/* Attempt to catch bogus objects.  */
+	eassert (SYMBOLP (ptr->function)
+		 || CONSP (ptr->function)
+		 || COMPILEDP (ptr->function)
+		 || SUBRP (ptr->function));
 	mark_object (ptr->function);
 	mark_object (ptr->plist);
 	switch (ptr->redirect)
@@ -6601,6 +6606,11 @@
               if (!pure_p)
                 eassert (!STRING_MARKED_P (XSTRING (sym->s.name)));
               sym->s.gcmarkbit = 0;
+              /* Attempt to catch bogus objects.  */
+              eassert (SYMBOLP (sym->s.function)
+                       || CONSP (sym->s.function)
+                       || COMPILEDP (sym->s.function)
+                       || SUBRP (sym->s.function));
             }
         }
 


  parent reply	other threads:[~2014-04-03  6:59 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02  7:44 bug#17168: 24.3.50; Segfault at mark_object Nicolas Richard
2014-04-02 15:53 ` Daniel Colascione
2014-04-02 17:59   ` Nicolas Richard
2014-04-02 16:29 ` Dmitry Antipov
2014-04-02 19:46   ` Daniel Colascione
2014-04-02 20:33     ` Daniel Colascione
2014-04-02 20:57       ` Nicolas Richard
2014-04-02 21:50         ` Daniel Colascione
2014-04-02 23:24           ` Stefan Monnier
2014-04-03  0:28             ` Daniel Colascione
2014-04-02 20:37     ` Eli Zaretskii
2014-04-02 20:40       ` Daniel Colascione
2014-04-02 20:55         ` Eli Zaretskii
2014-04-03  6:59         ` Dmitry Antipov [this message]
2014-04-03  7:04           ` Dmitry Antipov
2014-04-03  7:55             ` Daniel Colascione
2014-04-03  9:08               ` Daniel Colascione
2014-04-03 14:03                 ` Dmitry Antipov
2014-04-03 15:42                   ` Stefan Monnier
2014-04-03 16:47                     ` Daniel Colascione
2014-04-03 17:49                       ` Dmitry Antipov
2014-04-03 17:51                         ` Daniel Colascione
2014-04-03 19:21                           ` Stefan Monnier
2014-04-03 19:22                             ` Daniel Colascione
2014-04-05 22:37                               ` Daniel Colascione
2014-04-06  5:05                                 ` Dmitry Antipov
2014-04-06  5:11                                   ` Daniel Colascione
2014-04-06 18:00                                     ` Richard Stallman
2014-04-06 18:10                                       ` Daniel Colascione
2014-04-06 19:06                                         ` Eli Zaretskii
2014-04-07  7:49                                         ` martin rudalics
2014-04-07  8:18                                           ` Dmitry Antipov
2014-04-07  9:20                                             ` martin rudalics
2014-04-06 12:36                                 ` Stefan Monnier
2014-04-06 15:06                                   ` Eli Zaretskii
2014-04-06 15:59                                     ` Daniel Colascione
2014-04-06 16:19                                       ` Eli Zaretskii
2014-04-06 16:24                                         ` Daniel Colascione
2014-04-06 16:29                                           ` Eli Zaretskii
2014-04-06 16:37                                             ` Daniel Colascione
2014-04-06 16:59                                               ` Eli Zaretskii
2014-04-06 17:11                                                 ` Daniel Colascione
2014-04-06 19:44                                                 ` Stefan Monnier
2014-04-06 19:42                                     ` Stefan Monnier
2014-04-06 15:46                                   ` Daniel Colascione
2014-04-06 19:58                                     ` Stefan Monnier
2014-04-06 20:13                                       ` Daniel Colascione
2014-04-06 20:53                                         ` Daniel Colascione
2014-04-06 21:08                                         ` Stefan Monnier
2014-04-06 21:37                                           ` Daniel Colascione
2014-04-07 16:28                                             ` Stefan Monnier
2014-04-07 19:06                                               ` Daniel Colascione
2014-04-07 20:42                                                 ` Stefan Monnier
2014-04-08  7:14                                                 ` martin rudalics
2014-04-08  8:47                                                   ` Daniel Colascione
2014-04-06 18:01                                   ` Richard Stallman
2014-04-06 19:58                                     ` Stefan Monnier
2014-04-07 16:56                                       ` Richard Stallman
2014-04-02 20:49     ` Nicolas Richard

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=533D06E6.2060001@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=17168@debbugs.gnu.org \
    --cc=theonewiththeevillook@yahoo.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).