catalinii / minisatip

minisatip is an SATIP server for linux using local DVB-S2, DVB-C, DVB-T or ATSC cards
https://minisatip.org
332 stars 81 forks source link

crash with git from today #73

Closed 9000h closed 9 years ago

9000h commented 9 years ago

VDR is the client, when zap to satip channel minisatip crashes but no core, so I run it with gdb

(gdb) run -l -l -l l -l -d6 -f The program being debugged has been started already. Start it from the beginning? (y or n) y `/usr/src/satip/minisatip-master/minisatip' has changed; re-reading symbols.

Starting program: /usr/src/satip/minisatip-master/minisatip -l -l -l l -l -d6 -f warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Starting minisatip version 0.1.44, dvbapi version: 0504 [27/01 18:36:54.000]: New UDP socket 7 bound to 0.0.0.0:1900 [27/01 18:36:54.000]: setting multicast for 239.255.255.250 [27/01 18:36:54.000]: New UDP socket 8 bound to 239.255.255.250:1900 [27/01 18:36:54.000]: New UDP socket 11 bound to 0.0.0.0:5500 [27/01 18:36:54.000]: New UDP socket 12 bound to 0.0.0.0:5501 [27/01 18:36:54.000]: sockets_add: handle 7 (type 0) returning socket index 0 [0.0.0.0:0] [27/01 18:36:54.000]: sockets_add: handle 8 (type 0) returning socket index 1 [0.0.0.0:0] [27/01 18:36:54.000]: sockets_add: handle 9 (type 2) returning socket index 2 [0.0.0.0:0] [27/01 18:36:54.000]: sockets_add: handle 10 (type 2) returning socket index 3 [0.0.0.0:0] [27/01 18:36:54.000]: starting init_hw 0 [27/01 18:36:54.000]: trying to open [0] adapter 0 and frontend 0 adapter.c:103 allocation_wrapper malloc allocated 9222 bytes at 0x62ccb0 [27/01 18:36:54.001]: opened DVB adapter 0 fe:13 dvr:14 [27/01 18:36:54.002]: Done setting DVR buffer to 5775360 bytes [27/01 18:36:54.002]: deleting pids on adapter 0, sid -1, pids=NULL [27/01 18:36:55.529]: Detected Adapter 0 handle 13 DVB Card Name: Philips TDA10023 DVB-C [27/01 18:36:55.529]: Detected del_sys[0] for adapter 0: dvbc [27/01 18:36:55.529]: Detected del_sys[1] for adapter 0: dvbc_annex_c [27/01 18:36:55.529]: returning default from dvb_delsys => dvbc (count 2) [27/01 18:36:55.529]: sockets_add: handle 14 (type 5) returning socket index 4 [0.0.0.0:0] [27/01 18:36:55.529]: done opening adapter 0 fe_sys 1 [27/01 18:36:55.529]: trying to open [1] adapter 1 and frontend 0 adapter.c:103 allocation_wrapper malloc allocated 9222 bytes at 0x62f0c0 [27/01 18:36:55.530]: opened DVB adapter 1 fe:15 dvr:16 [27/01 18:36:55.531]: Done setting DVR buffer to 5775360 bytes [27/01 18:36:55.531]: deleting pids on adapter 1, sid -1, pids=NULL [27/01 18:36:55.576]: Detected Adapter 1 handle 15 DVB Card Name: Montage RS6000(DVBSky) [27/01 18:36:55.576]: Detected del_sys[0] for adapter 1: dvbs [27/01 18:36:55.576]: Detected del_sys[1] for adapter 1: dvbs2 [27/01 18:36:55.576]: returning default from dvb_delsys => dvbs (count 2) [27/01 18:36:55.576]: sockets_add: handle 16 (type 5) returning socket index 5 [0.0.0.0:0] [27/01 18:36:55.576]: done opening adapter 1 fe_sys 5 [27/01 18:36:55.576]: trying to open [2] adapter 2 and frontend 0 adapter.c:103 allocation_wrapper malloc allocated 9222 bytes at 0x6314d0 [27/01 18:36:55.576]: opened DVB adapter 2 fe:17 dvr:18 [27/01 18:36:55.577]: Done setting DVR buffer to 5775360 bytes [27/01 18:36:55.577]: deleting pids on adapter 2, sid -1, pids=NULL [27/01 18:36:55.620]: Detected Adapter 2 handle 17 DVB Card Name: Montage RS6000(DVBSky) [27/01 18:36:55.620]: Detected del_sys[0] for adapter 2: dvbs [27/01 18:36:55.620]: Detected del_sys[1] for adapter 2: dvbs2 [27/01 18:36:55.620]: returning default from dvb_delsys => dvbs (count 2) [27/01 18:36:55.620]: sockets_add: handle 18 (type 5) returning socket index 6 [0.0.0.0:0] [27/01 18:36:55.620]: done opening adapter 2 fe_sys 5 [27/01 18:36:55.620]: trying to open [3] adapter 3 and frontend 0 adapter.c:103 allocation_wrapper malloc allocated 9222 bytes at 0x6338e0 [27/01 18:36:55.621]: opened DVB adapter 3 fe:19 dvr:20 [27/01 18:36:55.621]: Done setting DVR buffer to 5775360 bytes [27/01 18:36:55.621]: deleting pids on adapter 3, sid -1, pids=NULL [27/01 18:36:55.621]: Detected Adapter 3 handle 19 DVB Card Name: DRXK DVB-C DVB-T [27/01 18:36:55.621]: Detected del_sys[0] for adapter 3: dvbc [27/01 18:36:55.621]: Detected del_sys[1] for adapter 3: dvbc_annex_c [27/01 18:36:55.621]: Detected del_sys[2] for adapter 3: dvbt [27/01 18:36:55.621]: returning default from dvb_delsys => dvbc (count 3) [27/01 18:36:55.621]: sockets_add: handle 20 (type 5) returning socket index 7 [0.0.0.0:0] [27/01 18:36:55.621]: done opening adapter 3 fe_sys 1 [27/01 18:36:55.621]: done init_hw 1 Initializing with 4 devices [27/01 18:36:55.822]: ssdp_discovery fd: 7 -> NOTIFY * HTTP/1.1 HOST: 239.255.255.250:1900 CACHE-CONTROL: max-age=1800 LOCATION: http://192.168.178.133:8080/desc.xml NT: upnp:rootdevice NTS: ssdp:alive SERVER: Linux/1.0 UPnP/1.1 minisatip/0.1.44 USN: uuid:11223344-9999-0000-b7ae-0040caa2c79d::upnp:rootdevice BOOTID.UPNP.ORG: 43 CONFIGID.UPNP.ORG: 0 DEVICEID.SES.COM: 6

[27/01 18:37:03.248]: sockets_add: handle 22 (type 1) returning socket index 8 [192.168.178.101:34027] [27/01 18:37:03.248]: read RTSP (from handle 22 sock_id 8): OPTIONS rtsp://192.168.178.133/ RTSP/1.0 CSeq: 1 User-Agent: vdr-satip/2.0.0 (device 0)

[27/01 18:37:03.248]: reply -> 22 (192.168.178.101:34027) CL:0 : RTSP/1.0 200 OK Cseq: 1 Date: Tue, Jan 27 17:37:03 2015 GMT Public: OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN

[27/01 18:37:03.249]: read RTSP (from handle 22 sock_id 8): SETUP rtsp://192.168.178.133/?freq=338&sr=6900&mtype=256qam&msys=dvbc RTSP/1.0 CSeq: 2 Transport: RTP/AVP;unicast;client_port=53321-53322 User-Agent: vdr-satip/2.0.0 (device 0) If-Modified-Since: Thu, 01 Jan 1970 00:00:00 GMT

[27/01 18:37:03.249]: starting init_hw 1 [27/01 18:37:03.249]: detect_dvb_parameters (S)-> freq=338&sr=6900&mtype=256qam&msys=dvbc [27/01 18:37:03.249]: detect_dvb_parameters (E) -> src=0, fe=0, freq=338000, sr=6900000, pol=0, ro=3, msys=1, mtype=5, pltf=2, bw=8000000, inv=2, pids=NULL - apids=NULL - dpids=NULL [27/01 18:37:03.249]: Setup stream -1 parameters, sock_id 8, handle 22 stream.c:297 allocation_wrapper malloc allocated 321 bytes at 0x62c500 stream.c:299 allocation_wrapper malloc allocated 321 bytes at 0x635cf0 stream.c:301 allocation_wrapper malloc allocated 321 bytes at 0x635e40 stream.c:303 allocation_wrapper malloc allocated 1326 bytes at 0x635f90 [27/01 18:37:03.249]: Setup stream done: sid: 0 (e:1) for sock 8 handle 22 [27/01 18:37:03.249]: copy_dvb_param start -> src=0, fe=0, freq=0, sr=0, pol=, ro=0, msys=0, mtype=0, pltf=0, bw=0, inv=0, pids=NULL, apids=NULL, dpids=NULL [27/01 18:37:03.249]: copy_dvb_parameters -> src=0, fe=0, freq=338000, sr=6900000, pol=, ro=3, msys=1, mtype=5, pltf=2, bw=8000000, inv=2, pids=NULL, apids=NULL, dpids=NULL [27/01 18:37:03.249]: decode_transport ->2 0 53321 192.168.178.101 [27/01 18:37:03.249]: New UDP socket 23 connected to 192.168.178.101:53321 [27/01 18:37:03.249]: reply -> 22 (192.168.178.101:34027) CL:0 : RTSP/1.0 200 OK Cseq: 2 Date: Tue, Jan 27 17:37:03 2015 GMT Transport: RTP/AVP;unicast;source=192.168.178.133;client_port=53321-53322;server_port=40304-40305 Session: 1804289383;timeout=60 com.ses.streamID: 1

[27/01 18:37:03.250]: read RTSP (from handle 22 sock_id 8): PLAY rtsp://192.168.178.133/stream=1?pids=201,202,203,204,205,206 RTSP/1.0 CSeq: 3 Session: 1804289383 User-Agent: vdr-satip/2.0.0 (device 0)

[27/01 18:37:03.250]: starting init_hw 1 [27/01 18:37:03.250]: detect_dvb_parameters (S)-> pids=201,202,203,204,205,206 [27/01 18:37:03.250]: detect_dvb_parameters (E) -> src=-1, fe=-1, freq=-1, sr=-1, pol=-1, ro=-1, msys=-1, mtype=-1, pltf=-1, bw=-1, inv=-1, pids=201,202,203,204,205,206 - apids=NULL - dpids=NULL [27/01 18:37:03.250]: Setup stream 0 parameters, sock_id 8, handle 22 [27/01 18:37:03.250]: copy_dvb_param start -> src=0, fe=0, freq=338000, sr=6900000, pol=, ro=3, msys=1, mtype=5, pltf=2, bw=8000000, inv=2, pids=NULL, apids=NULL, dpids=NULL [27/01 18:37:03.250]: copy_dvb_parameters -> src=0, fe=0, freq=338000, sr=6900000, pol=, ro=3, msys=1, mtype=5, pltf=2, bw=8000000, inv=2, pids=201,202,203,204,205,206, apids=NULL, dpids=NULL [27/01 18:37:03.250]: Play for stream 0, type 2, rsock 23, adapter -1, sock_id 8 handle 22 [27/01 18:37:03.250]: get free adapter -1 - a[0] => e:1 m:-1 sid_cnt:0 f:0

[27/01 18:37:03.250]: Got adapter 0 on socket 8 [27/01 18:37:03.250]: set adapter 0 for stream 0 m:0 s:1 [27/01 18:37:03.250]: setting DVB parameters for adapter 0 - master_sid 0 sid 0 old f:0 [27/01 18:37:03.250]: deleting pids on adapter 0, sid -1, pids=NULL [27/01 18:37:03.250]: deleting pids on adapter 0, sid -1, pids=NULL [27/01 18:37:03.250]: copy_dvb_param start -> src=0, fe=0, freq=0, sr=0, pol=, ro=3, msys=1, mtype=0, pltf=2, bw=8000000, inv=2, pids=NULL, apids=NULL, dpids=NULL [27/01 18:37:03.250]: copy_dvb_parameters -> src=0, fe=0, freq=338000, sr=6900000, pol=, ro=3, msys=1, mtype=5, pltf=2, bw=8000000, inv=2, pids=201,202,203,204,205,206, apids=NULL, dpids=NULL [27/01 18:37:03.250]: tunning to 338000000 sr:6900000 specinv:INVERSION_AUTO delsys:dvbc mod:256qam [27/01 18:37:03.250]: setting filter on PID 201 for fd 24 [27/01 18:37:03.250]: setting filter on PID 202 for fd 25 [27/01 18:37:03.250]: setting filter on PID 203 for fd 26 [27/01 18:37:03.250]: setting filter on PID 204 for fd 27 [27/01 18:37:03.250]: setting filter on PID 205 for fd 28 [27/01 18:37:03.250]: setting filter on PID 206 for fd 29 [27/01 18:37:03.250]: reply -> 22 (192.168.178.101:34027) CL:0 : RTSP/1.0 200 OK Cseq: 3 Date: Tue, Jan 27 17:37:03 2015 GMT Transport: RTP/AVP;unicast;source=192.168.178.133;client_port=53321-53322;server_port=40304-40305 Session: 1804289383;timeout=60 com.ses.streamID: 1 RTP-Info: url=rtsp://192.168.178.133/stream=1?pids=201,202,203,204,205,206;seq=9249

* stack smashing detected *: /usr/src/satip/minisatip-master/minisatip terminated ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(fortify_fail+0x37)[0x7ffff7700e37] /lib/x86_64-linux-gnu/libc.so.6(fortify_fail+0x0)[0x7ffff7700e00] /usr/src/satip/minisatip-master/minisatip(read_rtsp+0xb79)[0x403d89] /usr/src/satip/minisatip-master/minisatip[0x40727b] /usr/src/satip/minisatip-master/minisatip(main+0x556)[0x40509e] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7ffff761776d] /usr/src/satip/minisatip-master/minisatip[0x402659] ======= Memory map: ======== 00400000-00419000 r-xp 00000000 08:01 4202355 /usr/src/satip/minisatip-master/minisatip 00618000-00619000 r--p 00018000 08:01 4202355 /usr/src/satip/minisatip-master/minisatip 00619000-0061b000 rw-p 00019000 08:01 4202355 /usr/src/satip/minisatip-master/minisatip 0061b000-0064d000 rw-p 00000000 00:00 0 [heap] 7ffff73e0000-7ffff73f5000 r-xp 00000000 08:01 12058636 /lib/x86_64-linux-gnu/libgcc_s.so.1 7ffff73f5000-7ffff75f4000 ---p 00015000 08:01 12058636 /lib/x86_64-linux-gnu/libgcc_s.so.1 7ffff75f4000-7ffff75f5000 r--p 00014000 08:01 12058636 /lib/x86_64-linux-gnu/libgcc_s.so.1 7ffff75f5000-7ffff75f6000 rw-p 00015000 08:01 12058636 /lib/x86_64-linux-gnu/libgcc_s.so.1 7ffff75f6000-7ffff77ab000 r-xp 00000000 08:01 12058925 /lib/x86_64-linux-gnu/libc-2.15.so 7ffff77ab000-7ffff79aa000 ---p 001b5000 08:01 12058925 /lib/x86_64-linux-gnu/libc-2.15.so 7ffff79aa000-7ffff79ae000 r--p 001b4000 08:01 12058925 /lib/x86_64-linux-gnu/libc-2.15.so 7ffff79ae000-7ffff79b0000 rw-p 001b8000 08:01 12058925 /lib/x86_64-linux-gnu/libc-2.15.so 7ffff79b0000-7ffff79b5000 rw-p 00000000 00:00 0 7ffff79b5000-7ffff79bc000 r-xp 00000000 08:01 12058919 /lib/x86_64-linux-gnu/librt-2.15.so 7ffff79bc000-7ffff7bbb000 ---p 00007000 08:01 12058919 /lib/x86_64-linux-gnu/librt-2.15.so 7ffff7bbb000-7ffff7bbc000 r--p 00006000 08:01 12058919 /lib/x86_64-linux-gnu/librt-2.15.so 7ffff7bbc000-7ffff7bbd000 rw-p 00007000 08:01 12058919 /lib/x86_64-linux-gnu/librt-2.15.so 7ffff7bbd000-7ffff7bd5000 r-xp 00000000 08:01 12058915 /lib/x86_64-linux-gnu/libpthread-2.15.so 7ffff7bd5000-7ffff7dd4000 ---p 00018000 08:01 12058915 /lib/x86_64-linux-gnu/libpthread-2.15.so 7ffff7dd4000-7ffff7dd5000 r--p 00017000 08:01 12058915 /lib/x86_64-linux-gnu/libpthread-2.15.so 7ffff7dd5000-7ffff7dd6000 rw-p 00018000 08:01 12058915 /lib/x86_64-linux-gnu/libpthread-2.15.so 7ffff7dd6000-7ffff7dda000 rw-p 00000000 00:00 0 7ffff7dda000-7ffff7dfc000 r-xp 00000000 08:01 12058914 /lib/x86_64-linux-gnu/ld-2.15.so 7ffff7fe5000-7ffff7fe9000 rw-p 00000000 00:00 0 7ffff7ff6000-7ffff7ffa000 rw-p 00000000 00:00 0 7ffff7ffa000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso] 7ffff7ffc000-7ffff7ffd000 r--p 00022000 08:01 12058914 /lib/x86_64-linux-gnu/ld-2.15.so 7ffff7ffd000-7ffff7fff000 rw-p 00023000 08:01 12058914 /lib/x86_64-linux-gnu/ld-2.15.so 7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

Program received signal SIGABRT, Aborted. 0x00007ffff762c0d5 in raise () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt

0 0x00007ffff762c0d5 in raise () from /lib/x86_64-linux-gnu/libc.so.6

1 0x00007ffff762f83b in abort () from /lib/x86_64-linux-gnu/libc.so.6

2 0x00007ffff766a04e in ?? () from /lib/x86_64-linux-gnu/libc.so.6

3 0x00007ffff7700e37 in __fortify_fail () from /lib/x86_64-linux-gnu/libc.so.6

4 0x00007ffff7700e00 in __stack_chk_fail () from /lib/x86_64-linux-gnu/libc.so.6

5 0x0000000000403d89 in read_rtsp (s=0x61bfe0) at minisatip.c:525

6 0x000000000040727b in select_and_execute () at socketworks.c:408

7 0x000000000040509e in main (argc=8, argv=0x7fffffffe698) at minisatip.c:825

(gdb) (gdb) print s $2 = {{sock = 7, sa = {sin_family = 2, sin_port = 27655, sin_addr = { s_addr = 2243078336}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x4048d4 , close = 0, timeout = 0x404651 , type = 0, sid = -1, rtime = 822, buf = 0x7fffffffdd30 "PLAY", lbuf = 2000, rlen = 339, close_sec = 1800000, sock_id = 0, err = 0, flags = 0}, {sock = 8, sa = {sin_family = 2, sin_port = 27655, sin_addr = {s_addr = 2243078336}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x4048d4 , close = 0, timeout = 0x404651 , type = 0, sid = -1, rtime = 822, buf = 0x7fffffffdd30 "PLAY", lbuf = 2000, rlen = 339, close_sec = 0, sock_id = 1, err = 0, flags = 0}, {sock = 9, sa = {sin_family = 0, sin_port = 0, sin_addr = { s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x404ad8 , close = 0, timeout = 0x404578 , type = 2, sid = -1, rtime = 9248, buf = 0x7fffffffdd30 "PLAY", lbuf = 2000, rlen = 0, close_sec = 0, sock_id = 2, err = 0, flags = 0}, {sock = 10, sa = { sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x404b10 , close = 0, timeout = 0x404578 , type = 2, sid = -1, rtime = 0, buf = 0x0, lbuf = 0, rlen = 0, close_sec = 0, sock_id = 3, err = 0, flags = 0}, { sock = 14, sa = {sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x40a5fa , close = 0x40e758 , timeout = 0, type = 5, sid = 0, rtime = 529, buf = 0x62ccb0 "", lbuf = 9212, rlen = 0, close_sec = 60000, sock_id = 4, err = 0, flags = 0}, {sock = 16, sa = {sin_family = 0, sin_port = 0, ---Type to continue, or q to quit--- sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x40a5fa , close = 0x40e758 , timeout = 0, type = 5, sid = 1, rtime = 576, buf = 0x62f0c0 "", lbuf = 9212, rlen = 0, close_sec = 60000, sock_id = 5, err = 0, flags = 0}, {sock = 18, sa = { sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x40a5fa , close = 0x40e758 , timeout = 0, type = 5, sid = 2, rtime = 620, buf = 0x6314d0 "", lbuf = 9212, rlen = 0, close_sec = 60000, sock_id = 6, err = 0, flags = 0}, {sock = 20, sa = {sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x40a5fa , close = 0x40e758 , timeout = 0, type = 5, sid = 3, rtime = 621, buf = 0x6338e0 "", lbuf = 9212, rlen = 0, close_sec = 60000, sock_id = 7, err = 0, flags = 0}, {sock = 22, sa = { sin_family = 2, sin_port = 60292, sin_addr = {s_addr = 1706207424}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0x403210 , close = 0x404578 , timeout = 0x40b0c5 , type = 4, sid = 0, rtime = 9249, buf = 0x7fffffffdd30 "PLAY", lbuf = 2000, rlen = 0, close_sec = 200, sock_id = 8, err = 0, flags = 0}, {sock = -1, sa = { sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}, action = 0, close = 0, timeout = 0, type = 0, sid = 0, rtime = 0, buf = 0x0, lbuf = 0, rlen = 0, close_sec = 0, sock_id = 0, err = 0, flags = 0} <repeats 91 times>} (gdb) (gdb) print s->buf $3 = (unsigned char *) 0x7fffffffdd30 "PLAY" (gdb)

9000h commented 9 years ago

ok minisatip.c:405 buf is to small, if I change it to char buf[400]; it did not crash anymore

catalinii commented 9 years ago

Thanks :)

catalinii commented 9 years ago

Fixed in the last commit