atlas-engineer / nyxt

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

Repeating Crash on Page Load #3506

Closed brosasaki closed 2 days ago

brosasaki commented 4 days ago

Describe the bug As I browse, sometimes Nyxt goes under spells where attempting to load a certain page causes the browser to crash and terminate immediately. When launched from the terminal, the following error message is given:

(nyxt:6127): Gdk-CRITICAL **: 01:06:36.023: gdk_window_create_gl_context: assertion 'GDK_IS_WINDOW (window)' failed
CORRUPTION WARNING in SBCL pid 6127 tid 6141:
Memory fault at 0x8 (pc=0x7f0773e32ba0, fp=0x7f079b1fdf58, sp=0x7f079b1fdf50) tid 6141
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
<WARN> [01:06:36] Warning: Error on GI-GTK thread: Unhandled memory fault at #x8.

When this happens, attempts to re-launch the browser cause an immediate crash again as the page begins to load (note-even when using the "kill buffer" interface, as scrolling past a page causes it to begin loading). The only way to stop the repeated crashing is to spam C-x C-k as nyxt starts up and hope that all the buffers get killed before the problematic one begins to load. This bug is very common despite its inconsistency--it occurred as I tried to pull up this page via report-bug, and I had to do the C-x C-k procedure and try again.

Of note, the memory fault consistently occurrs at 0x8, and the last 5 places of the pc, fp, and sp variables are always the same.

I do realize it's possible that my browser state data is corrupt--it would be helpful if the browser could better detect this and communicate this to the user. Also, maybe it's possible to isolate a crashed backend thread from the rest of the app so it doesn't crash all at once, and the browser is able to remember that that thread crashed?

Precise recipe to reproduce the issue I am not quite sure. I haven't reproduced it yet with nyxt-failsafe. I'll attach my config.lisp below:

(load (str:concat (uiop/os:getenvp "XDG_CACHE_HOME")
                  "/wal/colors-nyxt.lisp"))

(define-configuration browser
  ((theme *wal-theme*)))

;; (define-configuration buffer
;;   ((default-modes
;;        (pushnew 'nyxt/mode/password:password-mode %slot-value%))))

(define-configuration context-buffer
    ((search-engines
      (mapcar
       (lambda (engine) (apply 'make-search-engine engine))
       '(("aw" "https://wiki.archlinux.org/index.php?search=~a"
          "https://wiki.archlinux.org/title/Main_page")
         ("bs" "https://bitsearch.to/search?q=~a")
         ("gh" "https://github.com/search?q=~a&type=repositories" "https://github.com")
         ("lb" "https://letterboxd.com/search/~a/")
         ("mz" "https://amazon.com/s?url=search-alias%3Daps&field-keywords=~a")
         ("wb" "https://wiby.me/?q=~a" "https://wiby.me")
         ("wp" "https://wikipedia.org/;w/index.php?search=~a" "https://en.wikipedia.org")
         ("dg" "https://duckduckgo.com/?q=~a" "https://duckduckgo.com"))))))

(define-configuration nyxt/mode/password:password-mode
    ((nyxt/mode/password:password-interface
      (make-instance 'password:keepassxc-interface
                     ;; :key-file "" :master-password "" :yubikey-slot ""
                     :password-file (str:concat (uiop/os:getenvp "XDG_DATA_HOME")
                                                "/keepassxc/passwords.kdbx")))))

For website-specific issues: Can you reproduce this issue with Epiphany / GNOME Web (https://wiki.gnome.org/Apps/Web)? No

Information

ASDF version: 3.3.7 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: (/gnu/store/5z1snyx1qcs1d6yzvp65q5f385b5qp25-sbcl-cl-cffi-gtk-3.8.8-3.1700fe6/share/common-lisp/sbcl/cl-cffi-gtk/gtk/cl-cffi-gtk.asd /gnu/store/1168j4q4y2fniyr7c5w9nlfpr0zm1p8b-cl-gobject-introspection-0.3-4.4908a84/share/common-lisp/source/cl-gobject-introspection/cl-gobject-introspection.asd /gnu/store/yxqxnpnlyin73l4q97rippdgcvxjb7cm-sbcl-cl-webkit-3.5.10/share/common-lisp/sbcl/cl-webkit/webkit2/cl-webkit2.asd)

Guix version:



**Output when started from a shell** 
`see above`
brosasaki commented 4 days ago

Actually, I was able to get it to happen on a --failsafe instance. While I found no issues browsing the gnu.org website, I encountered this same error message while as soon as I went to this page (video game release page on github) and clicked the link to download the assets zip-file. A second attempt to recreat this successfully started the download, but an attempt to navigate back to that page led to another crash. Maybe it has something to do with javascript, seeing as it doesn't happen with the gnu site?

brosasaki commented 3 days ago

I found another link where this crash occurs consistently -- try going to the 'version selector' page of the Hyprland wiki and selecting version 0.40.0. I was able to get it to crash consistently, even in --failsafe mode. That being said, I was able to browse the 0.40.0 wiki before, so perhaps there is some kind of corrupt state being cached even across profiles?

brosasaki commented 3 days ago

an exacerbating issue is that Nyxt appears to sometime leave its connection to the settings portal open when it crashes, making such that later invocations may also crash with a 'connection refused' error.

aadcg commented 2 days ago

@brosasaki I think that those crashes are due to Wayland. Starting via WEBKIT_DISABLE_COMPOSITING_MODE=1 nyxt, as documented in the manual, may help.

At the end of the day, it's the renderer's fault. You may be right that there is a way to handle the web view freezes gracefully, but I'd rather no spend too much energy on it since the renderer is subpar anyway. Most of the effort is going towards #2989.