GNU bug report logs - #8437
Emacs crash when building with --enable-checking on Mac OS X

Previous Next

Packages: ns, emacs;

Reported by: Ben Key <bkey76 <at> gmail.com>

Date: Thu, 7 Apr 2011 02:39:02 UTC

Severity: normal

Done: Andreas Schwab <schwab <at> linux-m68k.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8437 in the body.
You can then email your comments to 8437 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8437; Package emacs. (Thu, 07 Apr 2011 02:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ben Key <bkey76 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 Apr 2011 02:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ben Key <bkey76 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs crash when building with --enable-checking on Mac OS X
Date: Wed, 6 Apr 2011 21:37:42 -0500
[Message part 1 (text/plain, inline)]
When Emacs is configured with --enable-checking=xmallocoverrun on Mac OS X,
Emacs crashes during the build process.  The error is as follows.

temacs(20348,0x7fff70e01ca0) malloc: *** error for object 0x10076c010:
Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
/bin/sh: line 1: 20348 Abort trap              `/bin/pwd`/temacs --batch
--load loadup bootstrap
make[1]: *** [bootstrap-emacs] Error 1

Note that I set attempted to debug the problem with gdb.  I set a breakpoint
in malloc_error_break as directed by the error message.  The resulting
backtrace is as follows.

#0  0x00007fff86eed779 in malloc_error_break ()
#1  0x00007fff86eee8d0 in szone_error ()
#2  0x000000010020205a in unexec_free (ptr=0x10076c018) at unexmacosx.c:1384
#3  0x0000000100091387 in Fclear_charset_maps () at charset.c:2141
#4  0x00000001001a4b7a in eval_sub (form=4337996870) at eval.c:2360
#5  0x00000001001d7241 in readevalloop (readcharfun=4320321402,
stream=0x7fff70e03f40, sourcename=4320479449, printflag=0,
unibyte=4320145482, readfun=4320145482, start=4320145482, end=4320145482) at
lread.c:1806
#6  0x00000001001d5722 in Fload (file=4320479193, noerror=4320145482,
nomessage=4320145482, nosuffix=4320145482, must_suffix=4320145482) at
lread.c:1284
#7  0x00000001001a4c5a in eval_sub (form=4320150710) at eval.c:2377
#8  0x00000001001a439b in Feval (form=4320150710, lexical=4320145482) at
eval.c:2213
#9  0x00000001000f06c1 in top_level_2 () at keyboard.c:1137
#10 0x00000001001a2a83 in internal_condition_case (bfun=0x1000f06a0
<top_level_2>, handlers=4320211690, hfun=0x1000f0169 <cmd_error>) at
eval.c:1491
#11 0x00000001000f0709 in top_level_1 (ignore=4320145482) at keyboard.c:1145
#12 0x00000001001a23b1 in internal_catch (tag=4320206362, func=0x1000f06c3
<top_level_1>, arg=4320145482) at eval.c:1238
#13 0x00000001000f0603 in command_loop () at keyboard.c:1100
#14 0x00000001000efbf1 in recursive_edit_1 () at keyboard.c:730
#15 0x00000001000efded in Frecursive_edit () at keyboard.c:792
#16 0x00000001000edd46 in main (argc=5, argv=0x7fff5fbff9c8) at emacs.c:1685

Steps to reproduce:

1.  Configure Emacs using the following command on Mac OS X.
    ./configure --enable-checking=xmallocoverrun --with-ns CFLAGS='-g3 -O0'
2.  Build Emacs using the following command.
    make install
3.  Emacs crashes when " `/bin/pwd`/temacs --batch --load loadup bootstrap"
is called.
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8437; Package emacs,ns. (Thu, 07 Apr 2011 07:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 8437 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ben Key <bkey76 <at> gmail.com>
Cc: 8437 <at> debbugs.gnu.org
Subject: Re: bug#8437: Emacs crash when building with --enable-checking on Mac
	OS X
Date: Thu, 07 Apr 2011 03:31:52 -0400
> From: Ben Key <bkey76 <at> gmail.com>
> Date: Wed, 6 Apr 2011 21:37:42 -0500
> Cc: 
> 
> [1:text/plain Hide]
> When Emacs is configured with --enable-checking=xmallocoverrun on Mac OS X,
> Emacs crashes during the build process.  The error is as follows.
> 
> temacs(20348,0x7fff70e01ca0) malloc: *** error for object 0x10076c010:
> Non-aligned pointer being freed (2)
> *** set a breakpoint in malloc_error_break to debug
> /bin/sh: line 1: 20348 Abort trap              `/bin/pwd`/temacs --batch
> --load loadup bootstrap
> make[1]: *** [bootstrap-emacs] Error 1

Thanks.  Can you try bisecting to find the commit which introduced
this problem?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8437; Package emacs,ns. (Tue, 12 Apr 2011 06:18:02 GMT) Full text and rfc822 format available.

Message #11 received at 8437 <at> debbugs.gnu.org (full text, mbox):

From: Ben Key <bkey76 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 8437 <at> debbugs.gnu.org
Subject: Re: bug#8437: Emacs crash when building with --enable-checking on Mac
	OS X
Date: Tue, 12 Apr 2011 01:17:10 -0500
[Message part 1 (text/plain, inline)]
Hello,

I have made an attempt to track down the cause of this bug.

After
  bzr revert -r 103045
Emacs builds when I configure it with
  ./configure --enable-checking=xmallocoverrun --with-ns CFLAGS='-g3 -O0'

After
  bzr revert -r 103046
the error "temacs(74585,0x7fff70e01ca0) malloc: *** error for object
0x100768010: Non-aligned pointer being freed (2)" occurs during the call to
"`/bin/pwd`/temacs --batch --load loadup bootstrap."

The changes made in revision 103046 are as follows:

=== modified file 'src/ChangeLog'
--- src/ChangeLog    2011-01-30 23:34:18 +0000
+++ src/ChangeLog    2011-01-31 07:34:45 +0000
@@ -1,3 +1,8 @@
+2011-01-31  Jim Meyering  <meyering <at> redhat.com>
+
+    * charset.c (load_charset_map): Don't deref NULL on failed malloc.
+    Use xmalloc rather than malloc.
+
 2011-01-30  Paul Eggert  <eggert <at> cs.ucla.edu>

     strftime: import from gnulib

=== modified file 'src/charset.c'
--- src/charset.c    2011-01-25 04:08:28 +0000
+++ src/charset.c    2011-01-31 07:34:45 +0000
@@ -292,7 +292,7 @@
       else
     {
       if (! temp_charset_work)
-        temp_charset_work = malloc (sizeof (*temp_charset_work));
+        temp_charset_work = xmalloc (sizeof (*temp_charset_work));
       if (control_flag == 1)
         {
           memset (temp_charset_work->table.decoder, -1,
[Message part 2 (text/html, inline)]

Reply sent to Andreas Schwab <schwab <at> linux-m68k.org>:
You have taken responsibility. (Tue, 12 Apr 2011 10:25:02 GMT) Full text and rfc822 format available.

Notification sent to Ben Key <bkey76 <at> gmail.com>:
bug acknowledged by developer. (Tue, 12 Apr 2011 10:25:02 GMT) Full text and rfc822 format available.

Message #16 received at 8437-done <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Ben Key <bkey76 <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 8437-done <at> debbugs.gnu.org
Subject: Re: bug#8437: Emacs crash when building with --enable-checking on Mac
	OS X
Date: Tue, 12 Apr 2011 12:24:43 +0200
Should be fixed now.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 10 May 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 102 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.