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

rtmpdump: use OpenSSL 1.1 to fix gstreamer crash #67842

Merged
merged 2 commits into from
Sep 1, 2019

Conversation

lopsided98
Copy link
Contributor

Motivation for this change

Using rtmpsink from gst-plugins-bad results in a segfault because gstreamer and rtmpdump are compiled with different OpenSSL versions. This is the backtrace:

#0  0xf7624d6c in nanosleep () from /nix/store/bhgs196rp1qw2cjzq073cwngw3m93wk1-glibc-2.27/lib/libpthread.so.0
#1  0xf771a358 in g_usleep () from /nix/store/n9hcw9vk2l5hd9b5yw42xqnciksb8171-glib-2.60.4/lib/libglib-2.0.so.0
#2  0x00015d10 in fault_handler_sighandler ()
#3  <signal handler called>
#4  0xf7543e10 in strcmp () from /nix/store/bhgs196rp1qw2cjzq073cwngw3m93wk1-glibc-2.27/lib/libc.so.6
#5  0xf6560344 in lh_insert () from /nix/store/fqgcwd45ryvslaqgxm50l9zmf9kag1fi-openssl-1.0.2s/lib/libcrypto.so.1.0.0
#6  0xf64dff98 in OBJ_NAME_add () from /nix/store/fqgcwd45ryvslaqgxm50l9zmf9kag1fi-openssl-1.0.2s/lib/libcrypto.so.1.0.0
#7  0xf66ca80c in ossl_init_ssl_base_ossl_ () from /nix/store/ghg74fqy28b7ygxbwrj53y2x7ln4nx8s-openssl-1.1.1c/lib/libssl.so.1.1
#8  0xf76222dc in __pthread_once_slow () from /nix/store/bhgs196rp1qw2cjzq073cwngw3m93wk1-glibc-2.27/lib/libpthread.so.0
#9  0xf63f0d18 in CRYPTO_THREAD_run_once () from /nix/store/ghg74fqy28b7ygxbwrj53y2x7ln4nx8s-openssl-1.1.1c/lib/libcrypto.so.1.1
#10 0xf66ca9e4 in OPENSSL_init_ssl () from /nix/store/ghg74fqy28b7ygxbwrj53y2x7ln4nx8s-openssl-1.1.1c/lib/libssl.so.1.1
#11 0xf66ce5e0 in SSL_CTX_new () from /nix/store/ghg74fqy28b7ygxbwrj53y2x7ln4nx8s-openssl-1.1.1c/lib/libssl.so.1.1
#12 0xf67274c8 in RTMP_TLS_Init () from /nix/store/1xv7np1j9pyngb7hk4ishjxykr0jl2yz-rtmpdump-2015-12-30/lib/librtmp.so.1
#13 0xf6727638 in RTMP_Init () from /nix/store/1xv7np1j9pyngb7hk4ishjxykr0jl2yz-rtmpdump-2015-12-30/lib/librtmp.so.1
#14 0xf674e25c in gst_rtmp_sink_start () from /nix/store/c799a6v2wjnl2anj4rz1ak9pgza4gaq0-gst-plugins-bad-1.16.0/lib/gstreamer-1.0/libgstrtmp.so
#15 0xf6f8b100 in gst_base_sink_change_state () from /nix/store/fa12vgg7kqlhvq0q3icrql7w2n9gbakw-gstreamer-1.16.0/lib/libgstbase-1.0.so.0
#16 0xf7818088 in gst_element_change_state () from /nix/store/fa12vgg7kqlhvq0q3icrql7w2n9gbakw-gstreamer-1.16.0/lib/libgstreamer-1.0.so.0
#17 0xf781887c in gst_element_set_state_func () from /nix/store/fa12vgg7kqlhvq0q3icrql7w2n9gbakw-gstreamer-1.16.0/lib/libgstreamer-1.0.so.0
#18 0xf77f07c4 in gst_bin_change_state_func () from /nix/store/fa12vgg7kqlhvq0q3icrql7w2n9gbakw-gstreamer-1.16.0/lib/libgstreamer-1.0.so.0
#19 0xf7818088 in gst_element_change_state () from /nix/store/fa12vgg7kqlhvq0q3icrql7w2n9gbakw-gstreamer-1.16.0/lib/libgstreamer-1.0.so.0
#20 0xf781887c in gst_element_set_state_func () from /nix/store/fa12vgg7kqlhvq0q3icrql7w2n9gbakw-gstreamer-1.16.0/lib/libgstreamer-1.0.so.0
#21 0x0001348c in main ()
Things done

I used Gentoo's patch to add support for OpenSSL 1.1. I also updated the package to the latest commit.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @codyopel

patches = [
# Fix build with OpenSSL 1.1
(fetchpatch {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-video/rtmpdump/files/rtmpdump-openssl-1.1.patch?id=1e7bef484f96e7647f5f0911d3c8caa48131c33b";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-video/rtmpdump/files/rtmpdump-openssl-1.1.patch?id=1e7bef484f96e7647f5f0911d3c8caa48131c33b";
name = "rtmpdump-openssl-1.1.patch";
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-video/rtmpdump/files/rtmpdump-openssl-1.1.patch?id=1e7bef484f96e7647f5f0911d3c8caa48131c33b";

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg build rtmpdump

@worldofpeace worldofpeace merged commit 6bf3d68 into NixOS:master Sep 1, 2019
@lopsided98 lopsided98 deleted the rtmpdump-openssl-1.1 branch September 1, 2019 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants