Opened 8 years ago

Closed 8 years ago

#10121 closed Patch - Bug Fix (fixed)

assert in Jitterometer::RecordCycleTime due to count=-1

Reported by: Jon Burgess <jburgess777@…> Owned by: markk
Priority: minor Milestone: 0.25
Component: MythTV - Video Playback Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


When the video playback data is displayed I see the following assert:

ASSERT failure in QVector<T>::operator[]: "index out of range", file /usr/include/QtCore/qvector.h, line 347

Program received signal SIGABRT, Aborted.
0x0000003738e352d5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  0x0000003738e352d5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x0000003738e36beb in __GI_abort () at abort.c:93
#2  0x0000003b6006ac04 in qt_message_output (msgType=<optimized out>, buf=<optimized out>) at global/qglobal.cpp:2291
#3  0x0000003b6006adbf in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=
    0x3b601b83c8 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0x7fffffffa838) at global/qglobal.cpp:2337
#4  0x0000003b6006af64 in qFatal (msg=<optimized out>) at global/qglobal.cpp:2520
#5  0x00007ffff79b55af in operator[] (i=-1, this=0x9165700) at /usr/include/QtCore/qvector.h:347
#6  Jitterometer::RecordEndTime (this=0x91656e0) at jitterometer.cpp:77
#7  0x00007ffff79b5aa6 in Jitterometer::RecordCycleTime (this=0x91656e0) at jitterometer.cpp:61
#8  0x00007ffff78feba9 in MythPlayer::AVSync (this=0x597b530, buffer=<optimized out>, limit_delay=false) at mythplayer.cpp:1899
#9  0x00007ffff78fad4e in MythPlayer::DisplayNormalFrame (this=0x597b530, check_prebuffer=<optimized out>) at mythplayer.cpp:2158

This occurs because when it tries to access the -1 index. This is because count gets set to -1 by this call:

(gdb) bt
#0  Jitterometer::SetNumCycles (this=0x91656e0, cycles=0) at jitterometer.cpp:50
#1  0x00007ffff79011f9 in MythPlayer::VideoStart (this=0x597b530) at mythplayer.cpp:2239
#2  0x00007ffff790703a in MythPlayer::StartPlaying (this=0x597b530) at mythplayer.cpp:2611
#3  0x00007ffff791fb84 in PlayerContext::StartPlaying (this=0x3333370, maxWait=-1) at playercontext.cpp:455
#4  0x00007ffff79202a8 in PlayerContext::CreatePlayer (this=0x3333370, tv=0xac44, widget=0xabd4b0, desiredState=kState_WatchingPreRecorded, embed=false, 
    embedbounds=..., muted=false) at playercontext.cpp:442
#5  0x00007ffff7897c85 in TV::StartPlayer (this=0x17783b0, mctx=0x3333370, ctx=0x3333370, desiredState=kState_WatchingPreRecorded) at tv_play.cp

The attached fix fixes this for me by making sure count is set to 0 for this case instead of -1.

Attachments (1)

mythtv-jitterometer-negative-count.patch (480 bytes) - added by Jon Burgess <jburgess777@…> 8 years ago.
prevent count getting set to -1

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Jon Burgess <jburgess777@…>

prevent count getting set to -1

comment:1 Changed 8 years ago by markk

Milestone: unknown0.25
Status: newaccepted

comment:2 Changed 8 years ago by Github

Resolution: fixed
Status: acceptedclosed

Jitterometer: Fix a segmentation fault.

Slightly different version of patch from Jon Burgess (received with thanks) - just reset the count to ensure we start with fresh data.

Closes #10121

Branch: master Changeset: b8bec26d4d904f0dcbbbde9506bffd17614d8991

Note: See TracTickets for help on using tickets.