Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-v in text fields hangs WebKitGTK on GNU/Linux #593

Closed
Ambrevar opened this issue Mar 9, 2020 · 19 comments
Closed

C-v in text fields hangs WebKitGTK on GNU/Linux #593

Ambrevar opened this issue Mar 9, 2020 · 19 comments
Labels
2-series Related to releases whose major version is 2.

Comments

@Ambrevar
Copy link
Member

Ambrevar commented Mar 9, 2020

WebKitGTK 2.26.4.

@Ambrevar Ambrevar added the 2-series Related to releases whose major version is 2. label Mar 9, 2020
@Ambrevar
Copy link
Member Author

@khinsen @jellelicht Can you reproduce this?

@jellelicht
Copy link

No. Both C-v and my simulation-key binding ([?\C-y] . ?\C-v) work as one might expect in exwm.

@khinsen
Copy link
Contributor

khinsen commented Mar 14, 2020

C-v works fine for me as well.

@Ambrevar
Copy link
Member Author

Ambrevar commented Mar 14, 2020 via email

@jmercouris
Copy link
Member

Shall we close this issue then, since it is a problem with your own machine?

@Ambrevar
Copy link
Member Author

Ambrevar commented Mar 14, 2020 via email

@wxie2017
Copy link

C-v crashes NEXT. This is reproduced from my side.
next version: Next 1.5.0-a9fa148

Subprocess #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {100841B803}>
with command ("/usr/bin/xclip" "-out" "-selection" "clipboard")
exited with error code 1
[Condition of type UIOP/RUN-PROGRAM:SUBPROCESS-ERROR]

Restarts:
0: [RETURN-FROM-G-CLOSURE] Return value from closure
1: [ABORT] abort thread (#<THREAD "cl-cffi-gtk main thread" RUNNING {1003D76F93}>)

Backtrace:
0: (NEXT::FUNCALL-SAFELY #<FUNCTION NEXT/WEB-MODE:PASTE>)
1: (NEXT::PUSH-INPUT-EVENT 118 "v" ("C") -1 -1 NIL #<NEXT:GTK-WINDOW {10040DE943}> #S(GDK:GDK-EVENT-KEY :TYPE :KEY-PRESS :WINDOW #<GDK:GDK-WINDOW {100840A093}> :SEND-EVENT NIL :TIME 2787204 :STATE (:CONT..
2: (GOBJECT::CALL-WITH-RESTARTS #<CLOSURE (LAMBDA (NEXT::WIDGET NEXT::EVENT) :IN INITIALIZE-INSTANCE) {1003FD5F4B}> (#<GTK:GTK-WINDOW {1001B28923}> #S(GDK:GDK-EVENT-KEY :TYPE :KEY-PRESS :WINDOW #<GDK:GDK..
3: ((LAMBDA (GOBJECT::CLOSURE GOBJECT::RETURN-VALUE GOBJECT::COUNT-OF-ARGS GOBJECT::ARGS GOBJECT::INVOCATION-HINT GOBJECT::MARSHAL-DATA) :IN "/root/common-lisp/next/quicklisp/dists/quicklisp/software/cl-..
4: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION) :IN "/root/common-lisp/next/quicklisp/dists/quicklisp/software/cl-cffi-gtk-20190710-git/gobject/gobject.signals.lisp") #<unavailable..
5: ("foreign function: funcall_alien_callback")
6: ("foreign function: callback_wrapper_trampoline")
7: ("foreign function: #x5010032B")
8: ("foreign function: #x426F30C4878ECA00")
9: ((LAMBDA NIL :IN GTK:ENSURE-GTK-MAIN))
10: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
11: ((FLET SB-UNIX::BODY :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
12: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
13: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE))
14: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::CALL-WITH-MUTEX))
15: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE) {7F65D49D6D7B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "cl-..
16: (SB-THREAD::NEW-LISP-THREAD-TRAMPOLINE #<SB-THREAD:THREAD "cl-cffi-gtk main thread" RUNNING {1003D76F93}> NIL #<CLOSURE (LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS) {1003D76F3B}> NIL)
17: ("foreign function: call_into_lisp")
18: ("foreign function: new_thread_trampoline")

@Ambrevar
Copy link
Member Author

Ambrevar commented Mar 16, 2020 via email

@jmercouris
Copy link
Member

Pierre, what happens for you when you manually invoke the javascript to paste into a textfield, does Next break for you then? What if you remove the clipboard from the equation?

@Ambrevar
Copy link
Member Author

Ambrevar commented Mar 16, 2020 via email

@khinsen
Copy link
Contributor

khinsen commented Mar 16, 2020

Test with commit 2e7965325300d2dc57912c603e4d2477df5a957f (the one I happened to be on):

  • Next does not hang.
  • WebKit from Guix (commit cdf00cf75d2e3ef68d016c3dc145bf9d12475023): package sbcl-cl-webkit, version 2.4-1.79ad419
  • I compiled Next using guix.scm.

@Ambrevar
Copy link
Member Author

@khinsen: Thanks for the report, it was very helpful!
I indeed don't experience any issue using Guix Common Lisp libraries.
I can only trigger the error when using the Quickdist libraries. Maybe something broke in cl-cffi or cl-cffi-gtk. I've asked here: Ferada/cl-cffi-gtk#35.

@jellelicht
Copy link

jellelicht commented Mar 17, 2020 via email

@Ambrevar
Copy link
Member Author

Ambrevar commented May 6, 2020

I've updated most Common Lisp Guix packages: now Next should be using approximately the same Common Lisp library versions when built with Guix or Quicklisp.

That said, I could not reproduce the issue with Guix.

  • Either I've missed a key library in Guix.
  • Or the Guix build system produces libraries different from those loaded from Quicklisp. Guix uses "compile-bundle-op", maybe this breaks CFFI / GTK / WebKit somehow.
  • Or...? Any idea?

@Ambrevar
Copy link
Member Author

At last, this is worked around in 6c258c5!

@tg-x
Copy link

tg-x commented Oct 20, 2020

This still seems to be an issue, using the 2-pre-2 guix pack tarball on nixos.

It happens when xclip returns with an error, which happens when a password manager e.g. keepassx deletes the clipboard contents:

> xclip -out -selection clipboard
Error: target STRING not available

Then, when trying to paste nyxt hangs a few seconds afterwards.

@Ambrevar
Copy link
Member Author

Ambrevar commented Oct 21, 2020 via email

@tg-x
Copy link

tg-x commented Oct 21, 2020

upon further investigation i found out that:

  • it happens with both emacs and cua bindings, both with C-y and C-v, also via command execution using paste, and also without any init / config file
  • it only happens after the password manager cleared the clipboard:
    • the first paste after clipboard is cleared results in the error message below, after which the UI is still responsive and functional
    • the next paste after this error message results in the hang, when the program can only terminated using kill -9
      this also happens when the two pastes happen in a different buffer
Unhandled UIOP/RUN-PROGRAM:SUBPROCESS-ERROR in thread #<SB-THREAD:THREAD "Anonymous thread" RUNNING
                                                         {1008317DF3}>:
  Subprocess #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {1008320303}>
 with command ("/gnu/store/r7pjiarqfm39z411ii8m8d6wjh3kc0zb-xclip-0.13/bin/xclip"
               "-out" "-selection" "clipboard")
 exited with error code 1

Backtrace for: #<SB-THREAD:THREAD "Anonymous thread" RUNNING {1008317DF3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {1008323C33}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK SB-EXT:*INVOKE-DEBUGGER-HOOK* #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {1008323C33}>)
2: (INVOKE-DEBUGGER #<UIOP/RUN-PROGRAM:SUBPROCESS-ERROR {1008323C33}>)
3: (CERROR "IGNORE-ERROR-STATUS" UIOP/RUN-PROGRAM:SUBPROCESS-ERROR :COMMAND ("/gnu/store/r7pjiarqfm39z411ii8m8d6wjh3kc0zb-xclip-0.13/bin/xclip" "-out" "-selection" "clipboard") :CODE 1 :PROCESS #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {1008320303}>)
4: (UIOP/RUN-PROGRAM::%CHECK-RESULT 1 :COMMAND ("/gnu/store/r7pjiarqfm39z411ii8m8d6wjh3kc0zb-xclip-0.13/bin/xclip" "-out" "-selection" "clipboard") :PROCESS #<UIOP/LAUNCH-PROGRAM::PROCESS-INFO {1008320303}> :IGNORE-ERROR-STATUS NIL)
5: (UIOP/RUN-PROGRAM::%USE-LAUNCH-PROGRAM ("/gnu/store/r7pjiarqfm39z411ii8m8d6wjh3kc0zb-xclip-0.13/bin/xclip" "-out" "-selection" "clipboard") :OUTPUT #<SB-IMPL::STRING-OUTPUT-STREAM {7F50703AE6F3}>)
6: (TRIVIAL-CLIPBOARD:TEXT NIL)
7: ((LAMBDA NIL :IN NYXT/WEB-MODE:PASTE))
8: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
9: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
10: ((FLET "WITHOUT-INTERRUPTS-BODY-14" :IN SB-THREAD::RUN))
11: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
12: ((FLET "WITHOUT-INTERRUPTS-BODY-4" :IN SB-THREAD::RUN))
13: (SB-THREAD::RUN)
14: ("foreign function: call_into_lisp")
15: ("foreign function: funcall1")

unhandled condition in --disable-debugger mode, quitting

@Ambrevar
Copy link
Member Author

Ambrevar commented Oct 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-series Related to releases whose major version is 2.
Development

No branches or pull requests

6 participants