Bug 1296686 - emacs uses 100% CPU (under Xwayland)
emacs uses 100% CPU (under Xwayland)
Product: Fedora
Classification: Fedora
Component: emacs (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jan Synacek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-01-07 15:31 EST by Zbigniew Jędrzejewski-Szmek
Modified: 2016-12-20 12:41 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 12:41:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Zbigniew Jędrzejewski-Szmek 2016-01-07 15:31:08 EST
Description of problem:
I noticed that when my gnome-shell dies, sometimes emacs keeps running in the background, using one full CPU. I'm using gnome-wayland, so emacs is running under Xwayland.

strace shows that the process is not doing any IO.

(gdb) bt
#0  0x00007fef9e0fb7a6 in XIfEvent (dpy=0x13de800, event=event@entry=0x7fff02cf2870, predicate=predicate@entry=0x7fef9e143830 <_CheckCMEvent>, arg=arg@entry=0x32b2570 "@\341@\236\357\177") at IfEvent.c:54
#1  0x00007fef9e143fc3 in _XimXRead (im=0x32b2570, recv_buf=0x7fff02cf3260 "", buf_len=2048, ret_len=0x7fff02cf29a4) at imTrX.c:476
#2  0x00007fef9e144bf7 in _XimReadData (im=im@entry=0x32b2570, len=len@entry=0x7fff02cf2a06, buf=buf@entry=0x7fff02cf3260 "", buf_size=buf_size@entry=2048) at imTransR.c:165
#3  0x00007fef9e144ed1 in _XimRead (im=im@entry=0x32b2570, len=len@entry=0x7fff02cf2a5e, buf=buf@entry=0x7fff02cf3260 "", buf_size=buf_size@entry=2048, predicate=predicate@entry=0x7fef9e1329a0 <_XimDestroyICCheck>, arg=arg@entry=0x33c2470 "\340\340@\236\357\177") at imTransR.c:235
#4  0x00007fef9e132eb0 in _XimProtoDestroyIC (xic=0x33c2470) at imDefIc.c:914
#5  0x00007fef9e120df2 in XDestroyIC (ic=0x33c2470) at ICWrap.c:265
#6  0x00000000004cffaf in free_frame_xic (f=f@entry=0x1174238) at ../../src/xfns.c:2087
#7  0x00000000004c8a7c in x_free_frame_resources (f=<optimized out>) at ../../src/xterm.c:9275
#8  0x00000000004c8f6b in x_destroy_window (f=<optimized out>) at ../../src/xterm.c:9383
#9  0x000000000042614d in delete_frame (frame=<optimized out>, force=<optimized out>) at ../../src/frame.c:1387
#10 0x00000000004bf3f0 in x_connection_closed (dpy=<optimized out>, error_message=<optimized out>) at ../../src/xterm.c:7635
#11 0x00000000004bf4ef in x_io_error_quitter (display=<optimized out>) at ../../src/xterm.c:7762
#12 0x00007fef9e11643e in _XIOError (dpy=dpy@entry=0x13de800) at XlibInt.c:1464
#13 0x00007fef9e11449a in _XReply (dpy=dpy@entry=0x13de800, rep=rep@entry=0x7fff02cf3d70, extra=extra@entry=0, discard=discard@entry=1) at xcb_io.c:708
#14 0x00007fef9e10fbdd in XSync (dpy=0x13de800, discard=0) at Sync.c:44
#15 0x00007fef9ff5db31 in gdk_window_process_all_updates () at gdkwindow.c:3785
#16 0x00007fef9ff5db31 in gdk_window_process_all_updates () at gdkwindow.c:3851
#17 0x00000000004c411b in x_catch_errors (dpy=<optimized out>) at ../../src/xterm.c:7490
#18 0x00000000004cd0d4 in x_real_positions (f=f@entry=0x1174238, xptr=xptr@entry=0x1174368, yptr=yptr@entry=0x117436c) at ../../src/xfns.c:202
#19 0x00000000004c561c in handle_one_xevent (dpyinfo=<optimized out>, event=<optimized out>, finish=<optimized out>, hold_quit=<optimized out>) at ../../src/xterm.c:6035
#20 0x00000000004c6ed2 in event_handler_gdk (gxev=<optimized out>, ev=<optimized out>, data=<optimized out>) at ../../src/xterm.c:5723
#21 0x00007fef9ff6f9b1 in gdk_event_apply_filters (xevent=xevent@entry=0x7fff02cf4550, event=event@entry=0x33cdd70, window=window@entry=0x0) at gdkeventsource.c:81
#22 0x00007fef9ff6fc70 in _gdk_x11_display_queue_events (xevent=0x7fff02cf4550, event_source=0x13db030) at gdkeventsource.c:195
#23 0x00007fef9ff6fc70 in _gdk_x11_display_queue_events (display=0x13ef010 [GdkX11Display]) at gdkeventsource.c:338
#24 0x00007fef9ff41fe9 in gdk_display_get_event (display=display@entry=0x13ef010 [GdkX11Display]) at gdkdisplay.c:340
#25 0x00007fef9ff6fa32 in gdk_event_source_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at gdkeventsource.c:360
#26 0x00007fef9e87fe3a in g_main_context_dispatch (context=0x13dc790) at gmain.c:3154
#27 0x00007fef9e87fe3a in g_main_context_dispatch (context=context@entry=0x13dc790) at gmain.c:3769
#28 0x00007fef9e8801d0 in g_main_context_iterate (context=context@entry=0x13dc790, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3840
#29 0x00007fef9e88027c in g_main_context_iteration (context=0x13dc790, context@entry=0x0, may_block=may_block@entry=1) at gmain.c:3901
#30 0x00007fefa03f6425 in gtk_main_iteration () at gtkmain.c:1342
#31 0x00000000004bf532 in XTread_socket (terminal=<optimized out>, hold_quit=<optimized out>) at ../../src/xterm.c:7016
#32 0x00000000004f35a1 in gobble_input () at ../../src/keyboard.c:6851
#33 0x00000000004f2f15 in process_pending_signals () at ../../src/keyboard.c:7091
#34 0x00000000004f2f15 in process_pending_signals () at ../../src/keyboard.c:7105
#35 0x0000000000546c4a in Fmake_list (length=length@entry=176, init=12331890) at ../../src/alloc.c:2637
#36 0x00000000005675e1 in concat (nargs=nargs@entry=1, args=args@entry=0x7fff02cf4968, target_type=Lisp_Cons, last_special=last_special@entry=false) at ../../src/fns.c:588
#37 0x0000000000567c00 in Fcopy_sequence (arg=61999366) at ../../src/fns.c:456
#38 0x00000000004f19a2 in timer_check () at ../../src/keyboard.c:4569
#39 0x00000000004f1f39 in readable_events (flags=1) at ../../src/keyboard.c:3448
#40 0x00000000004f36b8 in get_input_pending (flags=flags@entry=1) at ../../src/keyboard.c:6766
#41 0x00000000004f68b8 in detect_input_pending_run_timers (do_display=do_display@entry=true) at ../../src/keyboard.c:9895
#42 0x00000000005a277b in wait_reading_process_output (time_limit=time_limit@entry=0, nsecs=nsecs@entry=0, read_kbd=read_kbd@entry=-1, do_display=true, wait_for_cell=12331890, wait_proc=wait_proc@entry=0x0, just_wait_proc=0) at ../../src/process.c:4702
#43 0x00000000004f3ef1 in read_decoded_event_from_main_queue (end_time=0x0, used_mouse_menu=0x7fff02cf53db, kbp=<synthetic pointer>) at ../../src/keyboard.c:3907
#44 0x00000000004f3ef1 in read_decoded_event_from_main_queue (used_mouse_menu=0x7fff02cf53db, local_getcjmp=0x7fff02cf5130, end_time=0x0) at ../../src/keyboard.c:2247
#45 0x00000000004f3ef1 in read_decoded_event_from_main_queue (end_time=end_time@entry=0x0, local_getcjmp=local_getcjmp@entry=0x7fff02cf5130, prev_event=prev_event@entry=12331890, used_mouse_menu=used_mouse_menu@entry=0x7fff02cf53db) at ../../src/keyboard.c:2310
#46 0x00000000004f79c4 in read_char (commandflag=1, map=map@entry=68912678, prev_event=12331890, used_mouse_menu=used_mouse_menu@entry=0x7fff02cf53db, end_time=end_time@entry=0x0) at ../../src/keyboard.c:2896
#47 0x00000000004f8a88 in read_key_sequence (keybuf=keybuf@entry=0x7fff02cf54e0, prompt=12331890, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false, bufsize=30) at ../../src/keyboard.c:9089
#48 0x00000000004fa88e in command_loop_1 () at ../../src/keyboard.c:1453
#49 0x000000000055fd87 in internal_condition_case (bfun=bfun@entry=0x4fa670 <command_loop_1>, handlers=<optimized out>, hfun=hfun@entry=0x4f11c0 <cmd_error>) at ../../src/eval.c:1348
#50 0x00000000004ec642 in command_loop_2 (ignore=ignore@entry=12331890) at ../../src/keyboard.c:1178
#51 0x000000000055fc6b in internal_catch (tag=12379170, func=func@entry=0x4ec620 <command_loop_2>, arg=12331890) at ../../src/eval.c:1112
#52 0x00000000004f0d83 in recursive_edit_1 () at ../../src/keyboard.c:1157
#53 0x00000000004f0d83 in recursive_edit_1 () at ../../src/keyboard.c:778
#54 0x00000000004f10d8 in Frecursive_edit () at ../../src/keyboard.c:849
#55 0x0000000000418587 in main (argc=<optimized out>, argv=0x7fff02cf5848) at ../../src/emacs.c:1642

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

How reproducible:
Not really sure, seems to happen quite often when the conditions are met.

Actual results:
emacs continues running after the display to which it was attached is gone.

Expected results:
Anything graphical dies along with the graphical environment.
Comment 1 Jan Synacek 2016-01-08 02:26:33 EST
Any chance updating the kernel resolves this? See bug #1290466.
Comment 2 Zbigniew Jędrzejewski-Szmek 2016-01-08 15:19:26 EST
Nice bug :) But I'm running kernel-4.2.6-301.fc23.x86_64 atm, so I don't think this can the same bug.
Comment 3 Fedora End Of Life 2016-11-24 09:46:16 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 4 Fedora End Of Life 2016-12-20 12:41:17 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

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