Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12655 closed Bug Report - Crash (Duplicate)

The Nuppel Video Recorder crashes with an arithmetic exception when starting to record video

Reported by: William L. DeRieux IV <williamderieux@…> Owned by: JYA
Priority: critical Milestone: 0.28
Component: MythTV - Recording Version: 0.28.0
Severity: high Keywords:
Cc: Ticket locked: no

Description

In the fixes/0.28 branch: https://github.com/MythTV/mythtv/commit/2422624fce51e4c0002af631cfbdf75105003fc9

When starting a recording (either scheduled/livetv/etc) Mythbackend crashes with an arithmetic exception.

This is the backtrace:

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7fffd12b8700 (LWP 4330)]
0x00007ffff53f724c in NuppelVideoRecorder::InitBuffers (this=0x7fffc40408a0)
    at recorders/NuppelVideoRecorder.cpp:944
944	    video_buffer_count = (videomegs * 1000 * 1000) / video_buffer_size;
(gdb) bt
#0  0x00007ffff53f724c in NuppelVideoRecorder::InitBuffers (this=0x7fffc40408a0)
    at recorders/NuppelVideoRecorder.cpp:944
#1  0x00007ffff53f55c4 in NuppelVideoRecorder::Initialize (this=0x7fffc40408a0)
    at recorders/NuppelVideoRecorder.cpp:764
#2  0x00007ffff53b7e3e in TVRec::TuningNewRecorder (this=0x94cdd0, streamData=0x0) at tv_rec.cpp:4233
#3  0x00007ffff53aef74 in TVRec::HandleTuning (this=0x94cdd0) at tv_rec.cpp:3509
#4  0x00007ffff539a591 in TVRec::run (this=0x94cdd0) at tv_rec.cpp:1315
#5  0x00007ffff4497ea0 in MThread::run (this=0x94d050) at mthread.cpp:319
#6  0x00007ffff4498775 in MThreadInternal::run (this=0x917e60) at mthread.cpp:79
#7  0x00007fffea585d2e in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fffea2d40a4 in start_thread (arg=0x7fffd12b8700) at pthread_create.c:309
#9  0x00007fffe97e787d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Change History (4)

comment:1 in reply to:  description Changed 4 years ago by William L. DeRieux IV <williamderieux@…>

Replying to William L. DeRieux IV <williamderieux@…>:

In the fixes/0.28 branch: https://github.com/MythTV/mythtv/commit/2422624fce51e4c0002af631cfbdf75105003fc9

When starting a recording (either scheduled/livetv/etc) Mythbackend crashes with an arithmetic exception.

This is the backtrace:

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7fffd12b8700 (LWP 4330)]
0x00007ffff53f724c in NuppelVideoRecorder::InitBuffers (this=0x7fffc40408a0)
    at recorders/NuppelVideoRecorder.cpp:944
944	    video_buffer_count = (videomegs * 1000 * 1000) / video_buffer_size;
(gdb) bt
#0  0x00007ffff53f724c in NuppelVideoRecorder::InitBuffers (this=0x7fffc40408a0)
    at recorders/NuppelVideoRecorder.cpp:944
#1  0x00007ffff53f55c4 in NuppelVideoRecorder::Initialize (this=0x7fffc40408a0)
    at recorders/NuppelVideoRecorder.cpp:764
#2  0x00007ffff53b7e3e in TVRec::TuningNewRecorder (this=0x94cdd0, streamData=0x0) at tv_rec.cpp:4233
#3  0x00007ffff53aef74 in TVRec::HandleTuning (this=0x94cdd0) at tv_rec.cpp:3509
#4  0x00007ffff539a591 in TVRec::run (this=0x94cdd0) at tv_rec.cpp:1315
#5  0x00007ffff4497ea0 in MThread::run (this=0x94d050) at mthread.cpp:319
#6  0x00007ffff4498775 in MThreadInternal::run (this=0x917e60) at mthread.cpp:79
#7  0x00007fffea585d2e in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007fffea2d40a4 in start_thread (arg=0x7fffd12b8700) at pthread_create.c:309
#9  0x00007fffe97e787d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

maybe a duplicate of this bug: https://code.mythtv.org/trac/ticket/12622

2016-02-19 22:51:16.758508 E RecBase?[1](/dev/video0): SetIntOption?(...width): Option not in profile. 2016-02-19 22:51:16.758523 E RecBase?[1](/dev/video0): SetIntOption?(...height): Option not in profile.

void NuppelVideoRecorder::InitBuffers?(void) -- w_out/h_out are 0 and causes video_buffer_size to be 0 (due to missing width/height in profile)

this is the root cause of the arithmetic exception (or divide by zero)

void NuppelVideoRecorder::InitBuffers(void)
{
    int videomegs;
    int audiomegs = 2;

    if (!video_buffer_size)
    {
        if (picture_format == PIX_FMT_YUV422P)
            video_buffer_size = w_out * h_out * 2;
        else
            video_buffer_size = w_out * h_out * 3 / 2;
    }

    if (width >= 480 || height > 288)
        videomegs = 20;
    else
        videomegs = 12;

    video_buffer_count = (videomegs * 1000 * 1000) / video_buffer_size;

comment:2 Changed 4 years ago by William L. DeRieux IV <williamderieux@…>

This ticket can be marked as invalid because it is duplicate of #12622

I will be updating the other ticket.

Thanks

comment:3 Changed 4 years ago by JYA

Resolution: Duplicate
Status: newclosed

comment:4 Changed 4 years ago by Stuart Auchterlonie

Milestone: 0.28.10.28
Note: See TracTickets for help on using tickets.