Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Graceful exit
It's necessary to do serious checks for the memory leaks using tools like valgrind. This patch tries to implement a graceful exit for all tvheadend components and free allocated memory. Also, some memory leaks were fixed.
- Loading branch information
Showing
93 changed files
with
1,268 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,7 @@ | ||
| #ifdef CONFIG_AVAHI | ||
| void avahi_init(void); | ||
| void avahi_done(void); | ||
| #else | ||
| static inline void avahi_init(void) { } | ||
| static inline void avahi_done(void) { } | ||
| #endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c07824aThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting with this commit, tvheadend crashes on startup for me:
#0 0x0000000000432404 in htsmsg_field_destroy (msg=0x7fcd20, f=0x314144542050584e) at src/htsmsg.c:40
#1 0x000000000043251a in htsmsg_clear (msg=0x7fcd20) at src/htsmsg.c:74
#2 0x0000000000432791 in htsmsg_destroy (msg=0x7fcd20) at src/htsmsg.c:178
#3 0x00000000004923b1 in linuxdvb_adapter_add (path=0x7fffffffd430 "/dev/dvb/adapter0") at src/input/mpegts/linuxdvb/linuxdvb_adapter.c:300
#4 0x0000000000492569 in linuxdvb_adapter_scan () at src/input/mpegts/linuxdvb/linuxdvb_adapter.c:363
#5 0x000000000049268e in linuxdvb_adapter_init () at src/input/mpegts/linuxdvb/linuxdvb_adapter.c:429
#6 0x00000000004918fa in linuxdvb_init (adapter_mask=-1) at src/input/mpegts/linuxdvb/linuxdvb.c:46
#7 0x000000000040763e in main (argc=1, argv=0x7fffffffe488) at src/main.c:770
c07824aThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a similar issue
Mar 7 06:49:39 server kernel: [418110.554381] tvheadend[17311]: segfault at 0 ip (null) sp 00007fffcd8de598 error 14 in tvheadend[400000+bd000]
Mar 7 06:49:40 server tvheadend[17324]: thread: created thread 139847785441024 [tvhlog_thread / 0x408c40((nil))]
Mar 7 06:49:40 server tvheadend[17324]: thread: created thread 139847777048320 [idnode_thread / 0x40a5b0((nil))]
Mar 7 06:49:40 server tvheadend[17324]: thread: created thread 139847768655616 [fsmonitor / 0x433e10((nil))]
Mar 7 06:49:40 server tvheadend[17324]: thread: created thread 139847557707520 [imagecache_thread / 0x430580((nil))]
Mar 7 06:49:40 server tvheadend[17324]: mpegts: IPTV - added network IPTV Network
Mar 7 06:49:40 server tvheadend[17324]: thread: created thread 139847540922112 [mpegts_input_tabl / 0x453dd0(0xf6d8f0)]
Mar 7 06:49:40 server tvheadend[17324]: thread: created thread 139847532529408 [iptv_input_thread / 0x46e830((nil))]
Mar 7 06:49:40 server tvheadend[17324]: CRASH: Signal: 11 in PRG: tvheadend (3.9.409~g342d0e7) [ada90958fdba3be0354053de1900efdcd6d21e38] CWD: /
Mar 7 06:49:40 server tvheadend[17324]: CRASH: Fault address (nil) (Address not mapped)
Mar 7 06:49:40 server tvheadend[17324]: CRASH: Loaded libraries: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 /usr/lib/x86_64-linux-gnu/libavcodec.so.53 /usr/lib/x86_64-linux-gnu/libavutil.so.51 /usr/lib/x86_64-linux-gnu/libavformat.so.53 /usr/lib/x86_64-linux-gnu/libswscale.so.2 /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libidn.so.11 /usr/lib/x86_64-linux-gnu/librtmp.so.0 /lib/x86_64-linux-gnu/libgcrypt.so.11 /usr/lib/x86_64-linux-gnu/libgnutls.so.26 /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 /lib/x86_64-linux-gnu/libdbus-1.so.3 /usr/lib/x86_64-linux-gnu/libvpx.so.1 /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 /usr/lib/x86_64-linux-gnu/libvorbis
Mar 7 06:49:40 server tvheadend[17324]: CRASH: Register dump [23]: 632e6362622e77776c70692f6b752e6f0076742f72657961000000000000000100007fffeaaf16c000007fffeaaf17c0000000000000ffff0000000000f60a1000000000006d1dc000007fffeaaf16c000000000006d1dc00000000000f67b7000000000000001000000000000f67c08000000000000007000007fffeaaf16a80000000000000000000000000001020200000000000000330000000000000014000000000000000efffffffe7ffbfa170000000000000000
Mar 7 06:49:40 server tvheadend[17324]: CRASH: STACKTRACE
Mar 7 06:49:40 server tvheadend[17324]: thread: created thread 139847549314816 [service_saver / 0x41f990((nil))]
Mar 7 06:49:40 server tvheadend[17324]: CRASH: /tmp/tvheadend/src/trap.c:148 0x42c4b9
c07824aThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@perexg Adding epggrab_running in
while ( epggrab_running && mod->enabled && mod->sock ) {(in module.c) causes epggrabbers that are not internal (like XMLTV) to create a socket, and exit immediately upon startup of tvheadend. Can you fix this?c07824aThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdierkse : Thanks. Fixed in 1dc009a .