Project

General

Profile

Bug #2197

Help! On FreeBSD: internal epg grabber - xmltv child process returns immediately with no output

Added by Dreamcat 4 over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
EPG - Grabbers
Target version:
-
Start date:
2014-08-04
Due date:
% Done:

0%

Estimated time:
Found in version:
tvheadend: version 3.9.20140801-47bb0ef
Affected Versions:

Description

Trying to debug this issue, but its really been hard on my own.

It had worked on 3.4. I update to master. It not work. I regressed back to 3.4 and it was then broke there too. I cannot get any clue in the output. So try to hack spawn.c spit out extra debugging. Nothing, no clue. And seems like nothing on stderr either.

Aug 4 08:19:03 tvheadend pkg-static: tvheadend-3.9.20140801 installed
Aug 4 08:19:05 tvheadend tvheadend[78866]: upnp: upnp_thread_multicast - cannot bind 239.255.255.250:1900 [e=Can't assign requested address]
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn: program = tv_find_grabbers
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn: pipe(fd) != -1. OK, continuing...
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn: file_readall(2, outp);
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn: prog: /usr/local/bin/tv_find_grabbers, stderr: (null)
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn: file_readall(1, outp);
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn: prog: /usr/local/bin/tv_find_grabbers, stdout: (null)
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn
Aug 4 08:19:05 tvheadend tvheadend[78866]: spawn: return file_readall(fd[0], outp);

All I know is that:

  • Child process is created and fork returns with a valid PID number.
  • Child process exits or returns immediately.
  • According to tvheadend, the child process returns no output whatsoever.
  • I have 'tvheadend' user login account.
  • I have configured the _uk_rk grabber in question.
  • The grabber works on command line with "sudo -u tvheadend /usr/local/bin/tv_grab_uk_rt"
  • Feature does or can works on linux (current master). As confirmed by other IRC user.
  • Nobody else has tested this feature on FreeBSD (yet). Because 'tvheadend' login user account isn't in the ports tree.

I have speculated to Decke a lot of ideas about what might be the matter with it. But truth is don't really have a clue. Despite trying absolutely many things. Including new totally new FreeBSD jail. Going back to older p5-xmltv package. Going back to older 3.4 stable release.

Any assistance appreciated.

  • Any other guy to try to reproduce this bug and confirm or dismiss it as being FreeBSD platform-related.

So I am asking tvheadend code experts. E.g. like Andoma, Adam Sutton, perex or more recent contributors who can improve the debug logging functionality around this function entry point:

src/epggrab.c:
@
/* ****************************************************************** * Internal Grab Thread * *****************************************************************/

/* * Grab from module
*/
static void _epggrab_module_grab ( epggrab_module_int_t *mod )
@

And also in here:

src/spawn.c
@
/** * Execute the given program and return its output in a malloc()ed buffer * * *outp will point to the allocated buffer * The function will return the size of the buffer
*/

int
spawn_and_store_stdout(const char *prog, char *argv[], char **outp)
@

It would be a great help.

Another thing I am dying to see in tvheadend logs is also this error message:

tvheadend tvheadend/ root~# sudo -u tvheadend /usr/local/bin/tv_grab_uk_rt
No channels selected in configfile /usr/local/etc/tvheadend/.xmltv/tv_grab_uk_rt.conf
Please run the grabber with --configure.

But that wasn't the bug here. As the settings was setup correctly beforehand.

What could it be?

  • Something in my environment?
  • Bad user account?

tvheadend tvheadend/ root~# cat /etc/passwd | grep tvheadend
tvheadend:*:981:981:TV Headend:/usr/local/etc/tvheadend:/bin/sh

  • Problem passing execution to perl interpreter / shebang line?

tvheadend tvheadend/ root~# head $(which tv_grab_uk_rt)
#!/usr/local/bin/perl

eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell

use warnings;
use strict;
use XMLTV::ProgressBar;
use XMLTV::Memoize; XMLTV::Memoize::check_argv('get_octets');
use XMLTV::DST;

tvheadend tvheadend/ root~# which /usr/local/bin/perl
/usr/local/bin/perl

I tried my best to eliminate all those reasons before coming here. / Raising this bug. Please help.

History

#1

Updated by Dreamcat 4 over 10 years ago

Dreamcat 4 wrote:

I have speculated to Decke a lot of ideas about what might be the matter with it. But truth is don't really have a clue. Despite trying absolutely many things. Including new totally new FreeBSD jail. Going back to older p5-xmltv package. Going back to older 3.4 stable release.

Great.. ok. Once I file this bug report. Then go back to production. I find that the internal grabber is working now. The only thing different was p5-xmltv package version. Which was the older one.

I think if I had enough power / privilege to close this bug report and save others the time to read it… Then I would do that.

#2

Updated by Dreamcat 4 over 10 years ago

(my success case)


tvheadend src/ root~# ps -ax | grep tv_grab_uk_rt
86878 ?? RJ 3:20.78 /usr/local/bin/perl /usr/local/bin/tv_grab_uk_rt

^^ Grab process is running.

Then after a few minutes in tvheadend.log:


2014-08-04 10:20:16.908 [ INFO]:/usr/local/bin/tv_grab_uk_rt: parse took 0 seconds
2014-08-04 10:20:16.908 [ INFO]:/usr/local/bin/tv_grab_uk_rt: channels tot= 45 new= 0 mod= 0
2014-08-04 10:20:16.908 [ INFO]:/usr/local/bin/tv_grab_uk_rt: brands tot= 0 new= 0 mod= 0
2014-08-04 10:20:16.908 [ INFO]:/usr/local/bin/tv_grab_uk_rt: seasons tot= 0 new= 0 mod= 0
2014-08-04 10:20:16.908 [ INFO]:/usr/local/bin/tv_grab_uk_rt: episodes tot= 6781 new= 75 mod= 77
2014-08-04 10:20:16.908 [ INFO]:/usr/local/bin/tv_grab_uk_rt: broadcasts tot= 6781 new= 3839 mod= 3839


tvheadend tvheadend/ root~# pkg info | grep p5-xmltv
p5-xmltv-0.5.61_2 Set of programs to process TV (tvguide) listings in XML format
tvheadend tvheadend/ root~# tvheadend --version
tvheadend: version 3.9.20140801-47bb0ef

And then child process has exit / disappear.

#3

Updated by Dreamcat 4 over 10 years ago

This is the ultimate now. Have updated to latest p5-xmltv, so now atlas works (needs atlas' PA subscription):

2014-08-04 12:21:58.867 [ INFO]:/usr/local/bin/tv_grab_uk_atlas: grab took 499 seconds

Again, I repeat this bug was filled too soon, in error. Just close it.

Of course I could help the suggestions about where to be extra debugging of child processes. But now it works (well for me at least) I'm not really have any practical reason to still be pushing for that either.

MAYBE it started working again because this time around I disabled totally all of the other "OTA" EPGs and "Force initial scan on startup" (for OTA EPGs group).
Where: OTA = 'Over the Air'

But that is just a speculation. Whether it truly was the cause my problem or not I can't say for sure.

#4

Updated by Mark Clarkstone over 10 years ago

  • Status changed from New to Resolved

As you wish..

#5

Updated by Mark Clarkstone over 10 years ago

  • Status changed from Resolved to Rejected

Also available in: Atom PDF