sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 215 forks source link

Segfault after loading dynamic `modules/ngx_rtmp_module.so` and rtmp to config #93

Closed csreynolds closed 8 years ago

csreynolds commented 8 years ago

Using the following sources on el7 on a fresh install: https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/archive/v1.1.7.10.tar.gz http://nginx.org/download/nginx-1.9.12.tar.gz

uname -a
Linux nginx-box 3.10.0-327.10.1.el7.x86_64 #1 SMP Sat Jan 23 04:54:55 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
yum install automake autoconf gcc GeoIP-devel gd-devel pcre-devel openssl-devel
tar xzf v1.1.7.10.tar.gz
tar xzf nginx-1.9.12.tar.gz
cd nginx-1.9.12
./configure --add-dynamic-module=../nginx-rtmp-module-1.1.7.10/
make
make install

/usr/local/nginx/sbin/nginx 
nginx version: nginx/1.9.12
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) 
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --add-dynamic-module=../nginx-rtmp-module-1.1.7.10/

ls -l /usr/local/nginx/modules/
total 1752
-rwxr-xr-x 1 root root 1792703 Mar  3 16:09 ngx_rtmp_module.so

vim /usr/local/nginx/conf/nginx.conf
add "load_module modules/ngx_rtmp_module.so;" below log lines

nginx runs at this point add Multi-worker streaming example from readme to bottom of /usr/local/nginx/conf/nginx.conf

rtmp_auto_push on;

rtmp {
    server {
        listen 1935;

        application mytv {
            live on;
        }
    }
}

attempt to start nginx

/usr/local/nginx/sbin/nginx
Segmentation fault

trace

gdb /usr/local/nginx/sbin/nginx
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/nginx/sbin/nginx...done.
(gdb) run
Starting program: /usr/local/nginx/sbin/nginx 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
ngx_rtmp_core_server (cf=0x7fffffffe0f0, cmd=<optimized out>, conf=<optimized out>) at ../nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.c:389
389     cscf->ctx = ctx;
Missing separate debuginfos, use: debuginfo-install glibc-2.17-106.el7_2.4.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.13.2-10.el7.x86_64 libcom_err-1.42.9-7.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 openssl-libs-1.0.1e-51.el7_2.4.x86_64 pcre-8.32-15.el7.x86_64 xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64

help? :)

csreynolds commented 8 years ago

Note: I can compile without dynamic module and nginx functions with rtmp loaded

./configure --add-module=../nginx-rtmp-module-1.1.7.10/

Looks like dynamic module building is not functioning as designed.

csreynolds commented 8 years ago

Using master after #104 and nginx-1.9.14, problem looks solved!

Thanks, denji.