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

gstreamer crashes the X11 server! #3737

Closed
totaam opened this issue Jan 15, 2023 · 3 comments
Closed

gstreamer crashes the X11 server! #3737

totaam opened this issue Jan 15, 2023 · 3 comments
Labels
bug Something isn't working linux server X11

Comments

@totaam
Copy link
Collaborator

totaam commented Jan 15, 2023

Originally recorded in #3706 (comment)
This settles the questions of whether we should move the audio back into the main process!

What's interesting is that it somehow ends up corrupting the server process, not just the X11 client!

[Detaching after fork from child process 1557557]
[New Thread 0x7fffbf1ff6c0 (LWP 1557558)]
Xorg: ../../../include/privates.h:121: dixGetPrivateAddr: Assertion `key->initialized' failed.

Thread 1 "Xorg" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44	      return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff7645ee3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff75f5aa6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff75df7fc in __GI_abort () at abort.c:79
#4  0x00007ffff75df71b in __assert_fail_base
    (fmt=0x7ffff77549e0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555572a233 "key->initialized", file=0x55555572dbf0 "../../../include/privates.h", line=121, function=<optimized out>) at assert.c:92
#5  0x00007ffff75ee656 in __GI___assert_fail
    (assertion=assertion@entry=0x55555572a233 "key->initialized", file=file@entry=0x55555572dbf0 "../../../include/privates.h", line=line@entry=121, function=function@entry=0x55555574e9e0 <__PRETTY_FUNCTION__.7> "dixGetPrivateAddr") at assert.c:101
#6  0x00005555556d8a25 in dixGetPrivateAddr (key=<optimized out>, privates=<optimized out>) at dri2/../../../include/privates.h:121
#7  0x00005555556d90d5 in dixGetPrivateAddr (key=<optimized out>, privates=<optimized out>) at dri2/../../../include/privates.h:166
#8  dixLookupPrivate (key=<optimized out>, privates=<optimized out>) at dri2/../../../include/privates.h:164
#9  DRI2Authenticate (client=client@entry=0x555555bba410, pScreen=<optimized out>, magic=1) at dri2/dri2.c:1367
#10 0x00005555556dbb91 in ProcDRI2Authenticate (client=0x555555bba410) at dri2/dri2ext.c:156
#11 ProcDRI2Dispatch (client=0x555555bba410) at dri2/dri2ext.c:609
#12 0x000055555559ddb4 in Dispatch () at ../../dix/dispatch.c:478
#13 dix_main (envp=<optimized out>, argv=0x7fffffffd9d8, argc=18) at ../../dix/main.c:276
#14 main (argc=18, argv=0x7fffffffd9d8, envp=<optimized out>) at ../../dix/stubmain.c:34

https://github.com/freedesktop/xorg-xserver/blob/aeed57d722f2eb978c17fd7e859334d34af38d05/hw/xfree86/dri2/dri2ext.c#L140-L161

And this occurs when we call:

Gst.init(None)

According to the docs Gst.init: Initializes the GStreamer library, setting up internal path lists, registering built-in elements, and loading standard plugins.
So one of the plugins must be doing something EGL related and crashing the X11 server.

@totaam totaam added bug Something isn't working server linux X11 labels Jan 15, 2023
@totaam
Copy link
Collaborator Author

totaam commented Jan 15, 2023

And just like that... running the exact same command no longer crashes anything.
Something fixed itself in gstreamer?

@totaam totaam closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2023
@ehfd
Copy link

ehfd commented Jan 15, 2023

Build procedures and the environment for GStreamer might matter.

@totaam
Copy link
Collaborator Author

totaam commented Jan 16, 2023

@ehfd that's a plain Fedora 37 installation - crashed more than 50 times in a row... then it didn't. Without applying any security updates or any other changes!
I'm quite confident that something in the gstreamer registry changed and stopped causing problems - I will try to reproduce it again because it really looks like this is a DoS in the X11 server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux server X11
Projects
None yet
Development

No branches or pull requests

2 participants