Open bgoodr opened 6 years ago
Wow. Thank you so much for this extensive report and the work you put into it! I'm afraid I do not currently have the time to look closer into it, but I'll try to revisit this next week.
You are most welcome. I am very very thankful for the efforts you do put in when time permits. This is not critical ... I have my workaround in place.
Hm. I just did docker run --rm -it ubuntu:17.10 bash
, used apt-get install emacs python python-pip
and tried your reproduction script. I could type print
without any error. :-(
That is interesting, but I don't use docker. Given that there are timers involved, this may be timing sensitive. I don't know how the use of docker would affect that timing. This may actually be an issue with the vanilla Emacs somehow, but that is pure speculation.
I am in the middle of a house move so I can't play around with this for about another month or 3. I'll revisit it then ... maybe with a clearer head and mindset to come up with a debug ritual.
That is interesting, but I don't use docker.
Yeah, well, I don't use Ubuntu nor Emacs 25.2, so this is the closest I can get to your setup I'm afraid. If it is indeed a timing issue, I might not be able to reproduce it on my hardware at all. I'm sorry I can't be of more use here :-(
You could try and evaluate the following form, maybe that will help producing a traceback with debug-on-error
:
(defun elpy-promise-resolve (promise value)
"Resolve PROMISE with VALUE."
(when (not (elpy-promise-resolved-p promise))
(unwind-protect
(let ((success-callback (elpy-promise-success-callback promise)))
(when success-callback
(with-current-buffer (elpy-promise-buffer promise)
(funcall success-callback value))))
(elpy-promise-set-resolved promise))))
Duly noted. I'll try that later on when I can.
On Fri, Jul 6, 2018 at 9:14 AM Jorgen Schäfer notifications@github.com wrote:
That is interesting, but I don't use docker.
Yeah, well, I don't use Ubuntu nor Emacs 25.2, so this is the closest I can get to your setup I'm afraid. If it is indeed a timing issue, I might not be able to reproduce it on my hardware at all. I'm sorry I can't be of more use here :-(
You could try and evaluate the following form, maybe that will help producing a traceback with debug-on-error:
(defun elpy-promise-resolve (promise value) "Resolve PROMISE with VALUE." (when (not (elpy-promise-resolved-p promise)) (unwind-protect (let ((success-callback (elpy-promise-success-callback promise))) (when success-callback (with-current-buffer (elpy-promise-buffer promise) (funcall success-callback value)))) (elpy-promise-set-resolved promise))))
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jorgenschaefer/elpy/issues/1396#issuecomment-403079640, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIoBzshgoM-eXuoBB8CQoGDFoClPLH-ks5uD4z8gaJpZM4UrAO4 .
Emacs 26.1, latest Elpy and company here. Same bug.
I evaled the code you supplied with debug-on-error - still get that nasty message, no debugger kicks in. Setting auto-save-timeout to non-zero also helps.
I have tried running the script, but unfortunately the config shows
Virtualenv........: None
RPC Python........: 2.7.15 (/usr/bin/python)
Interactive Python: python (/usr/bin/python)
Emacs.............: 26.1.90
Elpy..............: 1.27.0
Jedi..............: Not found
even after I run python -m pip install --user jedi
and restart. Hence no completion, and no way for me to reproduce. Sorry.
@bgoodr @vkazanov
It might help if you also test this scenario with an Emacs build from the current master. Bug#23980 is fixed there, but not in any release version.
@dgutov I already checked that bug and tried the current master. It crashes on start up my machine so no way forward for me here:-) Do you know if the fix will be included in the next release of 26.x series? Going through comments it seems that it will not?
It crashes on start up my machine so no way forward for me here:-)
A bug report would be helpful.
Do you know if the fix will be included in the next release of 26.x series?
It is not. If I had some evidence that it fixes your problem, I could argue for its inclusion.
Another thing you can try is apply the patch to emacs-26
locally, rebuild, and verify that the problem is gone. The patch is here: http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=1f3f4b1296613b8cdc0632a68fde86e86ddad866
@dgutov Ok. I'll try both tomorrow morning, i.e.:
Is that correct?
Apply the patch to Emacs 26.1
The current contents of the emacs-26
branch, please.
But if the patch helps, try the build without the patch, too. So we're 100% sure that it's the patch that fixes the problem.
@dgutov ok, will check both heads of both emacs-26 and master branches.
@dgutov first checks done
will now apply the patch to the emacs-26 branch
side note: emasc-26 branch crashes when run as emacs --fg-daemon. I have a trace generated from the core. Where do I report it?
So, this commit does fix the issue.
Thank you.
I have a trace generated from the core. Where do I report it?
Please call M-x report-emacs-bug
and see the instructions in there.
The fix is backported now, will be in Emacs 26.2.
@dgutov thanks a lot! that bug is really annoying :-) Looking forward to the release.
No problem.
Please call M-x report-emacs-bug
I haven't seen that bug report, BTW.
@dgutov
I'll report today, didn't get a minute to rebuild that branch yet.
@dgutov
Sorry for the delay. The bug turned out to be not so easy to isolate. Raw emacs-26 branch works just fine when run as emacs -Q . But I use lots of various packages, and the crash only happens when I call helm-M-x and only in daemon mode.
I can't properly do report-emacs-bug
as it crashes whenever I try to type a command.
here's the trace using gdb (not sure if it helps though):
(gdb) bt
#0 0x00007f7835f16727 in raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00000000004f9d97 in terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:394
#2 0x00000000005145a3 in emacs_abort () at sysdep.c:2426
#3 0x0000000000570e70 in signal_or_quit (error_symbol=..., data=..., keyboard_quit=keyboard_quit@entry=false) at eval.c:1551
#4 0x0000000000570ebc in Fsignal (error_symbol=..., error_symbol@entry=..., data=...) at eval.c:1521
#5 0x0000000000570ee7 in xsignal (data=..., error_symbol=...) at lisp.h:3854
#6 0x0000000000570ee7 in xsignal1 (error_symbol=error_symbol@entry=..., arg=..., arg@entry=...) at eval.c:1658
#7 0x000000000048f679 in Fcheck_coding_system (coding_system=coding_system@entry=...) at coding.c:8549
#8 0x00000000004a09b5 in code_convert_string (string=..., coding_system=..., dst_object=..., encodep=<optimised out>, nocopy=<optimised out>, norecord=<optimised out>) at coding.c:9448
#9 0x000000000052c15a in Fexpand_file_name (name=..., name@entry=..., default_directory=..., default_directory@entry=...) at fileio.c:1116
#10 0x000000000052bc35 in Fexpand_file_name (name=..., default_directory=..., default_directory@entry=...) at fileio.c:871
#11 0x0000000000531662 in Fdo_auto_save (no_message=..., no_message@entry=..., current_only=..., current_only@entry=...) at fileio.c:5595
#12 0x00000000004f9bb2 in shut_down_emacs (sig=sig@entry=11, stuff=stuff@entry=...) at emacs.c:2104
#13 0x00000000004f9dc3 in terminate_due_to_signal (sig=sig@entry=11, backtrace_limit=backtrace_limit@entry=40) at emacs.c:377
#14 0x00000000005129ce in handle_fatal_signal (sig=sig@entry=11) at sysdep.c:1769
#15 0x0000000000512be8 in deliver_thread_signal (sig=11, handler=0x5129c0 <handle_fatal_signal>) at sysdep.c:1743
#16 0x0000000000512c6c in deliver_fatal_thread_signal (sig=<optimised out>) at sysdep.c:1781
#17 0x0000000000512c6c in handle_sigsegv (sig=<optimised out>, siginfo=<optimised out>, arg=<optimised out>) at sysdep.c:1866
#18 0x00007f7835f16890 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0
#19 0x000000000057d3fc in XINT (a=...) at lisp.h:950
#20 0x000000000057d3fc in HASH_INDEX (idx=2224721850465380289, h=0x7d1bb10) at fns.c:3639
#21 0x000000000057d3fc in hash_lookup (h=h@entry=0x7d1bb10, key=key@entry=..., hash=hash@entry=0x0) at fns.c:3962
#22 0x000000000057d4a6 in Fgethash (key=key@entry=..., table=..., dflt=..., dflt@entry=...) at fns.c:4658
#23 0x00000000005d5bf1 in ftfont_lookup_cache (key=..., cache_for=cache_for@entry=FTFONT_CACHE_FOR_FACE) at ftfont.c:370
#24 0x00000000005d7d0e in ftfont_close (font=0x7556c70) at ftfont.c:1254
#25 0x0000000000552b96 in cleanup_vector (vector=vector@entry=0x7556c70) at alloc.c:3195
#26 0x0000000000554028 in sweep_vectors () at alloc.c:3254
#27 0x00000000005580d7 in gc_sweep () at alloc.c:7163
#28 0x00000000005580d7 in garbage_collect_1 (end=<optimised out>) at alloc.c:6027
#29 0x00000000005580d7 in Fgarbage_collect () at alloc.c:6159
#30 0x000000000057058b in maybe_gc () at lisp.h:4744
#31 0x000000000057058b in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7ffcac833730) at eval.c:2758
#32 0x00000000005707ea in call1 (fn=..., fn@entry=..., arg1=..., arg1@entry=...) at eval.c:2627
#33 0x00000000005973cc in readevalloop (readcharfun=readcharfun@entry=..., infile0=infile0@entry=0x7ffcac8338d0, sourcename=...,
sourcename@entry=..., printflag=printflag@entry=false, unibyte=unibyte@entry=..., readfun=..., readfun@entry=..., start=..., end=...) at lread.c:1933
#34 0x0000000000597dd4 in Fload (file=..., noerror=..., noerror@entry=..., nomessage=nomessage@entry=..., nosuffix=..., nosuffix@entry=..., must_suffix=...) at lread.c:1435
#35 0x000000000057ea85 in Frequire (feature=..., filename=..., noerror=...) at fns.c:2807
#36 0x00000000005717ee in funcall_subr (subr=0xb7abc0 <Srequire>, numargs=numargs@entry=1, args=args@entry=0x7ffcac833af0) at eval.c:2856
#37 0x0000000000570722 in Ffuncall (nargs=2, args=args@entry=0x7ffcac833ae8) at eval.c:2776
#38 0x00000000005ab240 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=<optimised out>, args=<optimised out>) at bytecode.c:630
#39 0x00000000005729fb in eval_sub (form=...) at eval.c:2247
#40 0x0000000000597495 in readevalloop (readcharfun=readcharfun@entry=..., infile0=infile0@entry=0x7ffcac834060, sourcename=...,
sourcename@entry=..., printflag=printflag@entry=false, unibyte=..., unibyte@entry=..., readfun=..., readfun@entry=..., start=..., end=...) at lread.c:2048
#41 0x0000000000597dd4 in Fload (file=..., noerror=..., noerror@entry=..., nomessage=nomessage@entry=..., nosuffix=..., nosuffix@entry=..., must_suffix=...) at lread.c:1435
#42 0x000000000057ea85 in Frequire (feature=..., filename=..., noerror=...) at fns.c:2807
#43 0x00000000005717ee in funcall_subr (subr=0xb7abc0 <Srequire>, numargs=numargs@entry=1, args=args@entry=0x7ffcac834280) at eval.c:2856
#44 0x0000000000570722 in Ffuncall (nargs=2, args=args@entry=0x7ffcac834278) at eval.c:2776
#45 0x00000000005ab240 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=<optimised out>, args=<optimised out>) at bytecode.c:630
#46 0x00000000005729fb in eval_sub (form=...) at eval.c:2247
---Type <return> to continue, or q <return> to quit---
#47 0x0000000000597495 in readevalloop (readcharfun=readcharfun@entry=..., infile0=infile0@entry=0x7ffcac834770, sourcename=...,
sourcename@entry=..., printflag=printflag@entry=false, unibyte=..., unibyte@entry=..., readfun=..., readfun@entry=..., start=..., end=...) at lread.c:2048
#48 0x0000000000597dd4 in Fload (file=..., noerror=..., noerror@entry=..., nomessage=nomessage@entry=..., nosuffix=..., nosuffix@entry=..., must_suffix=..., must_suffix@entry=...)
at lread.c:1435
#49 0x0000000000571ce0 in Fautoload_do_load (fundef=..., funname=..., macro_only=...) at eval.c:2029
#50 0x00000000005717ee in funcall_subr (subr=0xb796c0 <Sautoload_do_load>, numargs=numargs@entry=2, args=args@entry=0x7ffcac8349a0) at eval.c:2856
#51 0x0000000000570722 in Ffuncall (nargs=3, args=args@entry=0x7ffcac834998) at eval.c:2776
#52 0x00000000005ab240 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=nargs@entry=140723202771408, args=<optimised out>, args@entry=0x17ffcac834cb8)
at bytecode.c:630
#53 0x0000000000572dbf in funcall_lambda (fun=..., nargs=140723202771408, nargs@entry=1, arg_vector=0x17ffcac834cb8, arg_vector@entry=0x7ffcac834cb8) at eval.c:2977
#54 0x000000000057069d in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7ffcac834cb0) at eval.c:2790
#55 0x00000000005707ea in call1 (fn=..., fn@entry=..., arg1=...) at eval.c:2627
#56 0x0000000000508e54 in command_loop_1 () at keyboard.c:1482
#57 0x000000000056f88e in internal_condition_case (bfun=bfun@entry=0x508a30 <command_loop_1>, handlers=..., handlers@entry=..., hfun=hfun@entry=0x4ff030 <cmd_error>) at eval.c:1336
#58 0x00000000004fa184 in command_loop_2 (ignore=..., ignore@entry=...) at keyboard.c:1110
#59 0x000000000056f7fd in internal_catch (tag=..., tag@entry=..., func=func@entry=0x4fa160 <command_loop_2>, arg=..., arg@entry=...) at eval.c:1101
#60 0x00000000004fa11b in command_loop () at keyboard.c:1089
#61 0x00000000004fec43 in recursive_edit_1 () at keyboard.c:695
#62 0x00000000004fef66 in Frecursive_edit () at keyboard.c:766
#63 0x000000000041b822 in main (argc=<optimised out>, argv=0x7ffcac8350f8) at emacs.c:1717
calling (report-emacs-bug) using M-: also crashes Emacs :-(
here's the trace using gdb (not sure if it helps though)
It probably helps, but I'm not the person to analyze it.
You don't actually have to send the report from the same Emacs where you see the problem. Or you can call M-x report-emacs-bug
in an emacs -Q
session, type the whole report there, then copy everything and send it with e.g. Thunderbird. Or just temporarily disable Helm.
@dgutov done. I don't see the email yet but it should on it's way.
Summary
Jorgen, feel free to close this as will not fix if you think it isn't an elpy issue but a core Emacs problem. I'm just posting this here for info for others who are plagued with this problem when using elpy, or for whoever wants to do more digging to find the ultimate root cause.
I needed to debug down to the root cause of the "\<t> is undefined" error that seems to be plagueing us users of company-mode and elpy mode, as reported in these items:
When I had all of my .emacs enabled, I would see my typing in "print" Python statement would fail on the "n" and I would get a message of:
Using (toggle-debug-on-error) does not help at all. It seems to be asynchronous and low level. I even suspect core Emacs itself here versus company-mode or elpy, per se.
I isolated it down to the steps to reproduce below using a Bash script. At some point, the "\<t> is undefined" error disappeared, but was replaced with a similar problem whereby the bell would chime instead (i.e., instead of "\<t> is undefined" error disappeared a bell would occur and no error would be shown).
After debugging, I found that when I set
auto-save-timeout
to nil (its doc string says you can!) then the bell is rung when you type the 'n' in 'print' inside a Python buffer, and the "n" is lost, leaving you with "prit" in the buffer. But when I stopped settingauto-save-timeout
to nil, but left it as its default of 30 (seconds), the problem disappeared as well as the problem with the original "\<t> is undefined" error.Steps to reproduce
Store the following into a Bash script, give it execute permissions, and execute it. But when you do, and you type 'print', you will see 'prit' instead and a bell rings. But if you go back and fix it so that it reads 'print', then subsequent typing in of 'print' do not ring the bell.
Note that I'm moving aside the .emacs.d directory and pulling elpy and its dependent packags from Melpa to ensure there are no other interactions other that the packages involved.
Contents of the /tmp/package-alist.dump.el referenced above
My configuration
Emacs version
OS
lsb_release -r -i
:Result of
(elpy-config)
Elpy configuration in my init.el
I think this is not applicable since I'm running it all under -Q so am using all of the defaults.