Ubuntu 18.04.2 LTS - Plex Server Crashes - Double free or corruption (!prev)

I am also having these sporadic crashes. It seems to occur between watching episodes of a television show, though I do not know the root cause, this is just merely a symptom. I was playing an episode, got to the end, Plex automatically went to play the next, and that’s when I noticed it taking a while to buffer. I inspected the service and I see the same crash error as the original reporter.

Apr 08 22:37:20 anvil.localdomain sh[2499]: double free or corruption (!prev)
Apr 08 22:37:20 anvil.localdomain sh[2499]: ****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Crash Reports/1.15.3.876-ad6e39743/PLEX MEDIA SERVER/551b520a-4c20-f6ce-0d201c8e-33440253.dmp

I am using the RPM package from Plex’s RPM repository with Fedora 29 x86_64.

$ rpm -q -i plexmediaserver
Name        : plexmediaserver
Version     : 1.15.3.876
Release     : ad6e39743
Architecture: x86_64
Install Date: Fri 05 Apr 2019 03:41:02 PM CDT
Group       : Converted/video
Size        : 236118350
License     : Plex Inc.
Signature   : RSA/SHA1, Thu 04 Apr 2019 02:33:56 AM CDT, Key ID 97203c7b3adca79d
Source RPM  : plexmediaserver-1.15.3.876-ad6e39743.src.rpm
Build Date  : Thu 04 Apr 2019 02:33:18 AM CDT
Build Host  : build-slave-linux03.corp.sjc.plex.bz
Relocations : (not relocatable)
Summary     : Plex organizes all of your personal media so you can easily access and enjoy it.
Description :
Plex organizes all of your personal media so you can easily access and enjoy it.

This is the 3rd or 4th time it’s crashed within the last two weeks. There were new releases recently that I believe are the cause. This wasn’t happening a few versions ago (about a month ago).

I believe this bug is something new in plexmediaserver version 1.15.1.791-8bec0f76c. The last stable release I was running on was 1.14.1.5488-cc260c476.

It’s really a bummer because the systemd service doesn’t auto-restart the process when it crashes, the service reports everything is running; the process id stays running when it crashes, instead of exiting on failure, which is why the systemd watchdog thinks everything is fine when it’s not.

$ sudo systemctl status plexmediaserver -n 2
● plexmediaserver.service - Plex Media Server
   Loaded: loaded (/usr/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-04-06 01:51:27 CDT; 2 days ago
  Process: 2497 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/SUCCESS)
 Main PID: 2499 (Plex Media Serv)
    Tasks: 132 (limit: 4915)
   Memory: 6.1G
   CGroup: /system.slice/plexmediaserver.service
           ├─  461 Plex EAE Service
           ├─ 2499 /usr/lib/plexmediaserver/Plex Media Server
           ├─ 2539 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-ad6e39743/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.15.3.876-ad6e39743 /usr/lib/plexmediaserver/Resources/Plug-ins-ad6e39743/System.bundle
           ├─ 2601 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.15.3.876-ad6e39743 32600 /waitmutex
           └─18680 /usr/lib/plexmediaserver/Plex Transcoder -codec:0 h264 -codec:1 ac3 -analyzeduration 20000000 -probesize 20000000 -i /srv/Movies/Glass.2019.1080p.WEB-DL.DD5.1.H264-CMRG/Glass.2019.1080p.WEB-DL.DD5.1.H264-CMRG.mkv -filter_complex [0:0]scale=w=718:h=300[0];[0]format=pix_fmts=yuv420p|nv1>

Apr 08 22:37:20 anvil.localdomain sh[2499]: double free or corruption (!prev)
Apr 08 22:37:20 anvil.localdomain sh[2499]: ****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Crash Reports/1.15.3.876-ad6e39743/PLEX MEDIA SERVER/551b520a-4c20-f6ce-0d201c8e-33440253.dmp
lines 1-16/16 (END)

When the crash occurs, the only resolution is to SIGKILL (sudo kill -9) all PIDs listed under the systemd service, then let systemd restart the services.

I am also on the following Linux kernel and uptime:

$ uname -r ; uptime
5.0.3-200.fc29.x86_64
 22:48:57 up 11 days,  4:51,  3 users,  load average: 3.10, 3.25, 3.44

The specifications of the host can be found at pcpartpicker. The two 5TB HDDs are attached to the motherboard joined in LVM striped pair and formatted with ext4.

I’ve attached the crash report and log directories from my server.

Logs-2019-04-08.7z (4.3 MB)