Bug #947
closedCrash on malloc() - git 2.99.15.g78213
0%
Description
Using latest tvheadend (todays git), it is crashing badly.
I can see this in error log: Unable to allocate 148224 bytes
The message comes from a fprintf in parse_mpeg2video() function
(parsers.c file), due to malloc() returning NULL for some reason.
I have 2GB free RAM and I am recording entire muxes at 3 adapters
at the same time for 24 hours a day (that is about 10 channels at once).
Tvheadend crashes usually after more than 20 hours of recording.
It seems it's going this way:
ts_recv_packet1() -> ts_recv_packet0() -> parse_mpeg_ts() -> parse_mpeg2video() -> malloc gets NULL here -> abort()
Why would it crash on malloc() is a mystery for me.
Is there any free() missing?
Could anybody skilled enough review the code?
One more notice:
after a fresh start, tvheadend forks about 20 processes, all are in state S (sleeping) most of the time, and recording works just fine. But after many hours, I can see some strange processes in T state (shown by htop, I have no idea what T should mean, htop help shows T=traced/stopped, but 'ps' doesn't report these processes). Surprisingly the processes won't go down, they seem to be locked by some futex, waiting for releasing some lock.
If there is anything I could provide for better debug, let me know please!
Thank you!
Files