Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 935027 - >=sys-devel/gcc-14: bad malloc alignment causes Emacs build failure (app-editors/emacs-29.4 fails to compile on hppa: Memory exhausted--use M-x save-some-buffers then exit and restart Emacs)
Summary: >=sys-devel/gcc-14: bad malloc alignment causes Emacs build failure (app-edit...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: HPPA Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard: fixed in 14.1.1_p20240706
Keywords:
Depends on:
Blocks: gcc-14 gcc-14-stable
  Show dependency tree
 
Reported: 2024-06-27 18:13 UTC by matoro
Modified: 2024-11-02 02:25 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log and emerge --info (file_935027.txt,105.20 KB, text/plain)
2024-06-27 18:13 UTC, matoro
Details
build.log and emerge --info (file_935027.txt,513.16 KB, text/plain)
2024-06-27 18:13 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2024-06-27 18:13:22 UTC
Created attachment 896531 [details]
build.log and emerge --info

This is present for both stable and unstable emacs versions.  Works with gcc-13, but when using gcc-14, it fails to compile with:

Loading loadup.el (source)...
Dump mode: pbootstrap
Using load-path (/var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/lisp /var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/lisp/emacs-lisp /var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/lisp/progmodes /var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/lisp/language /var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/lisp/international /var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/lisp/textmodes /var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/lisp/vc)
Loading emacs-lisp/debug-early...
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading keymap...
Memory exhausted--use M-x save-some-buffers then exit and restart Emacs
make[2]: *** [Makefile:923: bootstrap-emacs.pdmp] Error 255
make[2]: Leaving directory '/var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4/src'
make[1]: *** [Makefile:544: src] Error 2
make[1]: Leaving directory '/var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4'
make[1]: Entering directory '/var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4'
***
*** "make all" failed with exit status 2.
***
*** You could try to:
*** - run "make bootstrap", which might fix the problem
*** - run "make V=1", which displays the full commands invoked by make,
***   to further investigate the problem
***
make[1]: *** [Makefile:414: advice-on-failure] Error 2
make[1]: Leaving directory '/var/tmp/portage/app-editors/emacs-29.4/work/emacs-29.4'
make: *** [Makefile:370: all] Error 2
Comment 1 matoro archtester 2024-06-27 18:13:51 UTC
Created attachment 896532 [details]
build.log and emerge --info

For comparison, build with gcc-13.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-28 12:34:12 UTC
My notes suggest it might be -ffold-mem-offsets which is a new pass in GCC 14. We had a few problems with it on HPPA. I thought they were all fixed...
Comment 3 matoro archtester 2024-06-28 15:39:44 UTC
(In reply to Sam James from comment #2)
> My notes suggest it might be -ffold-mem-offsets which is a new pass in GCC
> 14. We had a few problems with it on HPPA. I thought they were all fixed...

Tried with -fno-fold-mem-offsets, no luck.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-28 15:41:17 UTC
Thanks, I'll poke more. Just upgrading the machine first.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-02 09:21:56 UTC
0ee3266b3dec4d984d43c79e2b3e649256e3eaaa is the first bad commit
commit 0ee3266b3dec4d984d43c79e2b3e649256e3eaaa
Author: John David Anglin <danglin@gcc.gnu.org>
Date:   Thu Oct 5 20:05:00 2023 +0000

    Delete MALLOC_ABI_ALIGNMENT define from pa32-linux.h

    2023-10-05  John David Anglin  <danglin@gcc.gnu.org>

            * config/pa/pa32-linux.h (MALLOC_ABI_ALIGNMENT): Delete.

 gcc/config/pa/pa32-linux.h | 5 -----
 1 file changed, 5 deletions(-)
bisect found first bad commit

--

If that's right (not yet confirmed), that's interesting, as we had discussion about it on the glibc side. See https://inbox.sourceware.org/libc-alpha/668d1c2d-1b02-bea8-d5a7-ea8a044f3f97@bell.net/.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-02 09:31:16 UTC
Emailed Dave & Helge for some help. I'm looking in the Emacs source but I don't see anywhere they would rely on this...
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-04 05:44:40 UTC
Dave has fixed this in GCC. It'll be in the next 14/15 snapshots.
Comment 8 Larry the Git Cow gentoo-dev 2024-07-06 22:45:29 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5540fdcede357cfa08ef6c83699bb5b4c72a982

commit e5540fdcede357cfa08ef6c83699bb5b4c72a982
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-07-06 22:45:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-07-06 22:45:06 +0000

    sys-devel/gcc: add 14.1.1_p20240706
    
    Bug: https://bugs.gentoo.org/935027
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/Manifest                    |  1 +
 sys-devel/gcc/gcc-14.1.1_p20240706.ebuild | 55 +++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-02 02:25:49 UTC
Fixed.