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

[BUG] X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: 26, Serial: 23995 #2645

Closed
lautarodragan opened this issue Apr 4, 2020 · 13 comments
Labels

Comments

@lautarodragan
Copy link

lautarodragan commented Apr 4, 2020

Platform

Operating system and version:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Pop!_OS 19.10
Release:	19.10
Codename:	eoan

OBS Studio version: OBS 25.0.3 (linux)

Package

Followed official installation instructions for Ubuntu.

sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt-get update
sudo apt-get install obs-studio

I did not install ffmpeg but I believe I already had it (and I was able to record a couple of videos without problem).

Expected Behavior

Not to randomly crash.

Current Behavior

Application crashes.

error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: 26, Serial: 23995
error: Failed to make context current.
error: Failed to fetch parent window geometry!
error: X Error: BadDrawable (invalid Pixmap or Window parameter), Major opcode: 151, Minor opcode: BadLength (poly request too large or internal Xlib length error), Serial: 23997
error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: BadAlloc (insufficient resources for operation), Serial: 23998
error: X Error: GLXBadContextTag, Major opcode: 151, Minor opcode: BadAtom (invalid Atom parameter), Serial: 24004
error: Failed to reset current context.
Segmentation fault (core dumped)

Steps to Reproduce

  1. Open video source settings
  2. Change no setting at all
  3. Close window

Happens randomly, this sometimes works fine. I've also been able to change settings without it crashing.

I'm using two video sources:

  1. Video Capture Device (V4L2)
  2. Screen Capture (XSHM)

Other Info

I'm using two 4k displays, scaled to 200%. Under Video in the settings I've configured both the Base (Canvas) Resolution and Output (Scaled) Resolution to 3840x2160. I had to manually enter the number, as the maximum resolution that the dropdown displayed was 1920x1080. Recording with 1920x1080 resolution cut the screen in half (in both axes, thus 1/4 of the screen).

Update: happens too if not using display scaling.

@kkartaltepe
Copy link
Collaborator

Provide the full log and a gdb backtrace of the crash.

@lautarodragan
Copy link
Author

lautarodragan commented Apr 4, 2020

Here's the full log: 2020-04-04 17-22-14.txt.

How do I get a gdb backtrace of the crash?

EDIT

Is this it?

error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: 26, Serial: 7224
error: Failed to make context current.
error: Failed to fetch parent window geometry!
error: X Error: BadDrawable (invalid Pixmap or Window parameter), Major opcode: 151, Minor opcode: BadLength (poly request too large or internal Xlib length error), Serial: 7226
error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: BadAlloc (insufficient resources for operation), Serial: 7227
error: X Error: GLXBadContextTag, Major opcode: 151, Minor opcode: BadAtom (invalid Atom parameter), Serial: 7233
error: Failed to reset current context.

Thread 7 "libobs: graphic" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc78cb700 (LWP 16285)]
0x00007fffe937aa07 in ?? () from /lib/x86_64-linux-gnu/libGLX_nvidia.so.0
(gdb) backtrace
#0  0x00007fffe937aa07 in ?? () from /lib/x86_64-linux-gnu/libGLX_nvidia.so.0
#1  0x00007fffe93a80bb in ?? () from /lib/x86_64-linux-gnu/libGLX_nvidia.so.0
#2  0x00007fffeeb4ef23 in ?? () from /lib/x86_64-linux-gnu/libGLX.so.0
#3  0x00007fffeeb505a1 in ?? () from /lib/x86_64-linux-gnu/libGLX.so.0
#4  0x00007fffe890e17d in device_leave_context () from /lib/libobs-opengl.so.0
#5  0x00007ffff5ebd65e in gs_leave_context () from /lib/libobs.so.0
#6  0x00007ffff5f2d76f in obs_graphics_thread () from /lib/libobs.so.0
#7  0x00007ffff4fe8669 in start_thread (arg=<optimized out>) at pthread_create.c:479
#8  0x00007ffff4f10323 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@notr1ch notr1ch added the Linux Affects Linux label Apr 4, 2020
@kkartaltepe
Copy link
Collaborator

I cant replicate this also using 4k canvas. You would need to backtrace from the first error in order to diagnose further.

@kkartaltepe
Copy link
Collaborator

Not sure if this is the same bug but it might be related. Opening filters for a video source and then closing the filters window resulted in a crash semi consistently.

[Thread 0x7fff83d9c700 (LWP 66449) exited]
error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: 26, Serial: 72353
error: Failed to make context current.
error: Failed to fetch parent window geometry!
error: X Error: BadDrawable (invalid Pixmap or Window parameter), Major opcode: 151, Minor opcode: BadLength (poly request too large or internal Xlib length error), Serial: 72355
error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: BadAlloc (insufficient resources for operation), Serial: 72356
error: X Error: GLXBadContextTag, Major opcode: 151, Minor opcode: BadAtom (invalid Atom parameter), Serial: 72362
error: Failed to reset current context.
error: X Error: GLXBadContextTag, Major opcode: 151, Minor opcode: BadAtom (invalid Atom parameter), Serial: 72363
error: Failed to reset current context.
error: X Error: GLXBadContextTag, Major opcode: 151, Minor opcode: BadAtom (invalid Atom parameter), Serial: 72364
error: Failed to reset current context.

Thread 7 "libobs: graphic" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd4883700 (LWP 66424)]
0x00007fffe59a57cc in ?? () from /usr/lib/libnvidia-glcore.so.440.82
(gdb) bt
#0  0x00007fffe59a57cc in ?? () from /usr/lib/libnvidia-glcore.so.440.82
#1  0x00007fffe559ab50 in ?? () from /usr/lib/libnvidia-glcore.so.440.82
#2  0x00007fffe6dd82eb in gs_texture_map (tex=0x55555a9defa0, ptr=0x7fffd48828b0, linesize=0x7fffd48828ac)
    at ../libobs-opengl/gl-texture2d.c:215
#3  0x00007ffff5e3521d in gs_texture_set_image (tex=0x55555a9defa0, data=0x7fff95a04000 "333", 
    linesize=10240, flip=flip@entry=false) at ../libobs/graphics/graphics.c:1155
#4  0x00007fffced9ad21 in xshm_video_tick (seconds=<optimized out>, vptr=0x5555572832c0)
    at ../plugins/linux-capture/xshm-input.c:449
#5  xshm_video_tick (vptr=0x5555572832c0, seconds=<optimized out>)
    at ../plugins/linux-capture/xshm-input.c:419
#6  0x00007ffff5e640c2 in obs_source_video_tick (source=source@entry=0x55555a9d5080, 
    seconds=seconds@entry=0.0166666657) at ../libobs/obs-source.c:1155
#7  0x00007ffff5e9e5bc in tick_sources (last_time=<optimized out>, cur_time=45975774704107)
    at ../libobs/obs-video.c:70
#8  obs_graphics_thread (param=<optimized out>) at ../libobs/obs-video.c:904
#9  0x00007ffff4ead46f in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007ffff4ddd3d3 in clone () from /usr/lib/libc.so.6

@compucat
Copy link

compucat commented Jan 2, 2021

Hi, this is CompuCat from the TASBot team; while hosting the TASGiving 2020 charity event, we experienced crashes matching this description consistently, causing OBS to hard-crash numerous times during a marathon stream. We still managed to raise $10,000 USD for NAMI, but we need to isolate the cause of this crash to avoid it for next year's marathon.

Specifically, closing a filter window would semi-consistently trigger the crash. I don't have physical access to the stream system right now, but as soon as I can SSH back in we should be able to grab crash logs.

System was running Linux Mint (LMDE 4 IIRC) on a Threadripper 2950X/NVIDIA RTX 2070; OBS was compiled from Git master as of ~1 week before Thanksgiving. (Will edit this comment to include exact commit hash.) Issue was consistently reproduced with both NVENC and x264 encoders.

@kkartaltepe
Copy link
Collaborator

kkartaltepe commented Jan 26, 2021

I cannot replicate this after applying #4136 so I think this will it.

Was just on a lucky streak.

kkartaltepe added a commit to kkartaltepe/obs-studio that referenced this issue Jan 26, 2021
xcompcap was taking locks in the wrong order resulting in deadlocks on
close. If you had an xcompcap properties window open on close it was
nearly 100% deadlock. This ensures locks are taken in the same order as
libobs takes when shutting down.

Appears to also fix obsproject#2645
@kkartaltepe
Copy link
Collaborator

Getting a bit late for me, but applying #3782 appears to fix this (at least doesnt occur out of 40 tries compared to 1:3 chance of triggering before).

@ekordas
Copy link

ekordas commented May 3, 2021

Still having this Issue:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20.1
Release:	20.1
Codename:	ulyssa
$ obs --version
OBS Studio - 27.0.0-rc3 (linux)

installed from: deb http://ppa.launchpad.net/obsproject/obs-studio-unstable/ubuntu focal main
In version rc3 #3782 should be applied, am I right?
here is the gdb output:

obs_crash_Webcam_Settings_gdb_output.txt

Reproduction:

  • open Obs
  • open Properties of a v4l2 Video Source
    -> (Dialog is only semi working. Dropdowns are immediately closing, Sliders can only be dragged a short time, the inputfields are not editable. tThe Mouse changes quickly between default and Text Pointer while hovering them. while producing gdb output I did nothing and immediately clicked OK)
  • Click OK
    -> Nothing happens
  • Click the X in the header to close Properties Dialog
    -> Crash

Happens at 100% chance on my system

@kkartaltepe
Copy link
Collaborator

Try #4576 if you can compile which is trying to fix another issue that might cause this kind of failure.

@ekordas
Copy link

ekordas commented Jul 1, 2021

Yes, #4576 fixes it, but will it be merged? Or should this issue be reopened? Release 27.0.1 is still crashing.

@jp9000
Copy link
Member

jp9000 commented Jul 2, 2021

When it's changed from draft to ready for review it'll likely be merged

@ogmkp
Copy link

ogmkp commented Jul 29, 2021

Hello.

To relaunch this ticket:

I have a randomly crash when I close a window (filter window, properties, projector window etc ...).
It looks very similar to what has been described here, here is the log from my side:

error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: 26, Serial: 738643
error: Failed to make context current.
error: Failed to fetch parent window geometry!
error: X Error: BadDrawable (invalid Pixmap or Window parameter), Major opcode: 151, Minor opcode: BadLength (poly request too large or internal Xlib length error), Serial: 738646
error: X Error: GLXBadDrawable, Major opcode: 151, Minor opcode: BadAlloc (insufficient resources for operation), Serial: 738647
error: X Error: GLXBadContextTag, Major opcode: 151, Minor opcode: 26, Serial: 738649
error: Failed to make context current.
error: X Error: GLXBadContextTag, Major opcode: 151, Minor opcode: BadAtom (invalid Atom parameter), Serial: 738659
error: Failed to reset current context.
Erreur de segmentation

Do you think #4576 can be used in production ?

Thanks !

OBS 27.0.1
Debian 11

@tt2468
Copy link
Member

tt2468 commented Nov 21, 2021

Hi all, updating this thread to say that #4576 is looking to be released soon. Thanks for testing!

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

No branches or pull requests

9 participants