[mythtv] Call for testing branch devel/ffmpeg-resync (mpegts-harmonize)

Scott Theisen scott.the.elm at gmail.com
Tue Jul 26 18:10:35 UTC 2022


On 7/26/22 10:03, John Pilkington wrote:
> On 26/07/2022 13:13, John Pilkington wrote:
>> On 26/07/2022 11:04, John Pilkington wrote:
>>> On 26/07/2022 01:09, Scott Theisen wrote:
>>>> On 7/25/22 15:20, Paul Harrison wrote:
>>>>>
>>>>> That looks like same as the other abort in malloc_consolidate() 
>>>>> you reported so it's consistent at least :) Any chance you can run 
>>>>> it under valgrind?
>>>>>
>>>>>
>>>>> Paul H.
>>>>
>>>> I second running under valgrind.  "malloc_consolidate(): unaligned 
>>>> fastbin chunk detected" and "double free or corruption (fasttop)" 
>>>> tell me heap corruption is likely the culprit.
>>>>
>>>> I did change the PMT exporting from the transport stream (used for 
>>>> subtitles) to use AVBufferRef instead of a bare pointer.  In order 
>>>> to do further harmonization, it now exports every PMT.  Also, I 
>>>> converted/copied the functions to replace the deprecated AVPacket API.
>>>>
>>>> Perhaps the extra, more frequent, heap turnover from the PMT export 
>>>> is revealing a preexisting heap corruption issue, but without 
>>>> running under valgrind we can't say where the corruption is occurring.
>>>>
>>>> Regards,
>>>>
>>>> Scott Theisen
>>>>
>>> OK, I ran valgrind --leak-check=yes mythcommflag  --rebuild --file 
>>> 20001_20220725112900.ts
>>>
>>> with master, and waited...    It feels quicker on a re-run but 
>>> specifying the --log-file=filepath seems broken.  I have screen 
>>> copies of around 80 KiB, but I suppose I should now reinstall the 
>>> resync branch to get somethig more useful.
>>>
>>> ==185969== LEAK SUMMARY:
>>> ==185969==    definitely lost: 107,589 bytes in 62 blocks
>>> ==185969==    indirectly lost: 8,434 bytes in 140 blocks
>>> ==185969==      possibly lost: 672 bytes in 2 blocks
>>> ==185969==    still reachable: 98,484 bytes in 780 blocks
>>> ==185969==         suppressed: 0 bytes in 0 blocks
>>>
>>>
>>
>> valgrind log from ffpmpeg-resync on another F35 box, using
>>
>> valgrind mythcommflag --rebuild --file  <filename> 2>&1 | tee logfile
>>
>> HTH
>
> It was too big.  Compressed version instead.
>>
>> John
>>
>>

Initial impression: probable double free
```
Rebuild completed at Tue Jul 26 12:59:45 2022
==6734== Invalid free() / delete / delete[] / realloc()
==6734==    at 0x48470E4: free (vg_replace_malloc.c:872)
==6734==    by 0x6A5E72F: free_stream (utils.c:4480)
==6734==    by 0x6A6B5D0: avformat_free_context (utils.c:4515)
==6734==    by 0x6A6B842: avformat_close_input (utils.c:4564)
==6734==    by 0x50E58C8: AvFormatDecoder::CloseContext() 
(avformatdecoder.cpp:454)
==6734==    by 0x50E6648: AvFormatDecoder::~AvFormatDecoder() 
(avformatdecoder.cpp:401)
==6734==    by 0x50E6A4C: AvFormatDecoder::~AvFormatDecoder() 
(avformatdecoder.cpp:422)
==6734==    by 0x5068142: MythPlayer::SetDecoder(DecoderBase*) 
(mythplayer.cpp:1907)
==6734==    by 0x5062C7A: MythPlayer::StopPlaying() (mythplayer.cpp:965)
==6734==    by 0x50A03A7: StopPlaying (playercontext.cpp:148)
==6734==    by 0x50A03A7: PlayerContext::SetPlayer(MythPlayer*) 
(playercontext.cpp:457)
==6734==    by 0x50A0E4D: PlayerContext::TeardownPlayer() 
(playercontext.cpp:47)
==6734==    by 0x50A1B60: PlayerContext::~PlayerContext() 
(playercontext.cpp:36)
==6734==  Address 0x255e1b00 is 0 bytes inside a block of size 40 free'd
==6734==    at 0x48470E4: free (vg_replace_malloc.c:872)
==6734==    by 0x6A5E72F: free_stream (utils.c:4480)
==6734==    by 0x6A6B5D0: avformat_free_context (utils.c:4515)
==6734==    by 0x6A6B842: avformat_close_input (utils.c:4564)
==6734==    by 0x50E58C8: AvFormatDecoder::CloseContext() 
(avformatdecoder.cpp:454)
==6734==    by 0x50E6648: AvFormatDecoder::~AvFormatDecoder() 
(avformatdecoder.cpp:401)
==6734==    by 0x50E6A4C: AvFormatDecoder::~AvFormatDecoder() 
(avformatdecoder.cpp:422)
==6734==    by 0x5068142: MythPlayer::SetDecoder(DecoderBase*) 
(mythplayer.cpp:1907)
==6734==    by 0x5062C7A: MythPlayer::StopPlaying() (mythplayer.cpp:965)
==6734==    by 0x50A03A7: StopPlaying (playercontext.cpp:148)
==6734==    by 0x50A03A7: PlayerContext::SetPlayer(MythPlayer*) 
(playercontext.cpp:457)
==6734==    by 0x50A0E4D: PlayerContext::TeardownPlayer() 
(playercontext.cpp:47)
==6734==    by 0x50A1B60: PlayerContext::~PlayerContext() 
(playercontext.cpp:36)
==6734==  Block was alloc'd at
==6734==    at 0x4849803: memalign (vg_replace_malloc.c:1516)
==6734==    by 0x484991F: posix_memalign (vg_replace_malloc.c:1688)
==6734==    by 0x48A9F11: av_malloc (mem.c:86)
==6734==    by 0x48A9F11: av_mallocz (mem.c:239)
==6734==    by 0x69CEB4E: add_section_stream (mpegts-mythtv.c:2508)
==6734==    by 0x69CEB4E: pmt_cb (mpegts-mythtv.c:2809)
==6734==    by 0x69C7D49: write_section_data (mpegts-mythtv.c:537)
==6734==    by 0x69C7D49: write_section_data (mpegts-mythtv.c:479)
==6734==    by 0x69C904D: handle_packet (mpegts-mythtv.c:3384)
==6734==    by 0x69C920E: handle_packets (mpegts-mythtv.c:3549)
==6734==    by 0x69CC6D1: mpegts_read_header (mpegts-mythtv.c:3694)
==6734==    by 0x6A6C148: avformat_open_input (utils.c:609)
==6734==    by 0x50FD1CD: AvFormatDecoder::OpenFile(MythMediaBuffer*, 
bool, std::vector<char, std::allocator<char> >&) (avformatdecoder.cpp:1063)
==6734==    by 0x506995D: MythPlayer::OpenFile(int) (mythplayer.cpp:519)
==6734==    by 0x50AE668: MythCommFlagPlayer::RebuildSeekTable(bool, 
void (*)(int, void*), void*) (mythcommflagplayer.cpp:80)
```

`Conditional jump or move depends on uninitialised value(s)`s can be 
safely ignored.  They are all from Qt's SQL code and are likely caused 
by that being compiled with optimization.

Leak check shows I am leaking the last (188 byte) exported PMT, but this 
is not new and is certainly not relevant to the crash.  (I'll have to 
look into that later, regardless.  The other memory leaks probably also 
warrant investigation.)
```
==6734== 212 (24 direct, 188 indirect) bytes in 1 blocks are definitely 
lost in loss record 621 of 661
==6734==    at 0x4849803: memalign (vg_replace_malloc.c:1516)
==6734==    by 0x484991F: posix_memalign (vg_replace_malloc.c:1688)
==6734==    by 0x48A9F11: av_malloc (mem.c:86)
==6734==    by 0x48A9F11: av_mallocz (mem.c:239)
==6734==    by 0x488CBE6: av_buffer_ref (buffer.c:95)
==6734==    by 0x488CBE6: av_buffer_replace (buffer.c:236)
==6734==    by 0x69CE57C: export_pmt (mpegts-mythtv.c:2660)
==6734==    by 0x69CE57C: pmt_cb (mpegts-mythtv.c:2940)
==6734==    by 0x69C7D49: write_section_data (mpegts-mythtv.c:537)
==6734==    by 0x69C7D49: write_section_data (mpegts-mythtv.c:479)
==6734==    by 0x69C904D: handle_packet (mpegts-mythtv.c:3384)
==6734==    by 0x69C920E: handle_packets (mpegts-mythtv.c:3549)
==6734==    by 0x69C9345: mpegts_read_packet (mpegts-mythtv.c:3859)
==6734==    by 0x6A62D61: ff_read_packet (utils.c:843)
==6734==    by 0x6A63F4A: read_frame_internal (utils.c:1563)
==6734==    by 0x6A64EC7: av_read_frame (utils.c:1768)
```

Regards,

Scott


More information about the mythtv-dev mailing list