atlas-engineer / nyxt

Nyxt - the hacker's browser.

Home Page:https://nyxt-browser.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when deleting the last buffer if setting vi-normal keybindings in document-mode.

Vonfry opened this issue · comments

Describe the bug

Precise recipe to reproduce the issue

  1. nyxt -S --no-init
  2. start-slynk
  3. eval this script
  4. run command vi-normal-mode
  5. run command delete-current-buffer
  6. crash!

The crash also appears with cua or default keyscheme sometimes, but I cannot reproduce it.

Information

  • OS name+version:
  • Graphics card and driver:
  • Desktop environment / Window manager name+version:
  • How you installed Nyxt (Guix pack, package manager, build from source): nix
  • Information from show-system-information:
Nyxt version: 3.11.6
Renderer: GI-GTK
Operating system kernel: Linux 6.8.5
Lisp implementation: SBCL 2.4.3 (Dynamic space size: 3145728000)
Features: (:NYXT-GI-GTK :NYXT-GTK :NYXT-3.11 :NYXT-3 :NYXT-3.11.6
 :CLIPBOARD-CONTENT-METHOD :SWANK :SLYNK :PLUMP-UTF-32 :PARENSCRIPT :NSYMBOLS
 :FSET-EXT-STRINGS :NAMED-READTABLES :CL-FAD :LPARALLEL :21BIT-CHARS
 :CUSTOM-HASH-TABLE-NATIVE :CL-PPCRE-UNICODE :CL-UNICODE :CHUNGA :FLEXI-STREAMS
 :CL-PPCRE :WEBKIT2 :WEBKIT-2.44.0 :WEBKIT-2.44 :WEBKIT-2
 :WEBKIT2-CORS-ALLOWLIST :WEBKIT2-PASTE-PLAINTEXT :WEBKIT2-TRACKING
 :WEBKIT2-MUTE :WEBKIT2-EMOJI :WEBKIT2-MEDIA :WEBKIT2-SANDBOXING :GTK-3-22
 :GTK-3-20 :GTK-3-18 :GTK-3-16 :GTK-3-14 :GTK-3-12 :GTK-3-10 :GTK-3-8 :GTK-3-6
 :GTK-3-4 :GTK :GDK-3-22 :GDK-3-20 :GDK-3-18 :GDK-3-16 :GDK-3-14 :GDK-3-12
 :GDK-3-10 :GDK-3-8 :GDK-3-6 :GDK-3-4 :CAIRO-1-10 :CAIRO-1-12 :GDK-PIXBUF
 :CLOSER-MOP :GLIB-2-30 :GLIB-2-32 :GLIB-2-34 :GLIB-2-36 :GLIB-2-38 :GLIB-2-40
 :GLIB-2-42 :GLIB-2-44 :GLIB-2-46 :GLIB-2-48 :GLIB-2-50 :GLIB-2-52 :GLIB-2-54
 :GLIB-2-56 :GLIB-2-58 :GLIB :BORDEAUX-THREADS :GLOBAL-VARS
 :ASDF-SYSTEM-CONNECTIONS :LPARALLEL.WITH-CLTL2 :LPARALLEL.WITH-CAS
 :LPARALLEL.WITH-STEALING-SCHEDULER :SPLIT-SEQUENCE
 CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI
 CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP :FAST-IO-SV :FAST-IO
 :CL-JSON-CLOS :CL-JSON :SBCL-USES-SB-ROTATE-BYTE CHIPZ-SYSTEM:GRAY-STREAMS
 :THREAD-SUPPORT :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ARENA-ALLOCATOR :X86-64 :MARK-REGION-GC
 :64-BIT :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB :SB-PACKAGE-LOCKS
 :SB-THREAD :SB-UNICODE :SBCL :UNIX)

ASDF version: 3.3.6
ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY USER-SOURCE-REGISTRY
                      USER-SOURCE-REGISTRY-DIRECTORY
                      DEFAULT-USER-SOURCE-REGISTRY SYSTEM-SOURCE-REGISTRY
                      SYSTEM-SOURCE-REGISTRY-DIRECTORY
                      DEFAULT-SYSTEM-SOURCE-REGISTRY)
Critical dependencies: (/nix/store/yal8d9j9x34w4wzyqf7rdsc52lx50b3w-sbcl-cl-cffi-gtk-20230214-git/gtk/cl-cffi-gtk.asd
 /nix/store/zfl2bgv6lk3859gj5im5ndfa3hki6wr9-sbcl-cl-gobject-introspection-20230618-git/cl-gobject-introspection.asd
 /nix/store/37pzbd8lhfyi9zmccxyhf671z8d38yq6-sbcl-cl-webkit2-20230618-git/webkit2/cl-webkit2.asd)

Output when started from a shell

<INFO> [22:04:20] Vi-normal mode enabled.
CORRUPTION WARNING in SBCL pid 121384 tid 121424:
Memory fault at 0x37d (pc=0x7fe18030ca70, fp=0x7fe1603fd780, sp=0x7fe1603fd630) tid 121424
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
<WARN> [22:04:25] Warning: Error on GI-GTK thread: Unhandled memory fault at #x37D.

Backtrace

 0: ((LAMBDA (CONDITION) :IN FFI-BUFFER-DELETE) #<NKEYMAPS/CONDITIONS:OVERRIDE-EXISTING-BINDING {1010A34E03}>)
 1: (NYXT::RUN-COMMAND #<COMMAND NYXT:DELETE-CURRENT-BUFFER (1)> NIL)
 2: ((LAMBDA NIL :IN NYXT::RUN-ASYNC))
 3: ((LABELS BORDEAUX-THREADS::%BINDING-DEFAULT-SPECIALS-WRAPPER :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
 4: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
 5: ((FLET "WITHOUT-INTERRUPTS-BODY-" :IN SB-THREAD::RUN))
 6: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
 7: ((FLET "WITHOUT-INTERRUPTS-BODY-" :IN SB-THREAD::RUN))
 8: (SB-THREAD::RUN)
 9: ("foreign function: call_into_lisp_")
10: ("foreign function: funcall1")

I can reproduce and it's an interesting bug. nkeymaps/conditions:override-existing-binding is responsible for the crash, but I don't quite understand why it doesn't silently warn in this case (as it does in other).

Given that this bug can only be reproduced when connected via Slynk/Swank, it is rather low priority.

Can I help with a workaround in the meantime? What are you trying to achieve?

Given that this bug can only be reproduced when connected via Slynk/Swank, it is rather low priority.

It can also be reproduced when setting it in user init files, why I found this.

Although I said "crash", the process hanged instead of termination because debugger is invoked (*debug-on-error* is nil). Instead, I kills the process manually.

Can I help with a workaround in the meantime? What are you trying to achieve?

Thanks. I can avoid this myself without deleting the last alive buffer.
The original goal is to create a new buffer with default-new-buffer-url like the action on other keyscheme without this issue.