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

Possible bug: Nyxt unexpectadly closes buffer on the dockerized version of Nyxt for macOS #8

Open
pdelfino opened this issue Oct 25, 2021 · 16 comments

Comments

@pdelfino
Copy link

pdelfino commented Oct 25, 2021

Describe the bug

This video describes what was written in the title.

Precise recipe to reproduce the issue

1 - open Nyxt following the description on Readme "usage for Docker on macOS". Except for this step "Launch a new xterm terminal and ensure you have “DISPLAY=:0” set." which I did not do because I was not sure about how to do it.
2 - open this website. This is something like the Brazilian version of New York Times
3 - Wait. Suddenly, Nyxt will close the buffer
4 - The mini buffer will send an error message which can be read during the video with the bug description

The same problem also happened with my blog's website. This problem does not happen when browsing stuff like manual, tutorial (kind of internal buffers). Both "problematic websites" have always worked fine while using Nyxt on my Linux machine.

Information

  • OS name+version: macOS 12
  • Graphics card and driver: (I will send soon)
  • Desktop environment / Window manager name+version: default Desktop Environment on macOS
  • How you installed Nyxt (Guix pack, package manager, build from source): Docker
  • Information from show-system-information: (I will send soon)

Observation: this bug did not happen to me. I do not owe a mac. I am trying to help a friend who is craving to use Nyxt on his mac.

@deddu
Copy link
Owner

deddu commented Oct 26, 2021

I seem to be able to reproduce. I did see Warning: JavaScript error: GError: Domain: "WebKitJavascriptError", Code: 699, Message: . This seems very much related, atlas-engineer/nyxt#1657 I'll do some troubleshooting and see if I'm missing some extra packages in the container, like those gst libs. Thanks

@deddu
Copy link
Owner

deddu commented Oct 26, 2021

yup, quoting the manual:

Playing videos

Nyxt delegates video support to third-party plugins.

When using the WebKitGTK backends, GStreamer and its plugins are leveraged. Depending on the video, you will need to install some of the following packages:

gst-libav
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gst-plugins-ugly
On Debian-based systems, you might be looking for (adapt the version numbers):

libgstreamer1.0-0
gir1.2-gst-plugins-base-1.0

I'll try to install and eventually update the docker image. nice catch.

@deddu
Copy link
Owner

deddu commented Oct 26, 2021

I have installed those:

    libgstreamer1.0-0 
    gir1.2-gst-plugins-base-1.0 
    gir1.2-gst-plugins-bad-1.0 

but the link still causes a crash with the same message.
here's my system info

System information

Nyxt version: 2.2.1
Renderer version: GI-GTK
Operating system kernel: Linux 5.10.47-linuxkit
Lisp implementation: SBCL 2.1.0.0.HEAD.1-46cb065 (Dynamic space size: 1073741824)
Features: (:WEBKIT2 :WEBKIT2-2.32 :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
 :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 :NYXT-2 :FSET-EXT-STRINGS :CUSTOM-HASH-TABLE-NATIVE :SWANK
 :PLUMP-UTF-32 :GLOBAL-VARS :DECLARE-TYPES :PARENSCRIPT :NAMED-READTABLES
 :LPARALLEL :21BIT-CHARS :CHUNGA :FLEXI-STREAMS :CLOSER-MOP :CL-PPCRE-UNICODE
 :CL-UNICODE :BORDEAUX-THREADS :LPARALLEL.WITH-CLTL2 :LPARALLEL.WITH-CAS
 :LPARALLEL.WITH-STEALING-SCHEDULER :SPLIT-SEQUENCE CHIPZ-SYSTEM:GRAY-STREAMS
 :FAST-IO-SV :FAST-IO :SBCL-USES-SB-ROTATE-BYTE :CL-JSON-CLOS :CL-JSON
 :THREAD-SUPPORT :CL-PPCRE CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64
 CFFI-FEATURES:UNIX :CFFI CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP
 :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :X86-64 :GENCGC :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.4
Critical dependencies: (/home/runner/work/nyxt/nyxt/_build/cl-cffi-gtk/gtk/cl-cffi-gtk.asd
 /home/runner/work/nyxt/nyxt/_build/cl-gobject-introspection/cl-gobject-introspection.asd
 /home/runner/work/nyxt/nyxt/_build/cl-webkit/webkit2/cl-webkit2.asd)

I'm unsure on what might be going on. Perhaps I did not pull all deps yet? I've a branch with this setup, you can try locally by issuing a docker build.

@Ambrevar
Copy link

Try disabling compositing by setting the environment variable WEBKIT_DISABLE_COMPOSITING_MODE to 1 before starting the browser.

Also could you time the buffer crash? Does it take the exact same number of seconds for each web site?

@deddu
Copy link
Owner

deddu commented Oct 28, 2021

disabling compositing did not help, but I did manage to get a more descriptive message.

<INFO> [11:24:41] Loading "https://youtube.com/".

(WebKitWebProcess:431): dbind-WARNING **: 11:24:46.427: Couldn't connect to accssibility bus: Failed to connect to socket /tmp/dbus-QG0YJTgxXG: Connection refsed
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

(WebKitWebProcess:368): Gdk-ERROR **: 11:24:46.530: The program 'WebKitWebProces' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 191 error_code 2 request_code 149 (GLX) minor_code 24)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
<WARN> [11:24:46] Warning: Web process crashed for buffer 4

running with GDK_SYNCHRONIZE did not change the output.
I think that failed to load driver swrast could be interesting.

@deddu
Copy link
Owner

deddu commented Oct 28, 2021

that last message brought me to try to install mesa-utils
and libgl1-mesa-glx as mentioned here openai/gym#509
and the error changed slightly, but still fails

<INFO> [11:37:57] Loading "https://youtube.com/".

(WebKitWebProcess:237): dbind-WARNING **: 11:38:02.531: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-QG0YJTgxXG: Connection refused
libGL: MESA-LOADER: dlopen(/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

(WebKitWebProcess:198): Gdk-ERROR **: 11:38:03.258: The program 'WebKitWebProcess' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 237 error_code 2 request_code 149 (GLX) minor_code 24)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
<WARN> [11:38:03] Warning: Web process crashed for buffer 2

@deddu
Copy link
Owner

deddu commented Oct 28, 2021

and by logging in the container,

docker exec -it 01d8a4fb529b bash
root@01d8a4fb529b:/opt/nyxt# export DISPLAY=host.docker.internal:0
root@01d8a4fb529b:/opt/nyxt# glxgears
libGL: MESA-LOADER: dlopen(/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Error: glXCreateContext failed
root@01d8a4fb529b:/opt/nyxt# glxinfo
name of display: host.docker.internal:0
libGL: MESA-LOADER: dlopen(/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  149 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  27
  Current serial number in output stream:  28

this is also mentioned in XQuartz/XQuartz#144 . I am starting to be a bit worried.

so following that, i did try to run in the host

defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
defaults write org.xquartz.X11 enable_iglx -bool true

and restarted xquartz. That does display the glxgears and glxinfo, but still no luck with nyxt and youtube. and for what it's worth, it did not resolve the usual suspect:

:/opt/nyxt# glxgears
libGL: MESA-LOADER: dlopen(/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
glxinfo
name of display: host.docker.internal:0
libGL: MESA-LOADER: dlopen(/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
display: host.docker.internal:0  screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_visual_info,
    GLX_EXT_visual_rating, GLX_OML_swap_method, GLX_SGIS_multisample,
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
    GLX_SGI_make_current_read
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_context_flush_control, GLX_ARB_create_context,
    GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile,
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
    GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample,
    GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile,
    GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float,
    GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, GLX_EXT_swap_control,
    GLX_EXT_swap_control_tear, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_INTEL_swap_event,
    GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent,
    GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method,
    GLX_OML_sync_control, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_make_current_read,
    GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.4
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read
OpenGL vendor string: Intel Inc.
OpenGL renderer string: Intel(R) Iris(TM) Plus Graphics 655
OpenGL version string: 1.4 (2.1 INTEL-16.5.2)
OpenGL extensions:
    GL_APPLE_packed_pixels, GL_ARB_depth_texture, GL_ARB_draw_buffers,
    GL_ARB_fragment_program, GL_ARB_fragment_program_shadow,
    GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query,
    GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_shadow,
    GL_ARB_texture_border_clamp, GL_ARB_texture_compression,
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar,
    GL_ARB_texture_env_dot3, GL_ARB_texture_filter_anisotropic,
    GL_ARB_texture_mirrored_repeat, GL_ARB_texture_non_power_of_two,
    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, GL_ARB_vertex_program,
    GL_ARB_window_pos, GL_ATIX_texture_env_combine3, GL_ATI_draw_buffers,
    GL_ATI_texture_env_combine3, GL_ATI_texture_mirror_once, GL_EXT_abgr,
    GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_equation_separate,
    GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract,
    GL_EXT_clip_volume_hint, GL_EXT_draw_range_elements, GL_EXT_fog_coord,
    GL_EXT_framebuffer_object, GL_EXT_multi_draw_arrays,
    GL_EXT_point_parameters, GL_EXT_rescale_normal, GL_EXT_secondary_color,
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs,
    GL_EXT_stencil_two_side, GL_EXT_stencil_wrap,
    GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_s3tc,
    GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add,
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias,
    GL_EXT_texture_rectangle, GL_IBM_texture_mirrored_repeat,
    GL_INGR_blend_func_separate, GL_NV_blend_square, GL_NV_depth_clamp,
    GL_NV_fog_distance, GL_NV_light_max_exponent, GL_NV_texgen_reflection,
    GL_NV_texture_rectangle, GL_SGIS_generate_mipmap,
    GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp,
    GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays

@Ambrevar
Copy link

Ambrevar commented Oct 28, 2021 via email

@deddu
Copy link
Owner

deddu commented Oct 28, 2021

the machine I normally use does not. It's a plain MBP with an intel iris. I might have an old one with an nvidia card, but I'm surprised it matters. Would not that be completely hidden to the docker container, and would not it expect to use just the standard device?
This makes me think.. do I have to expose some xquartz special volumes from the host?

@deddu
Copy link
Owner

deddu commented Oct 28, 2021

running with

xterm -e 'xhost +127.0.0.1; docker run -it -e WEBKIT_DISABLE_COMPOSITING_MODE=1 -e GDK_SYNCHRONIZE=1 -e LIBGL_DEBUG=verbose -e LIBGL_ALWAYS_INDIRECT=1 --rm nyxt:2.2.1 nyxt --system-information'

shows a different error, GLXBadRenderRequest.

Nyxt version 2.2.1
<INFO> [21:12:21] Loading "https://youtube.com/".

(WebKitWebProcess:188): Gdk-ERROR **: 21:12:28.592: The program 'WebKitWebProcess' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadRenderRequest'.
  (Details: serial 298 error_code 167 request_code 149 (GLX) minor_code 1)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
<WARN> [21:12:28] Warning: Web process crashed for buffer 2

Any help really appreciated here.

@Ambrevar
Copy link

Ambrevar commented Oct 29, 2021 via email

@deddu
Copy link
Owner

deddu commented Oct 31, 2021

I did fiddle a bit with the packages, and I could get to render the youtube page without a crash. Also the video did start playing but it crashed after a bit - here's the output

<INFO> [00:51:02] Listening to socket "nyxt/nyxt.socket".
Nyxt version 2.2.2
<INFO> [00:51:10] Loading "https://youtube.com/".
<INFO> [00:51:15] Finished loading "https://www.youtube.com/".
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver retured error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned eror: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned eror: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directry
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': Nosuch file or directory

(WebKitWebProcess:187): Gdk-ERROR **: 00:51:49.683: The program 'WebKitWebProces' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadRenderRequest'.
  (Details: serial 634 error_code 167 request_code 149 (GLX) minor_code 1)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
<WARN> [00:51:49] Warning: Web process crashed for buffer 2

now, for your question: there's no lspci, I'll install that and post an update.

@Ambrevar
Copy link

Ambrevar commented Nov 1, 2021 via email

@dre-sctg
Copy link
Contributor

dre-sctg commented Nov 6, 2021

so, with regard to adding alsa

here's the error

<INFO> [11:22:08] Loading "https://youtube.com/".
<INFO> [11:22:13] Finished loading "https://www.youtube.com/".
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory

(WebKitWebProcess:177): Gdk-ERROR **: 11:22:21.719: The program 'WebKitWebProcess' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadRenderRequest'.
  (Details: serial 650 error_code 167 request_code 149 (GLX) minor_code 1)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
<WARN> [11:22:21] Warning: Web process crashed for buffer 2
^[Gdk-Message: 11:27:59.743: WebKitWebProcess: Fatal IO error 11 (Resource temporarily unavailable) on X server host.docker.internal:0.

I've updated the dockerfile in the branch issue-8 with those latest changes

@deddu
Copy link
Owner

deddu commented Nov 22, 2021

I saw this one in my logs today ... perhaps worthy of further investigation.

<WARN> [11:05:26] Failed to echo these args: ("Web process terminated for buffer ~a because ~[it crashed~;of memory exhaustion~;we had to close it~]"
                                              "2" :WEBKIT-WEB-PROCESS-CRASHED)

@Ambrevar
Copy link

Ambrevar commented Nov 22, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants