GNU bug report logs - #33709
Hang when compiled with --coverage and gcc 7.3

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Tue, 11 Dec 2018 19:00:02 UTC

Severity: minor

Found in version 27.0.50

Fixed in version 29.0.50

Done: Glenn Morris <rgm <at> gnu.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 33709 in the body.
You can then email your comments to 33709 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 bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Tue, 11 Dec 2018 19:00:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: Hang when compiled with --coverage and gcc 7.3
Date: Tue, 11 Dec 2018 13:59:34 -0500
Package: emacs
Version: 27.0.50

The Emacs hydra jobset at https://hydra.nixos.org/jobset/gnu/emacs-trunk
was recently updated to a more recent version of the Nix package
collection. Ever since then, the "coverage" job (which is the one that
runs "make check") has timed out after spending hours failing to
compiled the first test .el file.

I have reproduced the problem on RHEL 7.6 as follows:

bootstrap as normal
./make-dist --snapshot --no-check --no-changelog --no-compress
tar xvf ../emacs-27.0.50.tar
cd emacs-27.0.50

scl enable devtoolset-7  # this enables gcc 7.3.1 as the default compiler
export CFLAGS=--coverage
./configure --without-all --without-x --without-libgmp
make -j8

The build completes fine, but now eg:

./src/emacs --help

never exits. It prints the usage message, then hangs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Tue, 11 Dec 2018 19:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 33709 <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Tue, 11 Dec 2018 21:27:39 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Tue, 11 Dec 2018 13:59:34 -0500
> 
> The Emacs hydra jobset at https://hydra.nixos.org/jobset/gnu/emacs-trunk
> was recently updated to a more recent version of the Nix package
> collection. Ever since then, the "coverage" job (which is the one that
> runs "make check") has timed out after spending hours failing to
> compiled the first test .el file.

Why do we use --coverage when running the test suite?

> bootstrap as normal
> ./make-dist --snapshot --no-check --no-changelog --no-compress
> tar xvf ../emacs-27.0.50.tar
> cd emacs-27.0.50
> 
> scl enable devtoolset-7  # this enables gcc 7.3.1 as the default compiler
> export CFLAGS=--coverage
> ./configure --without-all --without-x --without-libgmp
> make -j8
> 
> The build completes fine, but now eg:
> 
> ./src/emacs --help
> 
> never exits. It prints the usage message, then hangs.

"Hangs" as in "infloops"?  If so, where does it infloop?
Or does "hangs" mean something else here?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Tue, 11 Dec 2018 19:47:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33709 <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Tue, 11 Dec 2018 14:46:50 -0500
Eli Zaretskii wrote:

> Why do we use --coverage when running the test suite?

I used the pre-existing, standard hydra "coverage" job for make check.
It goes on to make this kind of report.

https://hydra.nixos.org/build/85820625/download/2/coverage/

>> never exits. It prints the usage message, then hangs.
>
> "Hangs" as in "infloops"?  If so, where does it infloop?
> Or does "hangs" mean something else here?

I do give a recipe in the hope that others can investigate the issue.
Anyway, the Emacs process uses 100% CPU, apparently doing nothing.
strace shows nothing. I managed to get the following from gdb.
The only relevant link I found was
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83074
This is all above my pay grade.

#0  0x00000000007bd1b2 in gcov_do_dump ()
No symbol table info available.
#1  0x00000000007be562 in __gcov_exit ()
No symbol table info available.
#2  0x00000000007bc42c in _GLOBAL__sub_D_00100_1_set_permissions.c ()
    at set-permissions.c:847
No locals.
#3  0x00007ffff7de73b7 in _dl_fini ()
   from /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/ld-linux-x86-64.so.2
No symbol table info available.
#4  0x00007ffff6e2c351 in __run_exit_handlers ()
   from /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6
No symbol table info available.
#5  0x00007ffff6e2c43a in exit ()
   from /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6
No symbol table info available.
#6  0x00000000005768a7 in main (argc=2, argv=0x7fffffff3c58) at emacs.c:992
        i = 12
        stack_bottom_variable = 0xb01045 <pure+742821>
        do_initial_setlocale = true
        dumping = false
        skip_args = 1
        no_loadup = false
        junk = 0x0
        dname_arg = 0x0
        ch_to_dir = 0x0
        original_pwd = 0x0
        rlim = {rlim_cur = 33554432, rlim_max = 18446744073709551615}
        sockfd = 0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Tue, 11 Dec 2018 20:38:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33709 <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Tue, 11 Dec 2018 15:37:07 -0500
No such issue with gcc 6.3.1.
Perhaps/probably it is a gcc bug.
I'm hoping Paul will stop by and work one of his "Port to gcc XXX"
wonders as a work around... :)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Thu, 13 Dec 2018 19:41:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: 33709 <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Thu, 13 Dec 2018 14:40:33 -0500
On hydra, I had to drop all the way back to gcc 4.8 for this issue to go
away. It still hung with gcc 5.5.0 (https://hydra.nixos.org/build/85827904)
and 6.4.0 (https://hydra.nixos.org/build/85827876).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Thu, 13 Dec 2018 19:55:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 33709 <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Thu, 13 Dec 2018 21:54:29 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Thu, 13 Dec 2018 14:40:33 -0500
> 
> On hydra, I had to drop all the way back to gcc 4.8 for this issue to go
> away. It still hung with gcc 5.5.0 (https://hydra.nixos.org/build/85827904)
> and 6.4.0 (https://hydra.nixos.org/build/85827876).

Was GCC 4.8 the version used on hydra before you upgraded to 7.4?

I hope Paul will look at this, but personally I'm very surprised that
"--coverage" at all works in a dumped Emacs, given the way it's
triggered (ctors and dtors).  It would be nice to have it working, of
course, if that's feasible.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Fri, 28 Dec 2018 04:08:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <paul.eggert <at> verizon.net>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 33709 <at> debbugs.gnu.org
Subject: Hang when compiled with --coverage and gcc 7.3
Date: Thu, 27 Dec 2018 20:06:56 -0800
I'm surprised that --coverage ever worked in a dumped emacs. I think libgcov 
uses the dynamic linker's malloc (so Emacs has *three* malloc implementations) 
and our trick for switching from the Emacs malloc in temacs to the system malloc 
in bootstrap-emacs won't work for memory allocated for --coverage. 
Unfortunately, the libgcov actions do not seem to be easy to disable in temacs 
and re-enable in bootstrap-emacs.

I suggest that we just say this combination isn't supported; if you want to 
build Emacs with gcc --coverage you can configure with CANNOT_DUMP=yes.

If the portable dumper ever gets working, --coverage should be easy to support, 
of course.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Mon, 31 Aug 2020 10:37:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Paul Eggert <paul.eggert <at> verizon.net>
Cc: Glenn Morris <rgm <at> gnu.org>, 33709 <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Mon, 31 Aug 2020 10:36:36 +0000
Paul Eggert <paul.eggert <at> verizon.net> writes:

> I'm surprised that --coverage ever worked in a dumped emacs. I think libgcov
> uses the dynamic linker's malloc (so Emacs has *three* malloc implementations)
> and our trick for switching from the Emacs malloc in temacs to the system malloc
> in bootstrap-emacs won't work for memory allocated for
> --coverage. Unfortunately, the libgcov actions do not seem to be easy to disable
> in temacs and re-enable in bootstrap-emacs.
>
> I suggest that we just say this combination isn't supported; if you want to
> build Emacs with gcc --coverage you can configure with CANNOT_DUMP=yes.
>
> If the portable dumper ever gets working, --coverage should be easy to support,
> of course.

(That was 1.5 years ago.)

Any updates here now that we have the portable dumper?  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33709; Package emacs. (Sat, 29 Jan 2022 15:19:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 33709 <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Sat, 29 Jan 2022 16:18:48 +0100
Glenn Morris <rgm <at> gnu.org> writes:

> The Emacs hydra jobset at https://hydra.nixos.org/jobset/gnu/emacs-trunk
> was recently updated to a more recent version of the Nix package
> collection. Ever since then, the "coverage" job (which is the one that
> runs "make check") has timed out after spending hours failing to
> compiled the first test .el file.
>
> I have reproduced the problem on RHEL 7.6 as follows:

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Is this still a problem with the current Emacs/gcc versions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 29 Jan 2022 15:20:02 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Glenn Morris <rgm <at> fencepost.gnu.org> to control <at> debbugs.gnu.org. (Sat, 29 Jan 2022 19:15:02 GMT) Full text and rfc822 format available.

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 29 Jan 2022 19:19:02 GMT) Full text and rfc822 format available.

Notification sent to Glenn Morris <rgm <at> gnu.org>:
bug acknowledged by developer. (Sat, 29 Jan 2022 19:19:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: 33709-done <at> debbugs.gnu.org
Subject: Re: bug#33709: Hang when compiled with --coverage and gcc 7.3
Date: Sat, 29 Jan 2022 14:18:00 -0500
Version: 29.0.50

In https://hydra.nixos.org/build/165911357 I stopped forcing gcc 4.8
in the coverage build. It worked ok with gcc 7.3.0.

Ref
http://git.savannah.gnu.org/cgit/hydra-recipes.git/diff/?id=f7344f0e8d56f57de28d4259db96e31f6a013812&id2=5686a5540572a2a6fbc2ba81a429ebdb36fcb631




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Feb 2022 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 136 days ago.

Previous Next


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