Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11452 closed Bug Report - Crash (fixed)

mythpreviewgen SEGFAULT

Reported by: Kenni Lund [kenni a kelu dot dk] Owned by: JYA
Priority: blocker Milestone: 0.27
Component: MythTV - Video Decoding Version: 0.26-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I'm seeing mythpreviewgen segfaults more or less on a daily basis on 0.26-fixes. I'm attaching a backtrace extracted from a core dump together with the corresponding mythpreviewgen log file. The segfault was in LWP 26415.

I'll attach some more backtraces once I experience them.

Version: v0.26.0-112-g77259c5

Attachments (12)

01_mythpreview_backtrace_core.1363091143.500.26381.mythpreviewgen.txt (48.8 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
01_mythpreviewgen.20130312122530.26381.log (4.4 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
02_mythpreview_backtrace_core.1363115725.500.30436.mythpreviewgen.txt (36.5 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
03_mythpreview_backtrace_core.1363120631.500.31328.mythpreviewgen.txt (62.1 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
04_mythpreview_backtrace_core.1363121923.500.31592.mythpreviewgen.txt (43.4 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
05_mythpreview_backtrace_core.1363121925.500.31638.mythpreviewgen.txt (36.3 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
06_mythpreview_backtrace_core.1363121928.500.31687.mythpreviewgen.txt (35.9 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
07_mythpreview_backtrace_core.1363121930.500.31726.mythpreviewgen.txt (36.0 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
08_mythpreview_backtrace_core.1363121930.500.31794.mythpreviewgen.txt (44.4 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
09_mythpreview_backtrace_core.1363121934.500.31882.mythpreviewgen.txt (36.5 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
10_mythpreview_backtrace_core.1363121958.500.32510.mythpreviewgen.txt (43.0 KB) - added by Kenni Lund [kenni a kelu dot dk] 11 years ago.
0174-Player-Delete-decoder-after-decoder-thread-stopped.patch (1.1 KB) - added by stuartm 11 years ago.
Possible fix

Download all attachments as: .zip

Change History (25)

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

comment:1 Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Well, that was easy...scrolling down the list of some of the recordings on my frontend, caused ~25 mythpreviewgen segfaults/coredumps in 2 minutes :) I've extracted and attached 10 backtraces.

comment:2 Changed 11 years ago by Raymond Wagner

Component: MythTV - MythpreviewgenMythTV - Video Decoding

The segfaults are all occurring within the video decoding libraries. Is this something that should get passed upstream to FFmpeg?

comment:3 Changed 11 years ago by stuartm

Owner: set to JYA
Status: newassigned

comment:4 Changed 11 years ago by JYA

Status: assignedinfoneeded

please try with 0.27 and report if it's fixed

comment:5 Changed 11 years ago by JYA

had another idea.. can you change the playback profile to set the maximum number of CPU to just 1?

comment:6 Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

I upgraded to master on the 21st of August and it wasn't fixed in that checkout. I'll test with the playback setting on Monday.

comment:7 Changed 11 years ago by JYA

can you provide more information about the type of codec used in those recordings.. and provide a sample of a file , long enough to try running mythpreviewgen on it and attempt to reproduce your problem.

thanks

comment:8 Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Hi Jya

The recordings are H.264 with AC-3 recorded with a HDHR from DVB-C. I've extracted a 30MB sample from one of the recordings which causes the crash. Running mythpreviewgen directly on the sample causes the crash as well:

mythpreviewgen --infile mythpreviewgen_crash_11452.mpg

You can download the sample from here (doesn't require login, just click Files->Download): https://docs.google.com/file/d/0B-_nZameGeN-ZkhCdUFGRlRfVVk/edit?usp=sharing

Unfortunately, I don't have access to a working frontend at the moment, so I'm unable to test with max. CPU set to 1.

comment:9 Changed 11 years ago by stuartm

Milestone: unknown0.27
Priority: minorcritical

Kenni, can you try the attached patch?

Changed 11 years ago by stuartm

Possible fix

comment:10 Changed 11 years ago by Kenni Lund [kenni a kelu dot dk]

Stuart, the patch from Lawrence fixes the issue. I don't get any segfaults, even when running mythpreviewgen against all of my 430 recordings :) Thanks..

(and thanks to you Jya for pinpointing the core issue).

comment:11 Changed 11 years ago by Lawrence Rust <lvr@…>

Resolution: fixed
Status: infoneededclosed

In 6e62a3c601b93c6d9525cc503634350a965a5058/mythtv:

Player: Delete decoder after decoder thread stopped

It is important to delete the decoder in DecoderEnd? to ensure that any
threads allocated by the Ffmpeg decoder are stopped before the video
buffers are deallocated. If not then random crashes can be observed
when exiting playback of H264 encoded material if CPUs are > 1.

Fixes #11452

Signed-off-by: Lawrence Rust <lvr@…>
Signed-off-by: Stuart Morgan <smorgan@…>

comment:12 Changed 11 years ago by Lawrence Rust <lvr@…>

In 4fed56abd73200615fab39b31aafc62c67d94145/mythtv:

Player: Delete decoder after decoder thread stopped

It is important to delete the decoder in DecoderEnd? to ensure that any
threads allocated by the Ffmpeg decoder are stopped before the video
buffers are deallocated. If not then random crashes can be observed
when exiting playback of H264 encoded material if CPUs are > 1.

Fixes #11452

Signed-off-by: Lawrence Rust <lvr@…>
Signed-off-by: Stuart Morgan <smorgan@…>
(cherry picked from commit 6e62a3c601b93c6d9525cc503634350a965a5058)

comment:13 Changed 11 years ago by stuartm

Priority: criticalblocker
Note: See TracTickets for help on using tickets.