From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John Paul Adrian Glaubitz Newsgroups: gmane.emacs.bugs Subject: bug#35711: emacs crashes on m68k after d2f1971dd5 Date: Mon, 13 May 2019 14:15:16 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B72FE3757CEA614EF5F267D1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="65138"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Cc: Andreas Schwab , Michael Karcher , Paul Eggert To: 35711@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 13 14:34:06 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQA9e-000GmB-Ap for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 14:34:06 +0200 Original-Received: from localhost ([127.0.0.1]:56561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQA9d-0001fO-Bi for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 08:34:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQA7f-0000Ut-Uh for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:32:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQA7e-0000tU-9S for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQA7e-0000tM-54 for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQA7d-0008R4-W7 for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Paul Adrian Glaubitz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 May 2019 12:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35711 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155775069632386 (code B ref -1); Mon, 13 May 2019 12:32:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 May 2019 12:31:36 +0000 Original-Received: from localhost ([127.0.0.1]:44393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQA7D-0008QI-MD for submit@debbugs.gnu.org; Mon, 13 May 2019 08:31:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59527) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQA7B-0008Q2-Dl for submit@debbugs.gnu.org; Mon, 13 May 2019 08:31:35 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:58238) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQA76-0000fX-8i for submit@debbugs.gnu.org; Mon, 13 May 2019 08:31:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQA74-0008H7-Pa for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:31:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQ9rd-0001xR-7N for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:15:31 -0400 Original-Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:43373) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQ9ra-0001ob-7C for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:15:27 -0400 Original-Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (envelope-from ) id <1hQ9rR-001Reb-Hr>; Mon, 13 May 2019 14:15:17 +0200 Original-Received: from suse-laptop.physik.fu-berlin.de ([160.45.32.140]) by inpost2.zedat.fu-berlin.de (Exim 4.85) with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (envelope-from ) id <1hQ9rQ-001RMK-UE>; Mon, 13 May 2019 14:15:17 +0200 Openpgp: preference=signencrypt Autocrypt: addr=glaubitz@physik.fu-berlin.de; keydata= mQINBE3JE9wBEADMrYGNfz3oz6XLw9XcWvuIxIlPWoTyw9BxTicfGAv0d87wngs9U+d52t/R EggPePf34gb7/k8FBY1IgyxnZEB5NxUb1WtW0M3GUxpPx6gBZqOm7SK1ZW3oSORw+T7Aezl3 Zq4Nr4Nptqx7fnLpXfRDs5iYO/GX8WuL8fkGS/gIXtxKewd0LkTlb6jq9KKq8qn8/BN5YEKq JlM7jsENyA5PIe2npN3MjEg6p+qFrmrzJRuFjjdf5vvGfzskrXCAKGlNjMMA4TgZvugOFmBI /iSyV0IOaj0uKhes0ZNX+lQFrOB4j6I5fTBy7L/T3W/pCWo3wVkknNYa8TDYT73oIZ7Aimv+ k7OzRfnxsSOAZT8Re1Yt8mvzr6FHVFjr/VdyTtO5JgQZ6LEmvo4Ro+2ByBmCHORCQ0NJhD1U 3avjGfvfslG999W0WEZLTeaGkBAN1yG/1bgGAytQQkD9NsVXqBy7S3LVv9bB844ysW5Aj1nv tgIz14E2WL8rbpfjJMXi7B5ha6Lxf3rFOgxpr6ZoEn+bGG4hmrO+/ReA4SerfMqwSTnjZsZv xMJsx2B9c8DaZE8GsA4I6lsihbJmXhw8i7Cta8Dx418wtEbXhL6m/UEk60O7QD1VBgGqDMnJ DFSlvKa9D+tZde/kHSNmQmLLzxtDbNgBgmR0jUlmxirijnm8bwARAQABtFRKb2huIFBhdWwg QWRyaWFuIEdsYXViaXR6IChGcmVpZSBVbml2ZXJzaXRhZXQgQmVybGluKSA8Z2xhdWJpdHpA cGh5c2lrLmZ1LWJlcmxpbi5kZT6JAl Content-Language: en-US X-Originating-IP: 160.45.32.140 X-ZEDAT-Hint: A X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159173 Archived-At: This is a multi-part message in MIME format. --------------B72FE3757CEA614EF5F267D1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hello! The commit [1] "Port flexible array members to GCC + valgrind" (d2f1971dd5) broke emacs on m68k. This is because the new code aligns blocks of 1-byte strings to 16 bit on m68k which is the default alignment on m68k. The crash on m68k looks like this [2]: /bin/mkdir -p ../etc /usr/bin/make -C ../lisp update-subdirs make[4]: Entering directory '/<>/emacs-26.1+1/debian/build-gtk/lisp' make[4]: Leaving directory '/<>/emacs-26.1+1/debian/build-gtk/lisp' ./temacs --batch --load loadup bootstrap Loading loadup.el (source)... Using load-path (/<>/emacs-26.1+1/debian/build-src/lisp /<>/emacs-26.1+1/debian/build-src/lisp/emacs-lisp /<>/emacs-26.1+1/debian/build-src/lisp/progmodes /<>/emacs-26.1+1/debian/build-src/lisp/language /<>/emacs-26.1+1/debian/build-src/lisp/international /<>/emacs-26.1+1/debian/build-src/lisp/textmodes /<>/emacs-26.1+1/debian/build-src/lisp/vc) Loading emacs-lisp/byte-run (source)... Loading emacs-lisp/backquote (source)... Loading subr (source)... qemu: uncaught target signal 11 (Segmentation fault) - core dumped make[3]: *** [Makefile:738: bootstrap-emacs] Segmentation fault The attached patch by Michael Karcher fixes the problem. Thanks, Adrian > [1] http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d2f1971dd570439da4198fa76603b53b072060f8 > [2] https://buildd.debian.org/status/fetch.php?pkg=emacs&arch=m68k&ver=1%3A26.1%2B1-3.2&stamp=1549253883&raw=0 -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 --------------B72FE3757CEA614EF5F267D1 Content-Type: text/x-patch; name="fix-m68k-crash.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-m68k-crash.patch" --- emacs-26.1+1.orig/src/alloc.c +++ emacs-26.1+1/src/alloc.c @@ -1766,14 +1766,14 @@ static char const string_overrun_cookie[ /* The 'max' reserves space for the nbytes union member even when NBYTES + 1 is less than the size of that member. The 'max' is not needed when - SDATA_DATA_OFFSET is a multiple of FLEXALIGNOF (struct sdata), - because then the alignment code reserves enough space. */ + the tail padding of "struct sdata" with a single payload byte is big enough + to accomodate the full union "sdata". */ #define SDATA_SIZE(NBYTES) \ ((SDATA_DATA_OFFSET \ - + (SDATA_DATA_OFFSET % FLEXALIGNOF (struct sdata) == 0 \ - ? NBYTES \ - : max (NBYTES, FLEXALIGNOF (struct sdata) - 1)) \ + + (FLEXSIZEOF (struct sdata, data, 1) < sizeof (sdata) \ + ? max (NBYTES, sizeof (sdata) - SDATA_DATA_OFFSET - 1) \ + : NBYTES) \ + 1 \ + FLEXALIGNOF (struct sdata) - 1) \ & ~(FLEXALIGNOF (struct sdata) - 1)) --------------B72FE3757CEA614EF5F267D1--