Plugins crash... Plex Script Host: segfault at 2380 ip 0000000000002380 sp

Server Version#: v1.40.2.8395-c67dce28e

Plex Server log

Apr 27, 2024 16:46:24.053 [140535296322360] INFO - Plex Media Server v1.40.2.8395-c67dce28e - Gentoo PC x86_64 - build: linux-x86_64 debian - GMT 02:00
Apr 27, 2024 16:46:24.054 [140535296322360] INFO - Linux version: default/linux/amd64/23.0/no-multilib/systemd, language: en-US
Apr 27, 2024 16:46:24.054 [140535296322360] INFO - Processor: 12-core        Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
Apr 27, 2024 16:46:24.054 [140535296322360] INFO - Compiler is - Clang 11.0.1 (https://plex.tv 9b997da8e5b47bdb4a9425b3a3b290be393b4b1f)
Apr 27, 2024 16:46:24.054 [140535296322360] INFO - /usr/lib/plexmediaserver/Plex Media Server
Apr 27, 2024 16:46:24.149 [140535298886288] INFO - [CERT/OCSP] Successfully retrieved response from cache.
Apr 27, 2024 16:46:24.251 [140535298886288] INFO - Running migrations. (EPG 0)
Apr 27, 2024 16:46:24.307 [140535298886288] INFO - Running migrations. (EPG 0)
Apr 27, 2024 16:46:26.524 [140535225350968] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:26.524 [140535225350968] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:46:26.524 [140535225350968] ERROR - Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:46:26.524 [140535294118712] WARN - JobManager: Could not find job for handle 151238
Apr 27, 2024 16:46:27.087 [140535289310008] WARN - [EventSourceClient/pubsub/139.162.215.242:443] MyPlex: attempted a reachability check but we're not yet mapped.
Apr 27, 2024 16:46:28.663 [140535225350968] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:28.663 [140535225350968] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:46:28.663 [140535225350968] ERROR - Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:46:28.663 [140535294118712] WARN - JobManager: Could not find job for handle 151259
Apr 27, 2024 16:46:30.406 [140535175158584] INFO - [Req#25] AutoUpdate: no updates available
Apr 27, 2024 16:46:30.809 [140535183727416] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:30.809 [140535183727416] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.agents.themoviedb], we're killing it.
Apr 27, 2024 16:46:30.809 [140535183727416] ERROR - Error received reading configuration for com.plexapp.agents.themoviedb
Apr 27, 2024 16:46:30.809 [140535294118712] WARN - JobManager: Could not find job for handle 151296
Apr 27, 2024 16:46:30.837 [140535201569592] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:30.837 [140535201569592] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.agents.plexthememusic], we're killing it.
Apr 27, 2024 16:46:30.837 [140535201569592] ERROR - Error received reading configuration for com.plexapp.agents.plexthememusic
Apr 27, 2024 16:46:30.837 [140535294118712] WARN - JobManager: Could not find job for handle 151299
Apr 27, 2024 16:46:30.844 [140535185836856] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:30.844 [140535185836856] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.agents.thetvdb], we're killing it.
Apr 27, 2024 16:46:30.844 [140535185836856] ERROR - Error received reading configuration for com.plexapp.agents.thetvdb
Apr 27, 2024 16:46:30.844 [140535294118712] WARN - JobManager: Could not find job for handle 151297
Apr 27, 2024 16:46:32.935 [140535231757112] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:32.935 [140535231757112] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:46:32.935 [140535231757112] ERROR - Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:46:32.935 [140535294118712] WARN - JobManager: Could not find job for handle 151312
Apr 27, 2024 16:46:35.082 [140535183727416] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:35.082 [140535183727416] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.agents.imdb], we're killing it.
Apr 27, 2024 16:46:35.082 [140535183727416] ERROR - Error received reading configuration for com.plexapp.agents.imdb
Apr 27, 2024 16:46:35.082 [140535294118712] WARN - JobManager: Could not find job for handle 151334
Apr 27, 2024 16:46:35.093 [140535227530040] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:35.093 [140535227530040] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:46:35.093 [140535294118712] WARN - JobManager: Could not find job for handle 151336
Apr 27, 2024 16:46:35.093 [140535227530040] ERROR - Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:46:37.209 [140535214803768] ERROR - Unknown metadata type: 
Apr 27, 2024 16:46:37.226 [140535242312504] ERROR - BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:37.226 [140535242312504] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:46:37.226 [140535242312504] ERROR - Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:46:37.226 [140535294118712] WARN - JobManager: Could not find job for handle 151354
Apr 27, 2024 16:46:37.277 [140535227530040] ERROR - Unknown metadata type: 
....
Apr 27, 2024 16:46:56.541 [140535219022648] ERROR - Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:46:56.542 [140535219022648] ERROR - Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:46:56.542 [140535294118712] WARN - JobManager: Could not find job for handle 151516
Apr 27, 2024 16:46:56.557 [140535235975992] ERROR - [Req#4b] BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:46:56.557 [140535235975992] ERROR - [Req#4b] Timeout or error reading status line from plug-in pipe [com.plexapp.agents.imdb], we're killing it.
Apr 27, 2024 16:46:56.557 [140535235975992] ERROR - [Req#4b] Error received reading configuration for com.plexapp.agents.imdb
Apr 27, 2024 16:46:56.557 [140535294118712] WARN - JobManager: Could not find job for handle 151519
Apr 27, 2024 16:46:56.557 [140535235975992] ERROR - downloadContainer: expected MediaContainer element, found html
Apr 27, 2024 16:46:56.557 [140535235975992] ERROR - IVA: failed to get IMDB prefs
Apr 27, 2024 16:49:01.117 [140535208442680] ERROR - [Req#71] BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:49:01.117 [140535208442680] ERROR - [Req#71] Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:49:01.117 [140535208442680] ERROR - [Req#71] Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:49:01.117 [140535294118712] WARN - JobManager: Could not find job for handle 151644
Apr 27, 2024 16:49:05.893 [140535208442680] ERROR - [Req#73] BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:49:05.893 [140535208442680] ERROR - [Req#73] Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:49:05.893 [140535208442680] ERROR - [Req#73] Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:49:05.893 [140535294118712] WARN - JobManager: Could not find job for handle 151683
Apr 27, 2024 16:49:12.898 [140535208442680] ERROR - [Req#74] BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:49:12.898 [140535208442680] ERROR - [Req#74] Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:49:12.898 [140535208442680] ERROR - [Req#74] Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:49:12.898 [140535294118712] WARN - JobManager: Could not find job for handle 151695
Apr 27, 2024 16:49:34.151 [140535208442680] ERROR - [Req#75] BufferingLineReader: failed to read line (error: -1)
Apr 27, 2024 16:49:34.151 [140535208442680] ERROR - [Req#75] Timeout or error reading status line from plug-in pipe [com.plexapp.system], we're killing it.
Apr 27, 2024 16:49:34.151 [140535208442680] ERROR - [Req#75] Error received reading configuration for com.plexapp.system
Apr 27, 2024 16:49:34.151 [140535294118712] WARN - JobManager: Could not find job for handle 151719

dmesg

[  +1.799060] Plex Script Hos[4296]: segfault at 2380 ip 0000000000002380 sp 00007fffbe446c28 error 14 likely on CPU 1 (core 1, socket 0)
[  +0.002532] Code: Unable to access opcode bytes at 0x2356.
[  +0.003905] Plex Script Hos[4297]: segfault at 2380 ip 0000000000002380 sp 00007ffc179aeeb8 error 14 likely on CPU 6 (core 0, socket 0)
[  +0.002521] Code: Unable to access opcode bytes at 0x2356.
[  +0.002804] Plex Script Hos[4295]: segfault at 2380 ip 0000000000002380 sp 00007fffdac41388 error 14 likely on CPU 10 (core 4, socket 0)
[  +0.002537] Code: Unable to access opcode bytes at 0x2356.
[  +1.768281] Plex Script Hos[4315]: segfault at 2380 ip 0000000000002380 sp 00007ffc663be358 error 14 likely on CPU 11 (core 5, socket 0)
[  +0.002510] Code: Unable to access opcode bytes at 0x2356.
[  +0.026296] Plex Script Hos[4320]: segfault at 2380 ip 0000000000002380 sp 00007fffbe34b948 error 14 likely on CPU 0 (core 0, socket 0)
[  +0.002494] Code: Unable to access opcode bytes at 0x2356.
[  +1.787343] Plex Script Hos[4346]: segfault at 2380 ip 0000000000002380 sp 00007ffc15a3d0a8 error 14 likely on CPU 8 (core 2, socket 0)

coredumpctl

           PID: 14527 (Plex Script Hos)
           UID: 103 (plex)
           GID: 103 (plex)
        Signal: 11 (SEGV)
     Timestamp: Sun 2024-04-28 22:55:29 CEST (1h 24min ago)
  Command Line: $'Plex Plug-in [com.plexapp.agents.fanarttv]' /usr/lib/plexmediaserver/Resources/Plug-ins-c67dce28e/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.40.2.8395-c67dce28e /usr/lib/plexmediaserver/Resources/Plug-ins-c67dce28e/Fanart-TV.bundle
    Executable: /usr/lib/plexmediaserver/Plex Script Host
 Control Group: /system.slice/plex-media-server.service
          Unit: plex-media-server.service
         Slice: system.slice
       Boot ID: 9c3fb7afca914b83a4ff87ec5d964aa4
    Machine ID: fd2bad813feff8c884b04a545d596770
      Hostname: localhost
       Storage: /var/lib/systemd/coredump/core.Plex\x20Script\x20Hos.103.9c3fb7afca914b83a4ff87ec5d964aa4.14527.1714337729000000.zst (present)
  Size on Disk: 3.6M
       Message: Process 14527 (Plex Script Hos) of user 103 dumped core.
                
                Module libuuid.so.1 without build-id.
                Module libc++.so.2 without build-id.
                Module ld-musl-x86_64.so.1 without build-id.
                Module libgcompat.so.0 without build-id.
                Stack trace of thread 14527:
                #0  0x0000000000002380 n/a (n/a + 0x0)
                ELF object binary architecture: AMD x86-64


Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000002380 in ?? ()
(gdb) bt
#0  0x0000000000002380 in ?? ()
#1  0x00007f5004ddbabf in _dlstart () from /usr/lib/plexmediaserver/lib/ld-musl-x86_64.so.1
#2  0x0000000000000018 in ?? ()
#3  0x00007f500241edc0 in ?? ()
#4  0x0000000000000001 in ?? ()
#5  0x00007f5002400d70 in ?? ()
#6  0x000000001e907fee in ?? ()
#7  0x00000000000002d2 in ?? ()
#8  0x00000000000003d8 in ?? ()
#9  0x0000000000008fe8 in ?? ()
#10 0x0000000000000000 in ?? ()

This is a weird error which I’ve not seen before.

Regrettably, you’re using Gentoo. While it does work, it’s not vetted / supported.
The most I can recommend is

  1. Uninstall the package and downgrade to the previous release
  2. See if that resolves the coredump issue.

I will also ask if which version of Python is installed (the system.bundle still relies on some python modules and, if you preempt the libraries Plex ships with, you can get this type of error

Thanks for help!

For more info, I’ve been able to “remove” the crash.

In the coredump, libuuid.so is listed.

It crashes (segfault) in Plex python2, when it uses import uuid on this code (uuid.py) :

As you mention, i think it loads libuuid.so from system, as I haven’t found it in plex lib.

However… when i manually run Plex python2, and import uuid, it seams to import without issue.

Sadly I can’t reproduce the bug outside Plex Media Server itself, when it loads plugins.

My system runs only with Python3.11

I’m starting Plex Media Server from /usr/lib/plexmediaserver/Resources/start.sh

This is sounding like you have a mix of 2.7 and 3.x – which is known to fail in a variety of ways coupled with the unknown element of Gentoo.

Have you considered containerizing it (LXC debian/ubuntu or docker (which is Ubuntu)

Well, I’ve been able to “fix” the crash by “patching” Plex python2 uuid.py to avoid dynamic loading of my system libuuid.so

It doesn’t seam to affect Plex, now all plugins are able to load and Plex is running fine again.

Hopefully Plex will drop python 2.7 before I move to Docker :wink:

Dropping python 2.7 has been a long slow process.
All the agents and scanners are C+.
Only the System bundle remains; which is where yours was faulting.

I will write this up for Engineering to look at and hopefully fix.

EDIT: Submitted to Engineering.

Happy to hear that’s planned :slight_smile:

You can mention that Plex Python2 relies on system libuuid.so if they weren’t aware of, but IMO not worth going further that this. I agree it’s easier to maintain and test software on widely used Linux distributions, particularly those with point releases, compared to rolling release distributions such as Gentoo, especially with the level of personalization they offer…

I’ll see if I can isolate the bug and post here if I find something. It didn’t happen directly with Plex Python2 interactive shell (picture above) but it seams to occur when loading bootstrap.py in Plex plugin.

All good tho, I’m pleased that Plex is back up and running smoothly again :slight_smile: