Opened 9 years ago

Closed 9 years ago

#8640 closed defect (fixed)

Locking problems in remotefile.cpp

Reported by: chr Owned by: cpinkham
Priority: minor Milestone: 0.24
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Hi!

Running mythtv0.23-fixes on a ppc-osx box I got this random crash:

    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
    [Switching to process 16413 thread 0xd0e3]
    0x0054b93c in RemoteFile::Read (this=0x8ee8700, data=0x15f19001, size=32768) at remotefile.cpp:528
    528         if (sock->bytesAvailable() > 0)

    (gdb) p sock
    $1 = (class MythSocket *) 0x0

DOH!

The locking is broken in the whole Class. I commented out *getSocket(void) because you are playing with fire and that function isn't used.

While lurking through the code, I found another possible bug in Ringbuffer.cpp, see patch

Also looks like that actual trunk needs these patches, too.

Attachments (2)

0006-Reworked-locking-of-RemoteFile-Class.patch (6.0 KB) - added by chr 9 years ago.
0007-fix-pauseWaitMutex-in-RingBuffer.patch (1.8 KB) - added by chr 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by chr

Changed 9 years ago by chr

comment:1 Changed 9 years ago by robertm

Owner: changed from Isaac Richards to cpinkham
Status: newassigned

comment:2 Changed 9 years ago by cpinkham

Milestone: unknown0.24
Summary: crash locking problems in RingBuffer.cpp and remotefile.cppLocking problems in remotefile.cpp
Version: 0.23-fixesTrunk Head

Changing description as the RingBuffer?.cpp issues have been fixed in a separate ticket by Daniel.

comment:3 Changed 9 years ago by cpinkham

Resolution: fixed
Status: assignedclosed

(In [26285]) Add in some locking and a validity check to fix potential race conditions in RemoteFile?.

Closes #8640 using patch by 'chr'.

Note: See TracTickets for help on using tickets.