all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Chong Yidong <cyd@gnu.org>
Cc: 12242@debbugs.gnu.org, jca@wxcvbn.org, handa@m17n.org
Subject: bug#12242: Emacs 24.2 RC1 build fails on OpenBSD
Date: Fri, 24 Aug 2012 11:46:05 +0300	[thread overview]
Message-ID: <83obm08ype.fsf@gnu.org> (raw)
In-Reply-To: <87obm10y55.fsf@gnu.org>

> From: Chong Yidong <cyd@gnu.org>
> Cc: mituharu@math.s.chiba-u.ac.jp,  monnier@iro.umontreal.ca,  handa@m17n.org,  jca@wxcvbn.org,  12242@debbugs.gnu.org
> Date: Fri, 24 Aug 2012 11:25:26 +0800
> 
> > Can I have a 1-day grace to try debugging the OpenBSD crash?  Jérémie
> > generously gave me a login on the machine where it happened, and I'd
> > like a chance to try debugging it.
> 
> OK.  Good luck, and thanks for all your efforts with this bug.

I committed a fix for this as emacs-24 branch revision 108120.  It is
somewhat of a phenomenological nature, because I could not actually
catch the entire sequence of calls and actions leading to the crash,
which might have allowed me to fix the root cause where it happens, if
possible.  (It turns out OpenBSD doesn't have hardware watchpoints
support in GDB, which makes catching references to variables painfully
slow, certainly when a deadline is looming.)

I did see that the crash happens because a 'heap' structure recorded
in a memory control block maintained by ralloc.c refers to addresses
that aren't managed as part of the linked list of 'heap' structures.
It is therefore wrong to dereference such bogus 'heap' structures to
update them.  The crash happens because 'heap' pointed to memory that
was beyond our break point; however, I found that we dereference such
bogus 'heap's in more places, and survive that only because, by sheer
luck, they are still within our address space.  (ralloc.c does not
relinquish memory to the system until it has enough excess memory to
justify that.)

The solution I checked in is not to dereference 'heap' pointers that
are not in the linked list of heaps we maintain.

The fixed version survived the command that crashed and in addition 3
different bootstraps, one on OpenBSD where the crash happened and 2
more (optimized and unoptimized) on MS-Windows.  I also checked that
the MS-DOS build, which also uses ralloc.c, still works OK with the
offending commands after the patch.  Those are the only systems I have
access to which use ralloc.c.

I do suggest another pretest, to make sure this fix is solid.

I will also work on the trunk on removing calls to xmalloc inside the
functions called by maybe_unify_char, which should probably eliminate
the original problem (although they also call to make-char-table,
which still allocates memory, albeit in smaller chunks).

Thanks.






      reply	other threads:[~2012-08-24  8:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-20 19:53 bug#12242: Emacs 24.2 RC1 build fails on OpenBSD Jérémie Courrèges-Anglas
2012-08-21  3:03 ` Eli Zaretskii
2012-08-21 16:49   ` Eli Zaretskii
2012-08-21 19:23     ` Jérémie Courrèges-Anglas
2012-08-22  2:35     ` YAMAMOTO Mitsuharu
2012-08-22  3:02       ` Eli Zaretskii
2012-08-22  3:13         ` YAMAMOTO Mitsuharu
2012-08-22 16:58           ` Eli Zaretskii
2012-08-22 23:12             ` YAMAMOTO Mitsuharu
2012-08-23 16:06               ` Eli Zaretskii
2012-08-23 14:24             ` Chong Yidong
2012-08-23 16:16               ` Eli Zaretskii
2012-08-24  3:25                 ` Chong Yidong
2012-08-24  8:46                   ` Eli Zaretskii [this message]

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=83obm08ype.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=12242@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=handa@m17n.org \
    --cc=jca@wxcvbn.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.