all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: Re: allocate_string_data memory corruption
Date: Thu, 19 Jan 2006 19:45:57 -0500	[thread overview]
Message-ID: <87y81b20ca.fsf@stupidchicken.com> (raw)
In-Reply-To: <jwv4q41qndc.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 18 Jan 2006 15:48:33 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Most likely the thing that's happening is that check_sblock takes a "long"
> time during which there's a higher probability for a signal to arrive and
> the bug itself is that one of the signal handlers does some string
> allocation (or some other manipulation of those data structures).
>
> I'd try something like
>
>     eassert (!in_allocate_string_data);
>     in_allocate_string_data = 1;
>     ...
>     check_sblock();
>     ...
>     in_allocate_string_data = 0;

OK, I'll follow this up.

> BTW, it's possible that -DSYNC_INPUT fixes the bug.

Curiously, if you turn on the GC debugging checks at the top of
lisp.h, compiling with -DSYNC_INPUT fails:

./temacs --batch --load loadup bootstrap
*** glibc detected *** double free or corruption (out): 0x0839a500 ***
make[2]: *** [bootstrap-emacs] Aborted
make[2]: Leaving directory `/home/cyd/tmp/emacs/src'
make[1]: *** [bootstrap-build] Error 2
make[1]: Leaving directory `/home/cyd/tmp/emacs'
make: *** [bootstrap] Error 2

(gdb) r -batch
Starting program: /home/cyd/tmp/emacs/src/temacs -batch
*** glibc detected *** double free or corruption (out): 0x0839a520 ***

Program received signal SIGABRT, Aborted.
0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7bba9b1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7bbc2c9 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7bee6ea in __fsetlocking () from /lib/tls/i686/cmov/libc.so.6
#4  0xb7bf4f54 in malloc_trim () from /lib/tls/i686/cmov/libc.so.6
#5  0xb7bf52ca in free () from /lib/tls/i686/cmov/libc.so.6
#6  0x0813df9e in init_buffer () at buffer.c:5174
#7  0x0811779e in main (argc=2, argv=0xbfc70214) at emacs.c:1526

  reply	other threads:[~2006-01-20  0:45 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-18 16:57 allocate_string_data memory corruption Chong Yidong
2006-01-18 20:48 ` Stefan Monnier
2006-01-20  0:45   ` Chong Yidong [this message]
2006-01-20  1:14   ` Richard M. Stallman
2006-01-20  3:48     ` Stefan Monnier
2006-01-23 20:21   ` Stefan Monnier
2006-01-24 17:23   ` Chong Yidong
2006-01-18 21:35 ` Ken Raeburn
2006-01-18 23:56   ` Chong Yidong
2006-01-19  8:53     ` Romain Francoise
2006-01-19 20:57       ` Stefan Monnier
2006-01-19 22:48         ` Kim F. Storm
2006-01-20  3:46           ` Stefan Monnier
2006-01-20 22:58             ` Richard M. Stallman
2006-01-25  3:26             ` Chong Yidong
2006-01-25 15:45               ` Richard M. Stallman
2006-01-20  1:14   ` Richard M. Stallman
2006-01-20  9:28     ` Ken Raeburn
2006-01-20 22:58       ` Richard M. Stallman
2006-01-18 22:06 ` Eli Zaretskii
2006-01-18 23:48   ` David Kastrup
2006-01-18 23:48   ` Chong Yidong
2006-01-19  1:15     ` Stefan Monnier
2006-01-19  3:21       ` Ken Raeburn
2006-01-19  4:36     ` Eli Zaretskii
2006-01-20  1:14 ` Richard M. Stallman
2006-01-20  3:56   ` Stefan Monnier
2006-01-20 14:49     ` Chong Yidong
2006-01-21 19:57       ` Richard M. Stallman
2006-01-22 17:37         ` Stefan Monnier
2006-01-20 22:58     ` Richard M. Stallman
2006-01-21  4:48       ` Stefan Monnier
2006-01-21 17:31         ` Chong Yidong
2006-01-22  3:57           ` Richard M. Stallman
2006-01-22 16:45         ` Stefan Monnier
2006-01-22 20:06           ` Andreas Schwab
2006-01-23  0:10           ` Richard M. Stallman
2006-01-23  0:35           ` Ken Raeburn
2006-01-23  1:58             ` Stefan Monnier
2006-01-23  2:06               ` Stefan Monnier
2006-01-24 16:46             ` Richard M. Stallman
2006-01-23  0:55         ` Stefan Monnier
2006-01-24 16:46           ` Richard M. Stallman
2006-01-24 17:57             ` Kim F. Storm
2006-01-24 18:33               ` Chong Yidong
2006-01-25 15:45               ` Richard M. Stallman
2006-01-26  1:41             ` Chong Yidong
2006-01-26 17:46               ` Richard M. Stallman
2006-01-26 18:40                 ` Stefan Monnier
2006-01-26 19:45                   ` Chong Yidong
2006-01-27 22:32                     ` Richard M. Stallman
2006-01-27 23:33                       ` Stefan Monnier
2006-01-29 14:53                         ` Chong Yidong
2006-01-29  4:58                       ` Chong Yidong
2006-01-30  0:57                         ` Richard M. Stallman
2006-01-30  1:06                           ` Chong Yidong
2006-01-27 22:32                   ` Richard M. Stallman
2006-01-26 19:10                 ` Chong Yidong

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=87y81b20ca.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    /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.