Project

General

Profile

Bug #5029

TVheadend began to fall Segmentation fault at first start...

Added by Igor Mokrushin about 2 years ago. Updated about 2 years ago.

Status:
Fixed
Priority:
Normal
Category:
SAT>IP
Target version:
-
Start date:
2018-03-24
Due date:
% Done:

100%

Estimated time:
Found in version:
4.2 git-1997b348aef
Affected Versions:

Description

Previously, this problem was not. Now it happens all the time...

Message from kernel:

do_page_fault(): sending SIGSEGV to tvh:tcp-start for invalid read access from 0000001a
epc = 76dfdc5c in libc-2.27.so[76d79000+175000]
ra  = 76dc2e38 in libc-2.27.so[76d79000+175000]

Message from gdb:

~ # gdb --args /opt/usr/sbin/tvheadend -C -B -S -u root -g root -c /opt/etc/tvheadend --satip_bindaddr 0.0.0.0 --satip_rtsp -1
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 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 "mipsel-openwrt-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/usr/sbin/tvheadend...done.
(gdb) r
Starting program: /opt/usr/sbin/tvheadend -C -B -S -u root -g root -c /opt/etc/tvheadend --satip_bindaddr 0.0.0.0 --satip_rtsp -1
warning: File "/opt/lib/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path /opt/lib/libthread_db-1.0.so
line to your configuration file "/opt/root/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/opt/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path" 
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 13706]
2018-03-24 21:03:19.030 [   INFO] main: Log started
[New LWP 13707]
[New LWP 13708]
2018-03-24 21:03:19.050 [   INFO] http: Starting HTTP server 0.0.0.0:9981
2018-03-24 21:03:19.050 [   INFO] htsp: Starting HTSP server 0.0.0.0:9982
[New LWP 13709]
2018-03-24 21:03:19.057 [   INFO] config: loaded
[New LWP 13710]
[New LWP 13711]
[New LWP 13712]
2018-03-24 21:03:19.061 [   INFO] config: scanfile (re)initialization with path <none>
[New LWP 13713]
[New LWP 13714]
[New LWP 13715]
[New LWP 13716]
[New LWP 13717]
[New LWP 13718]
2018-03-24 21:03:19.079 [   INFO] dvr: Creating new configuration ''
2018-03-24 21:03:19.080 [  ERROR] access: No access entries loaded
[New LWP 13719]
[New LWP 13720]
[New LWP 13721]
[New LWP 13722]
2018-03-24 21:03:19.087 [   INFO] csa: Using 32bit parallel descrambling
2018-03-24 21:03:19.088 [   INFO] descrambler: adding CAID 2600 as constant crypto-word (BISS)
2018-03-24 21:03:19.089 [   INFO] epggrab: module eit created
2018-03-24 21:03:19.089 [   INFO] epggrab: module uk_freesat created
2018-03-24 21:03:19.090 [   INFO] epggrab: module uk_freeview created
2018-03-24 21:03:19.090 [   INFO] epggrab: module nz_freeview created
2018-03-24 21:03:19.091 [   INFO] epggrab: module viasat_baltic created
2018-03-24 21:03:19.091 [   INFO] epggrab: module Bulsatcom_39E created
2018-03-24 21:03:19.092 [   INFO] epggrab: module psip created
2018-03-24 21:03:19.123 [   INFO] epggrab: module opentv-skyit created
2018-03-24 21:03:19.131 [   INFO] epggrab: module opentv-skyuk created
2018-03-24 21:03:19.133 [   INFO] epggrab: module opentv-skynz created
2018-03-24 21:03:19.134 [   INFO] epggrab: module opentv-ausat created
2018-03-24 21:03:19.136 [   INFO] epggrab: module pyepg created
2018-03-24 21:03:19.136 [   INFO] epggrab: module xmltv created
2018-03-24 21:03:19.141 [   INFO] spawn: Executing "/opt/usr/sbin/tv_grab_ru" 
2018-03-24 21:03:19.150 [   INFO] epggrab: module /opt/usr/sbin/tv_grab_ru created
[New LWP 13724]
[New LWP 13725]
2018-03-24 21:03:19.156 [ NOTICE] START: HTS Tvheadend version 4.2.5~1997b34-NDMS-5 started, running as PID:13703 UID:0 GID:0, CWD:/opt/root CNF:/opt/etc/tvheadend                                                                                                                                                              
[New LWP 13726]
[New LWP 13727]
[New LWP 13728]
[New LWP 13729]
2018-03-24 21:03:20.322 [WARNING] satips: SAT>IP server announces an empty tuner list to a client 127.0.0.1 (missing tuner settings - global config)                                                                                                                                                                             

Thread 24 "tvh:tcp-start" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 13729]
0x77a52c5c in strlen () from /opt/lib/libc.so.6
(gdb) print satip_server_rtsp_port
$1 = -1
(gdb) print http_server_ip
$2 = 0x0

The problem occurs when calling the function satip_server_http_xml() line 199 in src/satip/server.c. If http_server_ip NULL, also satip_server_conf.satip_uuid NULL, see function satip_server_register() line 999, so the called function snprintf() causes segfault.

I made patch that solves this problem.


Files

009-fix_segfault.patch (416 Bytes) 009-fix_segfault.patch Igor Mokrushin, 2018-03-24 20:47

Associated revisions

Revision 8c0d98c4 (diff)
Added by Jaroslav Kysela about 2 years ago

SAT>IP server: don't serve XML description when not enabled, fixes #5029

Revision 7f44b13d (diff)
Added by Jaroslav Kysela about 2 years ago

SAT>IP server: don't serve XML description when not enabled, fixes #5029

History

#1

Updated by Jaroslav Kysela about 2 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Also available in: Atom PDF