Project

General

Profile

Bug #5844

Invalid value in duration field of recording will crash TVH

Added by Hiro Protagonist 5 months ago. Updated 2 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Crashes
Target version:
-
Start date:
2020-01-13
Due date:
% Done:

0%

Estimated time:
Found in version:
4.3
Affected Versions:

Description

Recently I recorded 6 programs which had the following entry in the log file:

"duration": 3746854690,

No problems arose subsequently until I restarted tvheadend. After that tvheadend would crash whenever a client with dvr access other than 'basic' or 'htsp' would connect.

Core dump showed:

#0 __GI_raise ([email protected]=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x74f9e824 in __GI_abort () at abort.c:89
#2 0x0055cbb4 in htsmsg_binary_write (
ptr=0x4 <error: Cannot access memory at address 0x4>,
[email protected]=0x6ef006f7 "\003\004", msg=<optimized out>)
at src/htsmsg_binary.c:258
#3 0x0055cb68 in htsmsg_binary_write (ptr=0x6ef006f7 "\003\004",
[email protected]=0x6ef006f1 "\001", msg=<optimized out>)
at src/htsmsg_binary.c:275
#4 0x0055cb68 in htsmsg_binary_write (ptr=0x6ef006f1 "\001",
[email protected]=0x6ef0068e "\003\b", msg=<optimized out>)
at src/htsmsg_binary.c:275
#5 0x0055cb68 in htsmsg_binary_write (ptr=0x6ef0068e "\003\b",
[email protected]=0x6ef00688 "\001", msg=<optimized out>)
at src/htsmsg_binary.c:275
#6 0x0055cb68 in htsmsg_binary_write (ptr=0x6ef00688 "\001",
[email protected]=0x6ef00474 "\002\002", msg=<optimized out>)
at src/htsmsg_binary.c:275
#7 0x0055ccac in htsmsg_binary_serialize (msg=<optimized out>,
[email protected]=0x644f0820, [email protected]=0x644f0824,
[email protected]=2147483647) at src/htsmsg_binary.c:324
#8 0x00551030 in htsp_write_scheduler (aux=0x64cf16a8)
at src/htsp_server.c:3226
#9 0x00528c28 in thread_wrapper (p=0x6e5008f8) at src/wrappers.c:159
#10 0x7514cfc4 in start_thread (arg=0x644f0ef0) at pthread_create.c:458
#11 0x75043038 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76
from /lib/arm-linux-gnueabihf/libc.so.6

The problem was due to a HMF_DBL field being sent to htsmsg_binary_write(),
which results in an abort() as HMF_DBL is not handled by switch(f->hmf_type).

Ideally, TVH should not be writing values to files that will cause it to crash when read back.

I'm running 4.3 compiled locally. The problem was the same when I tried running 4.3-1857~g221c29b40~raspbianbuster_armhf.deb


Related issues

Has duplicate Bug #5902: TVH crash if htsp client (KODI) connectsInvalid2020-05-20

Actions

History

#1

Updated by Flole Systems 3 days ago

  • Has duplicate Bug #5902: TVH crash if htsp client (KODI) connects added
#2

Updated by Flole Systems 3 days ago

Have you tried adding HMF_DBL to switch(f->hmf_type) to see what happens then? If not, could you please give that a try to see if that is fixing the issue or if an invalid time is then sent out over HTSP.

#3

Updated by Nihil Baxter 3 days ago

Mmm, i don't know as its the same bug. For me restarting TVH is not a problem, even after installing new build it crashes. Duration entry is present in file, but seems to be ok.

#4

Updated by Flole Systems 3 days ago

Restarting after the recording was meant here, I think that is exactly what you see. What is the duration entry in the file that causes the crash for you? There must be one (or multiple) files that cause the crash while they are there, when moved away tvheadend should run normally.

#5

Updated by Nihil Baxter 3 days ago

I recorded a show yesterday, after that i restarted tvh and its ok. Did a restart just before 1 Minute to check that, connected with Kodi, no crash....
As i said, at least with every update (equal which build i install) i'm not able to use Kodi till i delete all logfiles. No prblem for first, as i'm on buster no and there is no new buster build since long time ;-)

#6

Updated by Flole Systems 3 days ago

Because the new recording wasn't long enough to be considered a HMF_DBL (double). The recording that is mentioned above has a duration of 1040792 hours (so it's most likely an incorrect entry). I am sure that you have the same issue, an incorrect duration entry that just breaks everything. There is no way to figure out how it ended up there now, but I am pretty sure that there are some more memory corruptions somewhere in the code that haven't been found yet.

#7

Updated by Nihil Baxter 3 days ago

Mmm...but i remember that i backuped my older logs and copied just one of them back after updating the app just to figure out there was an corrupt file. After that i restarted the server and boom, Kodi, crash... Did that with some other one after the other, but no luck. I had to delete them all, my autorecordings are set after each try, that works.
At least i did a complete new setup, scanned all channels, created all my recording profiles, but that didnt help. If i find time maybe i will try on one of my other devices and see if i can reproduce the crash.
Btw, strange thing.

#8

Updated by Nihil Baxter 2 days ago

Checked my dvr logs again, all recorded have same "duration": 1800," value inside, planned recordings don't have this value....

#9

Updated by Flole Systems 2 days ago

You need to check that when you have the crashes. It could also be any other field there that is corrupted (like starttime or endtime).

Also available in: Atom PDF