[mythtvnz] mhegepgsnoop problem

Stephen Worthington stephen_agent at jsw.gen.nz
Thu Sep 28 09:12:59 BST 2017


On Thu, 28 Sep 2017 16:04:35 +1300, you wrote:

>I seem to be getting this issue about once in a while and it lasts a week
>because mheg data triggering it is present for that long.
>
>Not being a python person I haven't a clue...
>
>Traceback (most recent call last):
>  File "/usr/local/bin/mhegepgsnoop-0.6.1.py", line 1611, in <module>
>    main()
>  File "/usr/local/bin/mhegepgsnoop-0.6.1.py", line 772, in main
>    download2(the_pid, datablocks, module_numbers, dmxfd, demux_filter)
>  File "/usr/local/bin/mhegepgsnoop-0.6.1.py", line 1147, in download2
>    buffer.extend(dmxfd.read(3))
>IOError: [Errno 75] Value too large for defined data type

I have had that a few times recently, but for me it does not last.  It
usually is gone if I retry later in the evening, or the next day.  So
I usually do not notice when it happens as I only use the MHEG5 data
for the channels that are not available in the downloaded data, such
as Te Reo and Bravo +1, and I do not watch those channels much, if
ever.  My EPG script just uses yesterday's MHEG5 data if it can not
get today's, so it completes successfully.

When I checked my logs, it happened for me today, just after 15:10
when my EPG script runs from cron.  But when I tried again just now,
mhegepgsnoop completed successfully.

From a little googling, this seems like it could be the same sort of
problem as this:

https://stackoverflow.com/questions/4463975/value-too-large-for-defined-data-type

What it looks like is happening is that mhegepgsnoop is not reading
the dmxfd device quickly enough and a buffer overflow is happening in
dmxfd, which then causes the exception when the next read happens.  So
I have modified my copy of mhegepgsnoop to try to use a larger buffer
in the open call for dmxfd.  Unfortunately, Python does not specify
the default buffer size used - it is just "system default".  So I do
not know what the current value is.  So I thought I would just try a
decent sized buffer of 1 Mibyte and see if that worked.  So I changed
my line 763 from:

  dmxfd = open(options.demux_device, 'r')

to:

  dmxfd = open(options.demux_device, 'r', 1024*1024)

I did try a buffer size of 4096 and that consistently caused the
error, so I think I am on the right track.  I will leave the setting
at 1 Mibyte and see what happens over the next few days.

Note that my mhegepgsnoop.py file has been customised a little from
the mhegepgsnoop-0.6.1.py one, where the open line will be a few lines
earlier than in mine.



More information about the mythtvnz mailing list