atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.65k stars 404 forks source link

nyxt crashes when calling reopen-last-buffer #3287

Closed Vonfry closed 6 months ago

Vonfry commented 6 months ago

Describe the bug

  1. nyxt --failsafe
  2. open a new buffer
  3. delete the buffer
  4. call reopen-last-buffer
  5. crash

When nyxt crashes, ldb is prompted. There are some infomation in it:

ldb> backtrace 100
Backtrace:
   0: fp=0x7ffa0c3776c0 pc=0x7ffa9554dd7c Foreign function (null)
ldb> pte
expected an object
ldb> regs
CSP =   (nil)
ldb> threads
(thread*,pthread,sb-vm:thread,name)
0x7ffa0c578080 0x7ffa0c3776c0 0x1006c28a20 "Nyxt run-async command"
0x7ff888778080 0x7ff8885776c0 0x1005408120 "Nyxt Prompt updater"
0x7ffa24780080 0x7ffa2457f6c0 0x10054081b0 "Nyxt Prompt updater"
0x7ffa7c758080 0x7ffa7c5576c0 0x100764e750 "Nyxt renderer thread"
0x7ffa7d060080 0x7ffa7ce5f6c0 0x1005408240 "Hierarchy Watcher"
0x7ffa7d4e0080 0x7ffa7d2df6c0 0x10054082d0 "lparallel"
0x7ffa7d960080 0x7ffa7d75f6c0 0x1005408360 "lparallel"
0x7ffa7dde0080 0x7ffa7dbdf6c0 0x1005408400 "lparallel"
0x7ffa7e268080 0x7ffa7e0676c0 0x1005408490 "lparallel"
0x7ffa7e6e8080 0x7ffa7e4e76c0 0x1005408520 "lparallel"
0x7ffa7eb68080 0x7ffa7e9676c0 0x10054085b0 "lparallel"
0x7ffa7efe8080 0x7ffa7ede76c0 0x1005408640 "lparallel"
0x7ffa7f470080 0x7ffa7f26f6c0 0x10054086d0 "lparallel"
0x7ffa7f8f0080 0x7ffa7f6ef6c0 0x1005408760 "lparallel"
0x7ffa7fd70080 0x7ffa7fb6f6c0 0x1005408800 "lparallel"
0x7ffa801f0080 0x7ffa7ffef6c0 0x100ed68640 "lparallel"
0x7ffa80678080 0x7ffa804776c0 0x100ed686d0 "lparallel"
0x7ffa80af8080 0x7ffa808f76c0 0x100ed68760 "lparallel"
0x7ffa80f78080 0x7ffa80d776c0 0x1005408890 "lparallel"
0x7ffa813f8080 0x7ffa811f76c0 0x100ed68890 "lparallel"
0x7ffa81880080 0x7ffa8167f6c0 0x1005408920 "lparallel"
0x7ffa88110080 0x7ffa87f0f6c0 0x100ed689b0 "lparallel"
0x7ffa81d00080 0x7ffa81aff6c0 0x10054089b0 "lparallel"
0x7ffa88a10080 0x7ffa8880f6c0 0x1005408a40 "lparallel"
0x7ffa894b0080 0x7ffa892af6c0 0x1005408ad0 "lparallel"
0x7ffa82180080 0x7ffa81f7f6c0 0x1005408b60 "lparallel"
0x7ffa88590080 0x7ffa8838f6c0 0x1005408c00 "lparallel"
0x7ffa8e468080 0x7ffa8e2676c0 0x1005408c90 "lparallel"
0x7ffa8ed70080 0x7ffa8eb6f6c0 0x1005408d20 "lparallel"
0x7ffa8e8f0080 0x7ffa8e6ef6c0 0x1005408db0 "lparallel"
0x7ffa8f670080 0x7ffa8f46f6c0 0x1005408e40 "lparallel"
0x7ffa8f1f0080 0x7ffa8efef6c0 0x1005408ed0 "lparallel"
0x7ffa8ff78080 0x7ffa8fd776c0 0x1005408f60 "lparallel"
0x7ffa90878080 0x7ffa906776c0 0x1005409000 "lparallel"
0x7ffa903f8080 0x7ffa901f76c0 0x1005409090 "lparallel"
0x7ffa8faf8080 0x7ffa8f8f76c0 0x1005409120 "lparallel"
0x7ffa90d00080 0x7ffa90aff6c0 0x10054091b0 "lparallel"
0x7ffa91180080 0x7ffa90f7f6c0 0x1005409240 "finalizer"
0x7ffa94f80080 0x7ffa954bfb80 0x10054092d0 "main thread"

I'm not sure it is an issue caused by distribution package or nyxt itself, so report it here. If it is caused by distribution packing, how do I debug it? Is there some guide?

Precise recipe to reproduce the issue

Information

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/qwf984hvhyc7mv787sc7zvvy3z6aq4zy-cl-cffi-gtk-20230214-git/gtk/cl-cffi-gtk.asd /nix/store/9l81yiw8rb272izkzmsp269zkfdwz46m-cl-gobject-introspection-20230618-git/cl-gobject-introspection.asd /nix/store/5sdgi4i6bk5022s00z67zsjrii9b8vcp-cl-webkit2-20230618-git/webkit2/cl-webkit2.asd)


**Output when started from a shell**

Nyxt version 3.10.0

[19:54:05] Source location: #P"/nix/store/141wdxkf33d2wcmbjm62iqvs1c7hsjp5-source-patched/" [19:54:05] Profile: "nofile" fatal error encountered in SBCL pid 131704 tid 132421: SIGABRT received. ```
aadcg commented 6 months ago

I can reproduce. Most likely related to GTK's specialization of ffi-buffer-make.

aadcg commented 6 months ago

The offending commit is 83f12c0b63af282d03930a20435d127f7e9ef498.

I'll fix this in the next 3-series release.

ThePinkUnicorn6 commented 2 months ago

Hi, I am still encountering this issue triggered in the same way on the latest version in nixpkgs, 3.11.5. This is the log in the shell after the crash:

<INFO> [19:20:42] Loading "https://search.atlas.engineer/searxng/search?q=test".
<INFO> [19:20:45] Finished loading "https://search.atlas.engineer/searxng/search?q=test".

(nyxt:130504): Gdk-CRITICAL **: 19:21:00.364: gdk_window_create_gl_context: assertion 'GDK_IS_WINDOW (window)' failed
CORRUPTION WARNING in SBCL pid 130504 tid 130552:
Memory fault at 0x8 (pc=0x7f5a93c37dc0, fp=0x7f5a9df75ef0, sp=0x7f5a9df75ef0) tid 130552
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
Backtrace for: #<SB-THREAD:THREAD tid=130552 "Nyxt renderer thread" RUNNING {100BE9ABF3}>
0: ("bogus stack frame")
1: ((LAMBDA (&REST GIR::ARGS-IN) :IN GIR::BUILD-FUNCTION))
2: ((FLET NYXT/RENDERER/GI-GTK::MAIN-FUNC :IN NYXT:FFI-INITIALIZE))
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")
<WARN> [19:21:00] Warning: Error on GI-GTK thread: Unhandled memory fault at #x8.
;
; compilation unit aborted
;   caught 1 fatal ERROR condition

and here is the system information:

Nyxt version: 3.11.5
Renderer: GI-GTK
Operating system kernel: Linux 6.6.25
Lisp implementation: SBCL 2.4.3 (Dynamic space size: 3145728000)
Features: (:NYXT-GI-GTK :NYXT-GTK :NYXT-3.11 :NYXT-3 :NYXT-3.11.5 :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)
ThePinkUnicorn6 commented 2 months ago

It seems to be more temperamental, it will sometimes crash before nyxt finishes loading and sometimes only after opening and closing tabs a few times. This may need to be moved to a new issue as it seems slightly different.

aadcg commented 2 months ago

@ThePinkUnicorn6 please open a bug report as soon as you find a reproducible recipe. I have doubts it is related to topic raised in this issue. Thanks.