Bug 2108993 - Latest Emacs update (28.1-2) hanging system
Summary: Latest Emacs update (28.1-2) hanging system
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs-common-ess
Version: 36
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: José Matos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2109201 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-20 08:54 UTC by Crni Gorac
Modified: 2023-01-11 01:34 UTC (History)
19 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-01-03 01:24:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Crni Gorac 2022-07-20 08:54:36 UTC
Description of problem:

Just did "dnf update" on a F36 KDE system, that I update regularly.  Among other packages, Emacs is updated to version 28.1-2.  When started, with "emacs --no-init-file", it hangs with message "Loading /usr/share/emacs/site-lisp/site-start.d/ess-init.el (source)..." in the mode line.  It keeps cores very busy, and creates a ton of files in the /tmp directory, mostly named emacs-int-comp-subr--trampoline-...-delete_char_0-....el.  Worseover, if "emacs" command stopped by Ctrl+C, the window disappears, but there remains some emacs processes in the background creating these files.  In any case, either if initial command stopped or not, after some time the machine completely hangs.


Version-Release number of selected component (if applicable):

28.1-2


How reproducible:

Just run "emacs --no-init-file" from a terminal app.


Steps to Reproduce:

1. Run "emacs --no-init-file" from a terminal app.


Actual results:

Emacs hangs with message "Loading /usr/share/emacs/site-lisp/site-start.d/ess-init.el (source)..." in the mode line.  After some time, the whole machine hangs.


Expected results:

Emacs to work normally, without hanging itself and then the whole machine.


Additional info:

None.

Comment 1 Dan Čermák 2022-07-20 15:27:40 UTC
I cannot reproduce this at all unfortunately, emacs 28 launches instantly on my machine.

How long have you waited for the machine to become responsive again and what kind of machine is this? Emacs 28 will use libgccjit to compile all your local elisp files and that can take a bit on a weaker PC.

Do you happen to have additional elisp installed on your system? E.g. could you please run:

rpm -q --whatprovides /usr/share/emacs/site-lisp/*el

and paste the output?

Comment 2 Dan Čermák 2022-07-20 16:08:13 UTC
*** Bug 2109201 has been marked as a duplicate of this bug. ***

Comment 3 James Boyle 2022-07-20 17:41:31 UTC
It looks like subversion also includes files in site-lisp

# rpm -q --whatprovides /usr/share/emacs/site-lisp/*el
emacs-common-28.1-2.fc36.x86_64
subversion-1.14.2-5.fc36.x86_64
subversion-1.14.2-5.fc36.x86_64
emacs-common-28.1-2.fc36.x86_64
emacs-common-28.1-2.fc36.x86_64
#

Comment 4 James Boyle 2022-07-20 18:00:37 UTC
(A little more detail)

# (for X in /usr/share/emacs/site-lisp/* ; do printf "${X}: ";  rpm -q --whatprovides "${X}" ; done) |column -t
/usr/share/emacs/site-lisp/anthy:               anthy-9100h-45.fc36.x86_64
/usr/share/emacs/site-lisp/autoconf:            autoconf-2.71-2.fc36.noarch
/usr/share/emacs/site-lisp/cmake:               cmake-data-3.22.2-1.fc36.noarch
/usr/share/emacs/site-lisp/default.el:          emacs-common-28.1-2.fc36.x86_64
/usr/share/emacs/site-lisp/desktop-file-utils:  desktop-file-utils-0.26-6.fc36.x86_64
/usr/share/emacs/site-lisp/ess:                 emacs-ess-18.10.2-6.fc36.noarch
/usr/share/emacs/site-lisp/goodies:             emacs-goodies-41.0-9.fc36.noarch
/usr/share/emacs/site-lisp/libidn:              libidn-1.38-4.fc36.x86_64
/usr/share/emacs/site-lisp/psvn.el:             subversion-1.14.2-5.fc36.x86_64
/usr/share/emacs/site-lisp/psvn-init.el:        subversion-1.14.2-5.fc36.x86_64
/usr/share/emacs/site-lisp/site-start.d:        autoconf-2.71-2.fc36.noarch
emacs-filesystem-28.1-2.fc36.noarch             
emacs-common-28.1-2.fc36.x86_64                 
/usr/share/emacs/site-lisp/site-start.el:       emacs-common-28.1-2.fc36.x86_64
/usr/share/emacs/site-lisp/subdirs.el:          emacs-common-28.1-2.fc36.x86_64

# (for X in /usr/share/emacs/site-lisp/site-start.d/* ; do printf "${X}: ";  rpm -q --whatprovides "${X}" ; done) |column -t
/usr/share/emacs/site-lisp/site-start.d/anthy-init.el:               anthy-9100h-45.fc36.x86_64
/usr/share/emacs/site-lisp/site-start.d/autoconf-init.el:            autoconf-2.71-2.fc36.noarch
/usr/share/emacs/site-lisp/site-start.d/clang-format.el:             clang-tools-extra-14.0.0-1.fc36.x86_64
/usr/share/emacs/site-lisp/site-start.d/clang-include-fixer.el:      clang-tools-extra-14.0.0-1.fc36.x86_64
/usr/share/emacs/site-lisp/site-start.d/clang-rename.el:             clang-tools-extra-14.0.0-1.fc36.x86_64
/usr/share/emacs/site-lisp/site-start.d/cmake-init.el:               cmake-data-3.22.2-1.fc36.noarch
/usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el:  desktop-file-utils-0.26-6.fc36.x86_64
/usr/share/emacs/site-lisp/site-start.d/emacs-goodies-loaddefs.el:   emacs-goodies-41.0-9.fc36.noarch
/usr/share/emacs/site-lisp/site-start.d/ess-init.el:                 emacs-ess-18.10.2-6.fc36.noarch
/usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el:              rpmdevtools-9.6-1.fc36.noarch

Comment 5 Crni Gorac 2022-07-20 19:10:13 UTC
@Dan: Machine in question is Thinkpad P71, it takes about 2 minutes after starting Emacs until machine completely hangs.

Here is the output of the command you mentioned from my machine:

[root@p71 ~]# rpm -q --whatprovides /usr/share/emacs/site-lisp/*el
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
emacs-common-28.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
subversion-1.14.2-5.fc36.x86_64
subversion-1.14.2-5.fc36.x86_64
pypy3.8-libs-7.3.9-2.3.8.fc36.x86_64
pypy3.9-libs-7.3.9-2.3.9.fc36.x86_64
pypy-libs-7.3.9-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
emacs-common-28.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
maxima-5.45.1-2.fc36.x86_64
emacs-common-28.1-2.fc36.x86_64
systemtap-devel-4.7-1.fc36.x86_64
emacs-vregs-mode-1.470-28.fc36.noarch
cscope-15.9-15.fc36.x86_64

Comment 6 Dan Čermák 2022-07-20 22:05:53 UTC
Do you have emacs-ess installed?

Comment 7 Crni Gorac 2022-07-21 08:04:17 UTC
Yes, I have emacs-ess installed.  If I remove it, then Emacs would start normally; actually, it will display a warning "Warning (comp): Cannot look-up eln file as no source file was found for /usr/share/emacs/site-lisp/color-theme/color-theme.elc" in the Warnings buffer, but bunch of emacs processes would not be run and loads of files in /tmp will not be created.

BTW, the reports of this issue started to appear elsewhere too:
https://stackoverflow.com/questions/73052354/emacs-28-1-hangs-up-with-emacs-speaks-statistics-ess-package-in-fedora-36
https://www.spinics.net/linux/fedora/fedora-users/msg513979.html

Comment 8 Ranjan Maitra 2022-07-21 10:47:02 UTC
Removing emacs-ess and emacs-common-ess starts Emacs normally, but with a lot of warning messages:

To ensure normal operation, you should investigate and remove the                                                                         
cause of the error in your initialization file.  Start Emacs with                                                                         
the ‘--debug-init’ option to view a complete error backtrace. Disable showing Disable logging                                             
Warning (comp): popup.el:40:8: Warning: docstring wider than 80 characters Disable showing Disable logging                                
Warning (comp): auto-complete.el:109:1: Warning: custom-declare-variable `ac-flycheck-poll-completion-end-interval' docstring wider than \
80 characters Disable showing Disable logging                                                                                             
Warning (comp): auto-complete.el:152:1: Warning: Alias for â\200\230ac-dictionary-filesâ\200\231 should be declared before its referent D\
isable showing Disable logging                                                                                                            
Warning (comp): auto-complete.el:180:1: Warning: Alias for â\200\230ac-menu-heightâ\200\231 should be declared before its referent Disabl\
e showing Disable logging                                                                                                                 
Warning (comp): auto-complete.el:191:1: Warning: Alias for â\200\230ac-quick-help-prefer-pos-tipâ\200\231 should be declared before its r\
eferent Disable showing Disable logging                                                                                                   
Warning (comp): auto-complete.el:197:1: Warning: Alias for â\200\230ac-candidate-limitâ\200\231 should be declared before its referent Di\
sable showing Disable logging                                                                                                             
Warning (comp): auto-complete.el:264:1: Warning: custom-declare-variable `ac-auto-start' docstring wider than 80 characters Disable showi\
ng Disable logging                                                                                                                        
Warning (comp): auto-complete.el:278:1: Warning: Alias for â\200\230ac-stop-wordsâ\200\231 should be declared before its referent Disable\
 showing Disable logging                                                                                                                  
Warning (comp): auto-complete.el:304:1: Warning: custom-declare-variable `ac-use-overriding-local-map' docstring wider than 80 characters\
 Disable showing Disable logging                                                                                                          
Warning (comp): auto-complete.el:388:1: Warning: Alias for â\200\230ac-prefixâ\200\231 should be declared before its referent Disable sho\
wing Disable logging                                                                                                                      
Warning (comp): auto-complete.el:431:1: Warning: defvar `ac-mode-map' docstring wider than 80 characters Disable showing Disable logging  
Warning (comp): auto-complete.el:467:1: Warning: Alias for â\200\230ac-completing-mapâ\200\231 should be declared before its referent Dis\
able showing Disable logging                                                                                                              
Warning (comp): auto-complete.el:1258:8: Warning: docstring wider than 80 characters Disable showing Disable logging                      
Warning (comp): auto-complete-config.el:196:69: Warning: reference to free variable â\200\230prefixâ\200\231 Disable showing Disable logg\
ing                                                                                                                                       
Warning (comp): auto-complete.el:2115:1: Warning: Alias for â\200\230ac-source-featuresâ\200\231 should be declared before its referent D\
isable showing Disable logging                                                                                                            
Warning (comp): auto-complete-config.el:206:38: Warning: the function â\200\230semantic-format-tag-nameâ\200\231 is not known to be defin\
ed. Disable showing Disable logging                                                                                                       
Warning (comp): auto-complete-config.el:205:38: Warning: the function â\200\230semantic-format-tag-typeâ\200\231 is not known to be defin\
ed. Disable showing Disable logging                                                                                                       
Warning (comp): auto-complete-config.el:201:10: Warning: the function â\200\230yas-expand-snippetâ\200\231 is not known to be defined. Di\
sable showing Disable logging                                                                                                             
Warning (comp): auto-complete-config.el:200:21: Warning: the function â\200\230semantic-tag-function-argumentsâ\200\231 is not known to b\
e defined. Disable showing Disable logging                                                                                                
Warning (comp): auto-complete-config.el:197:20: Warning: the function â\200\230semantic-tag-classâ\200\231 is not known to be defined. Di\
sable showing Disable logging                                                                                                             
Warning (comp): auto-complete-config.el:196:35: Warning: the function â\200\230semantic-analyze-current-contextâ\200\231 is not known to \
be defined. Disable showing Disable logging                                                                                               
Warning (comp): auto-complete-config.el:196:29: Warning: the function â\200\230orefâ\200\231 is not known to be defined. Disable showing \
Disable logging                                                 


So, then I brought back emacs-ess (reinstalled it) and I now get:

Warning (comp): /usr/share/emacs/site-lisp/ess/ess-r-package.el: Error: Wrong number of arguments (3 . 4) Disable showing Disable logging 
                                                  
Perhaps emacs-ess needs to be updated/upgraded to account for the version change to 28.1?

Happy to provide more information.

Comment 9 Ranjan Maitra 2022-07-21 11:13:19 UTC
I have also opened an issue with emacs-ess: https://github.com/emacs-ess/ESS/issues/1207

Comment 10 Dan Čermák 2022-07-21 21:39:13 UTC
This is a bug in ESS, see https://github.com/emacs-ess/ESS/issues/1207#issuecomment-1191959376

Comment 11 Crni Gorac 2022-07-22 08:29:10 UTC
Ok, thanks.  The emacs-color-theme package should be still updated, as following warning is printed when Emacs started (with ESS packages removed):

Warning (comp): Cannot look-up eln file as no source file was found for /usr/share/emacs/site-lisp/color-theme/color-theme.elc

Comment 12 Ranjan Maitra 2022-07-22 13:31:30 UTC
(In reply to Crni Gorac from comment #11)
> Ok, thanks.  The emacs-color-theme package should be still updated, as
> following warning is printed when Emacs started (with ESS packages removed):
> 
> Warning (comp): Cannot look-up eln file as no source file was found for
> /usr/share/emacs/site-lisp/color-theme/color-theme.elc

Should this mean yet another BZ report with the emacs-color-theme-package?

Comment 13 Hin-Tak Leung 2022-07-24 01:57:45 UTC
It is not a hang - my filing is more accurate:

https://bugzilla.redhat.com/show_bug.cgi?id=2109745

emacs spawns multiple child processes, and if you notice it early enough, you can do 'kilall emacs' in a different terminal window to recover. I have a CPU monitor gnome extension running, so it was obvious for me that emacs 28 was misbebaving, way before all the multiple child processes eat up all resources, and eventually leads to hangs for other people. It did not hang for me, because I noticed it and killed it. It is not a hang. 

There are mulitple filings upstream at ess github.

Comment 14 Crni Gorac 2022-07-24 08:26:07 UTC
I see no point in nitpicking: my bug report states that Emacs hangs (don't know how else to call it, if it sits there, unresponsive, with this message about loading ess-init.el in the mode line), then that load of emacs processes get created also, and that after some time the whole system hangs.  But OK - if your report is considered more precise, someone please make this one a duplicate or yours (or vice versa, as clearly both are about the same upstream problem).

Comment 15 Ranjan Maitra 2022-07-24 13:18:50 UTC
(In reply to Crni Gorac from comment #14)
> I see no point in nitpicking: my bug report states that Emacs hangs (don't
> know how else to call it, if it sits there, unresponsive, with this message
> about loading ess-init.el in the mode line), then that load of emacs
> processes get created also, and that after some time the whole system hangs.
> But OK - if your report is considered more precise, someone please make this
> one a duplicate or yours (or vice versa, as clearly both are about the same
> upstream problem).

Completely agree, this bug report precedes the other one, and the only issue is one of language. In any case, I am interested in whatever gets this issue resolved soon!

Comment 16 Dov Grobgeld 2022-08-05 08:09:46 UTC
The exact thing happened to me. I got an infinite number of spawned emacs processes. The issues was resolved after uninstalling the emacs-ess package.

Comment 17 Hin-Tak Leung 2022-08-09 18:00:49 UTC
Hmm, the ess people are unresponsive. To be honest, I high-lighted my own filing because I think there are sufficient info there to fix the problem. I fixed a somewhat similar issue in the emacs 23 / 25 time frame. You don't have to know too much about lisp. If you have a script which can reliably / reproducibly causes emacs to go into a long spin, you just insert a few "got here location 1", "got here location 2" print statements etc until you get down to the line which triggers the problem. Then the immediate work around would be protecting the problematic line with "(emacs_major_version < 28) ...", and a longer term plan posting to emacs-devel asking the emacs people why that line causes a problem with newer emacs. The issue I had then was a script which process non-english localized (ie also non-unicode) encoded inputs. Changes within emacs caused it to go into transcoding over and over from external localised encoding to emacs' internal extended unicode encoding. There is a variable in emacs to set to do "raw input" to disable that transcoding. It looks a similar issue.

I don't use R any more - not for a few years - and have ess installed mostly as carry-over from the past, so just prefer not to spend the time on this.

Comment 18 Greg Oster 2022-08-11 17:52:00 UTC
Removal of emacs-ess and emacs-common-ess is insufficient for me.  When I run 'emacs -q -nw' I see a bunch of stuff scroll by, and with the last line being:

../../usr/share/emacs/site-lisp/uim-el/uim.el: Warning: (lambda (x) \.\.\.) quoted with ' rather than with #'

before things 'hang', and the number of emacs processes start to grow.  In my case I also need to remove uim-1.8.8-10.20200828git0c2fbfa6.fc36.x86_64
in order for 'emacs -q -nw' to work without hanging.  At that point there are 13-14 warnings in the *warnings* emacs buffer.

Comment 19 Hin-Tak Leung 2022-09-03 21:15:31 UTC
copied from https://bugzilla.redhat.com/show_bug.cgi?id=2109745 and
https://github.com/emacs-ess/ESS/issues/1222 , I believe the resource exhaustion comes from emacs trying do do "(comp--native-compile "/usr/share/emacs/site-lisp/ess/lisp/ess-custom.el" t)".

Comment 20 Ranjan Maitra 2022-12-08 21:56:49 UTC
Would something like the following fix for emacs-vm help here?

https://src.fedoraproject.org/rpms/emacs-vm/c/909b0bc357976252c51502bf17ed1efc6aeb7b97?branch=rawhide

Basically, that fix  does the following, in the vm-init.el file:

+ ;;
+ ;; For some reason, native compilation breaks VM. As a workaround until the
+ ;; problem is understood and fixed, disable native compilation of all VM
+ ;; lisp files.
+ (eval-after-load "comp"
+     '(if (boundp 'native-comp-deferred-compilation-deny-list)
+         (add-to-list 'native-comp-deferred-compilation-deny-list "/vm.*\.el")))
+
+ ;; Settings for VM itself 

Would something similar to this fix the issue with using emacs-ess for emacs 28.2?

Comment 21 Hin-Tak Leung 2022-12-25 18:21:06 UTC
No, the vm-init.el change has no effect on emacs-ess. However, we have gotten to the bottom of the problem, and there is a emacs upgrade to fix this, at https://bugzilla.redhat.com/show_bug.cgi?id=2109745#c27 . Give it a try.

Comment 22 Fedora Update System 2022-12-31 21:08:17 UTC
FEDORA-2022-e37f239f2e has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-e37f239f2e

Comment 23 Fedora Update System 2022-12-31 21:10:00 UTC
FEDORA-2022-d69c7f95a4 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-d69c7f95a4

Comment 24 Fedora Update System 2023-01-01 01:52:04 UTC
FEDORA-2022-d69c7f95a4 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-d69c7f95a4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-d69c7f95a4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 25 Fedora Update System 2023-01-01 02:00:11 UTC
FEDORA-2022-e37f239f2e has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-e37f239f2e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-e37f239f2e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 26 Fedora Update System 2023-01-03 01:24:53 UTC
FEDORA-2022-d69c7f95a4 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 27 Daniele Branchini 2023-01-10 10:23:06 UTC
Pardon me if I'm wrong, but since the bug was opened against Fedora 36 version shouldn't it be closed only when FEDORA-2022-e37f239f2e is pushed to the Fedora 36 stable repository?
Technically the issue in Fedora 36 is still present.

Comment 28 Fedora Update System 2023-01-11 01:34:33 UTC
FEDORA-2022-e37f239f2e has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.