Mediacenter crashes after multiple audio playback (segfault)

Hey,

I’m using Plex4Kodi on my OSMC Vero 4K. The mediacenter reproducably crashes after a couple of songs (playlist, shuffled, doesn’t matter). It doesn’t happen on Windows with Kodi and Plex4Kodi, so I’m assuming this is an OSMC-related issue.

Full log: https://paste.osmc.tv/ajuhohehiw

Snippet:

Aug 29 16:33:01 osmc kernel: channel count should be 8, we got 2 aborting
Aug 29 16:33:01 osmc kernel: aml_snd_m8_card aml_m8_snd.46: I2S playback enable
Aug 29 16:33:01 osmc kernel: aml_snd_m8_card aml_m8_snd.46: IEC958 playback enable
Aug 29 16:33:01 osmc kernel: kodi.bin[798]: unhandled level 2 translation fault (11) at 0x65636375, esr 0x92000006
Aug 29 16:33:01 osmc kernel: pgd = ffffffc0603db000
Aug 29 16:33:01 osmc kernel: [65636375] *pgd=00000000595a7003, *pmd=0000000000000000
Aug 29 16:33:01 osmc kernel: 
Aug 29 16:33:01 osmc kernel: CPU: 1 PID: 798 Comm: kodi.bin Tainted: G           O 3.14.29-113-osmc #1
Aug 29 16:33:01 osmc kernel: task: ffffffc0604a4000 ti: ffffffc0625d0000 task.ti: ffffffc0625d0000
Aug 29 16:33:01 osmc kernel: PC is at 0xf60844a8
Aug 29 16:33:01 osmc kernel: LR is at 0xab5150fb
Aug 29 16:33:01 osmc kernel: pc : [<00000000f60844a8>] lr : [<00000000ab5150fb>] pstate: 28030030
Aug 29 16:33:01 osmc kernel: sp : 00000000ff8d52e0
Aug 29 16:33:01 osmc kernel: x12: 00000000acde46bc 
Aug 29 16:33:01 osmc kernel: x11: 00000000adcbc794 x10: 00000000afa15bf0 
Aug 29 16:33:01 osmc kernel: x9 : 00000000adcbc700 x8 : 00000000ff8d54e0 
Aug 29 16:33:01 osmc kernel: x7 : 00000000afa15bf8 x6 : 00000000afa15bf8 
Aug 29 16:33:01 osmc kernel: x5 : 0000000075667373 x4 : 0000000065636375 
Aug 29 16:33:01 osmc kernel: x3 : 00000000adcbc794 x2 : 0000000000000009 
Aug 29 16:33:01 osmc kernel: x1 : 00000000afa15bf8 x0 : 0000000065636375 
Aug 29 16:33:01 osmc kernel: 
Aug 29 16:33:02 osmc kernel: aml_snd_m8_card aml_m8_snd.46: I2S playback disable
Aug 29 16:33:02 osmc kernel: aml_snd_m8_card aml_m8_snd.46: IEC958 playback disable
Aug 29 16:33:03 osmc sudo[789]: pam_unix(sudo:session): session closed for user osmc
Aug 29 16:33:03 osmc mediacenter[451]: /usr/bin/mediacenter: line 187:   789 Segmentation fault      sudo -u osmc $KODI --standalone -fs --lircdev /var/run/lirc/lircd
Aug 29 16:33:03 osmc mediacenter[451]: Kodi exited with return code 139 after 0 hours, 33 minutes and 42 seconds

Thank you!

Hi,

Is there a specific file that can cause these crashes regularly?

Sam

No, it’s completely random (the playlist has over 1000 entries and is shuffled) - I wasn’t able to pinpoint any specific files that cause this. Tends to happen after about half an hour.

Can I do anything to further help with this issue?

Can you try using a different Plex plugin, even temporarily, and seeing if the issue persists?

Sam

I can try adding the Playlist directly in kodi via nfs and see whether the issue persists.

Nevertheless, even if there’s something wrong with how P4k handles playlists, Kodi shouldn’t hard crash.

That would be even better if you don’t mind.

Your log shows a Python add-on related crash.
Can you think of any other add-ons that could be responsible for this crash?

Sam

Only the youtube plugin and tubecast are installed besides P4K.

Can you see what kind of error it is, or any more details? It unfortunately crashes so hard that the kodi log doesn’t get updated once that happens, so I can’t debug this properly (I’ve got quite a lot of insight on the P4K code, as I’ve been working on it for the last couple of months).

OK, I’ve had another crash and have noticed that there were log entries from skinhelperservice right at the end. It was installed with the Aura skin and I’ve removed all of the remnants of it including the skinhelperservice addons now - they seem to have been from a beta repository.

Log-snippet from when that happened:

16:09:16.254 T:4080136960   DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc
16:09:16.254 T:4080136960   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay
16:09:16.264 T:4060082944  NOTICE: script.plex: Extracting track info from comment
16:09:16.267 T:4060082944  NOTICE: script.plex: API: GET https://192-168-0-2.39b73a3adf8f490897aa6cd96d330619.plex.direct:32400/library/metadata/163510?X-Plex-Token=****
16:09:16.326 T:3858109184   DEBUG: Skin Helper Service --> Kodi_Monitor: sender xbmc - method: Player.OnPlay  - data: {"item":{"album":"100 Oldie-CD's  CD041","artist":["Searchers"],"title":"Western Union","track":12,"type":"song"},"player":{"playerid":0,"speed":1}}
16:09:16.346 T:3841331968   DEBUG: Skin Helper Widgets --> Kodi_Monitor: sender xbmc - method: Player.OnPlay  - data: {"item":{"album":"100 Oldie-CD's  CD041","artist":["Searchers"],"title":"Western Union","track":12,"type":"song"},"player":{"playerid":0,"speed":1}}
--- CRASH ---

Waiting for another crash.

Yep, still happens. @sam_nazarko I’m pretty much out of ideas here.

Do you have the full logs after this crash?
My guess is a bad file, which could be hard to track down

Hmm doesn’t seem like a bad file - I just did what I promised above and created a new kodi playlist with all the items inside. Didn’t crash - I might have just been “unlucky” not to hit the file, I’ll try again tomorrow.

I don’t have the logs for the previous crash unfortunately.

@sam_nazarko is there a way to run the python portion of xbmc/kodi with gdb/debugging options?

Also do you have information about the modules shipped (versions)?

The best way to find a problematic file is to split the folder in to two.

If you only have one bad file only one folder will crash. That folder crashes you split that folder in to two until you find the culprit

Sam

If you run gdb, it applies to the entire process.

you could then do threat bt all for a backtrace.

Sam

OK, here’s the log with mediacenter started with gdb: https://paste.osmc.tv/miniyoyati

GDB log: https://paste.osmc.tv/qiqofameve

This is before the crash (might not be related?):

04:18:48.713 T:3469361920   ERROR: ffmpeg[CECA4300]: [mp3] Header missing
04:18:50.687 T:3469361920    INFO: PAPlayer::ProcessStream - Stream Finished
04:18:50.688 T:3295150848   DEBUG: Thread FileCache 3295150848 terminating

I can get you the “broken” file(s) in question (all files that were played last before crashes play well in foobar and show no issues with the headers), would that help? Although those shouldn’t result in Kodi crashing, right?

Are those related? #5689 (Regression in mp3 "missing header") – FFmpeg Missing header when decoding mp3 file with ffmpeg - Stack Overflow

That’s an old post, so a few possibilities:

  • It’s an issue, but rare, so hasn’t been addressed
  • It’s still an outstanding issue

My guess is that it’s indicative of further problems with the file.

Are you saying that you have specific file(s), that I can play and will crash Kodi? That would be interesting.

Sam

I’m not sure to be honest. I’ve just been looking at the last files that were (to be) played before the crashes. From what I was able to gather from native kodi playlist not crashing, I think it might be an issue connected to how P4K “instructs” Kodi to play a file and/or how the file is accessed (HTTP vs. filesystem). Although all of those files are direct played.

The only thing those files had in common were comment headers from ReplayGain; all of them played well in foobar.

I might be totally wrong here, I’ll conduct more crash runs tomorrow and collect/post the logs.

Do you need the full gdb shebang for those runs?

I don’t, but in honesty, I’m not sure how I can help you at this stage.
This may be a tricky one to resolve.

What you could do is make a new playlist. If you’re anything like me, you’ll listen to the same music over and over until you’re tired of it. If that still exhibits problems it’s less likely to be a problem with the files themselves.

We need to work out if it’s an add-on problem or file problem. We haven’t had reports of this before but we don’t have many P4K users. I think the number of users will grow a bit as Plex have somewhat neglected their official add-on.

Sam

I could create another playlist with a similar amount of files of a different set of files and see whether I can get it to crash, yeah.

Definitely. As I said, I’m working on P4K and I notice those issues because it’s my daily driver now.

That has been an issue. Fortunately I’ve had some time to put into P4K during the past few weeks/months: Pull requests · plexinc/plex-for-kodi · GitHub - I won’t be able to keep this pace up, but I think we’ve come a long way.