emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clipboard hang on w32


From: Jason Rumney
Subject: Re: Clipboard hang on w32
Date: Wed, 30 Aug 2006 11:19:37 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.4) Gecko/20060516 Thunderbird/1.5.0.4 Mnenhy/0.7.4.666

Richard Stallman wrote:
I have noticed today that while pasting from Emacs to other apps, the other app seems to hang until some input event occurs in Emacs (normally when I switch to it and click on the window). I suspect that the cause is the recent changes to sit-for. I cannot reproduce the problem in emacs -Q, so there is probably some code using sit-for inappropriately, but still, I think it is a bug that sit-for prevents clipboard operations from proceeding normally.

This ought to be easy to investigate once you run it under
a debugger.
When trying this, I found that the debugger window in (a second) Emacs was hanging after about every page of output until I pressed the mouse button. I had to do this many times, as garbage collection was in progress at the time I stopped Emacs so the stack trace was almost 4000 lines long. I think this has the same cause, and is probably present on all platforms - the clipboard problem may be limited to Windows, since the clipboard is handled quite differently than other platforms.

My interpretation of the problem is that the call to sit_for in read_char is allowing the idle timers to run.These idle timers (semantic-idle-core-handler) are doing a lot of work, and using input-pending-p to allow user input to interrupt them. The problem seems to be that process-output and clipboard requests are not being handled while Emacs is inside that sit_for, so we need to interrupt the idle timer with user input. I'm not sure if the process-output not appearing is a bug in Emacs, since this situation is really no different than a long running lisp operation blocking Emacs from doing other things - the only difference being that this particular code is designed to allow the user to interrupt it with input since the author knew it would be long-running and wanted to make it a background task, but maybe the author should have taken a different approach and done small chunks of work each time the idle timer was triggered then returned control to the main lisp loop.

Clipboard operations though, should not be blocked by lisp code running, so I'll look at why this blocks and whether there is another way to implement it.


#3829 0x010596b5 in mark_object (arg=24463841) at alloc.c:5708
#3830 0x01059579 in mark_object (arg=276082221) at alloc.c:5819
#3831 0x010596b5 in mark_object (arg=24102913) at alloc.c:5708
#3832 0x010596b5 in mark_object (arg=24102937) at alloc.c:5708
#3833 0x0105969f in mark_object (arg=277153465) at alloc.c:5706
#3834 0x01059f29 in mark_object (arg=24104964) at alloc.c:5694
#3835 0x0105acd9 in Fgarbage_collect () at alloc.c:5150
#3836 0x0100bea0 in Ffuncall (nargs=3, args=0x82eca0) at eval.c:2916
#3837 0x01109b23 in Fbyte_code (bytestr=274603859, vector=273010180, maxdepth=64) at bytecode.c:679
#3838 0x0100b5fa in Feval (form=272789861) at eval.c:2319
#3839 0x0100a22c in internal_catch (tag=274582273, func=0x100b0a2 <Feval>, arg=272789861) at eval.c:1210 #3840 0x0110a14f in Fbyte_code (bytestr=274603811, vector=274586180, maxdepth=24) at bytecode.c:854 #3841 0x0100b9d6 in funcall_lambda (fun=26371108, nargs=0, arg_vector=0x82efd4) at eval.c:3169
#3842 0x0100becb in Ffuncall (nargs=1, args=0x82efd0) at eval.c:3039
#3843 0x01109b23 in Fbyte_code (bytestr=274602051, vector=26371332, maxdepth=8) at bytecode.c:679
#3844 0x0100b5fa in Feval (form=272789965) at eval.c:2319
#3845 0x0100d8cd in internal_lisp_condition_case (var=24444697, bodyform=272789965, handlers=272790261) at eval.c:1414 #3846 0x0110a103 in Fbyte_code (bytestr=274602019, vector=274586052, maxdepth=24) at bytecode.c:869 #3847 0x0100b9d6 in funcall_lambda (fun=26371300, nargs=0, arg_vector=0x82f3e8) at eval.c:3169
#3848 0x0100becb in Ffuncall (nargs=1, args=0x82f3e4) at eval.c:3039
#3849 0x0100d4ad in Fapply (nargs=2, args=0x82f3e4) at eval.c:2470
#3850 0x0100c189 in Ffuncall (nargs=3, args=0x82f3e0) at eval.c:2963
#3851 0x01109b23 in Fbyte_code (bytestr=18687611, vector=18687636, maxdepth=32) at bytecode.c:679
#3852 0x0100b5fa in Feval (form=18687597) at eval.c:2319
#3853 0x0100d8cd in internal_lisp_condition_case (var=24102913, bodyform=18687597, handlers=18687669) at eval.c:1414 #3854 0x0110a103 in Fbyte_code (bytestr=18687467, vector=18687484, maxdepth=40) at bytecode.c:869 #3855 0x0100b9d6 in funcall_lambda (fun=18687428, nargs=1, arg_vector=0x82f74c) at eval.c:3169
#3856 0x0100becb in Ffuncall (nargs=2, args=0x82f748) at eval.c:3039
#3857 0x0100d0e1 in call1 (fn=24150929, arg1=279104900) at eval.c:2763
#3858 0x01049779 in timer_check (do_it_now=1) at keyboard.c:4526
#3859 0x010926ee in wait_reading_process_output (time_limit=30, microsecs=0, read_kbd=-1, do_display=1, wait_for_cell=24102913, wait_proc=0x0, just_wait_proc=0) at process.c:4339 #3860 0x0108c25c in sit_for (timeout=240, reading=1, do_display=1) at dispnew.c:6543 #3861 0x01050fc3 in read_char (commandflag=1, nmaps=3, maps=0x82fb40, prev_event=24102913, used_mouse_menu=0x82fb88, end_time=0x0) at keyboard.c:2865 #3862 0x01052251 in read_key_sequence (keybuf=0x82fcb0, bufsize=30, prompt=24102913, dont_downcase_last=0, can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:8947
#3863 0x0105395c in command_loop_1 () at keyboard.c:1601
#3864 0x0100a2f7 in internal_condition_case (bfun=0x10537cb <command_loop_1>, handlers=24167097, hfun=0x104da1a <cmd_error>) at eval.c:1469
#3865 0x01047dd6 in command_loop_2 () at keyboard.c:1326
#3866 0x0100a22c in internal_catch (tag=24161329, func=0x1047db3 <command_loop_2>, arg=24102913) at eval.c:1210
#3867 0x01047c23 in command_loop () at keyboard.c:1305
#3868 0x01047cb7 in recursive_edit_1 () at keyboard.c:1003
#3869 0x01047d9c in Frecursive_edit () at keyboard.c:1064
#3870 0x01002a1f in main (argc=2, argv=0x1a40e10) at emacs.c:1794
#3871 0x01001237 in __mingw_CRTStartup ()
#3872 0x01001288 in mainCRTStartup ()
#3873 0x7c816fd7 in _end__ ()

Lisp Backtrace:
"byte-code" (0x105e1f53)
"semantic-idle-core-handler" (0x0)
"byte-code" (0x105e1843)
"semantic-idle-scheduler-function" (0x16fc801)
"apply" (0x105dc9f9)
"byte-code" (0x11d267b)
"timer-event-handler" (0x10a2cd84)
(gdb) cont
Continuing.

Program exited normally.
(gdb)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]