I've had a very inconsistent crash on OmniOS (omnios-r151036-4a32ffb911) of minidlna v1.3.0.
The inconsistency makes it difficult to diagnose, although the two crashes I have seen happen at the same location of a specific media (with about 8 minutes left). Subsequent attempts to crash have been inconsistent. When minidlna does core dump, the OS restarts the process, and I'm able to replay the media through the previously troubled spot. This is a strange one.
I did manage to get a core dump file, and pstack core show this:
root@minidlna:/var/cores# pstack core.minidlnad.10624.interview.8minsleft
core 'core.minidlnad.10624.interview.8minsleft' of 10624: /opt/ooce/minidlna/sbin/minidlnad -R -f /etc/opt/ooce/minidlna/minidln
0000000000434a84 select_del () + 74
0000000000411ce7 CloseSocket_upnphttp () + 17
0000000000413d63 ProcessHttpQuery_upnphttp () + d73
00000000004155d2 Process_upnphttp () + 2c2
00000000004348fb select_process () + cb
0000000000410640 main () + 3e0
000000000040e163 _start_crt () + 83
000000000040e0c8 _start () + 18
From what I can tell, the problem happens from here: https://sourceforge.net/p/minidlna/git/ci/v1_3_0/tree/select.c#l115.
But, I'm not familiar with the codebase to understand how this could happen.
I'm documenting this here in hopes someone can offer pointers on how to nail this down.
I've managed to crash minidlna again, using different media. The resulting
pstack coreis identical to the original post.After the OS restarts minidlna, I'm able to resume playback at through the trouble spot without issue.
Here are the facts I've observed to be true:
1. Not related to one specific media (seen on multiple media)
2. Crashes happen at the same location in the code (identical
pstack)3. Intermittent/rare (same time in media does not always crash...repeated attempts to crash at a spot rarely result in a crash)
Same on Fedora 32 with minidlna 1.3.0:
Client is a LG OLED Smart TV if that helps.
This was just fixed in OmniOS, see https://github.com/omniosorg/omnios-extra/blob/master/build/minidlna/patches/select_use_after_free.patch
I just rebuilt minidlna and will check if the patch fixes the problem.
I've just noticed I'm getting the same crash on my home server running F33. Reported to RPM Fusion bugzilla and linked this ticket.
Backtrace is similar:
The patch linked by Andy helped to fix the the problem.
I've added a MR here -- https://sourceforge.net/p/minidlna/git/merge-requests/61/
Hopefully this improves the change of it being fixed here. :)