Opened 9 years ago

Closed 7 years ago

#10825 closed Bug Report - General (Fixed)

thread safety in video metadata load

Reported by: George Nassas <gnassas@…> Owned by: beirdo
Priority: minor Milestone: unknown
Component: MythTV - Video Library Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no


This is terribly obscure but I have been bit regularly and the backend dies without mentioning why so it's quite annoying.

The metadata loaders in libs/libmythmetadata/dbaccess.cpp keep static copies of their various lists for reuse after the first load but when two clients trigger "first" loads at the same time the stl inserts stomp on each other and it go boom.

A suggested patch is attached: I added mutexes to the various load_data methods and my BE is happier.

The patch reviewer can decide if it's worth adding protection to the other modifier methods.

Attachments (1)

0001-protect-metadata-loads-from-multiple-threads.patch (1.3 KB) - added by George Nassas <gnassas@…> 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by George Nassas <gnassas@…>

comment:1 Changed 9 years ago by beirdo

Owner: set to beirdo
Status: newassigned

comment:2 Changed 9 years ago by beirdo

Actually, I think a better plan is to mutex protect the m_entries list on all uses, and possibly likewise for the entry_map if necessary. The unprotected list is just asking for issues.

I'll take a look tonight.

Also, I'm curious why this uses std::list and std::map rather than QList and QMap.

comment:3 Changed 7 years ago by JYA

Resolution: Fixed
Status: assignedclosed

Fixed in: commit cd80b1c740f335e91876c61ce1b7aaa022165d96 Author: George Nassas <george@…> Date: Sun Jun 10 13:36:42 2012 -0400

protect metadata loads from multiple threads

Signed-off-by: Jean-Yves Avenard <jyavenard@…>

Note: See TracTickets for help on using tickets.