Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#12131 closed Patch - Bug Fix (fixed)

Memory leak in LoggingItem::setThreadName()

Reported by: faginbagin <mythtv@…> Owned by: JYA
Priority: minor Milestone: 0.27.2
Component: MythTV - General Version: 0.27-fixes
Severity: medium Keywords:
Cc: Stuart Auchterlonie Ticket locked: no

Description

This inline method is called thousands of times, mostly via MPoolThread::run's calls to loggingRegisterThread, so the old value of m_threadName needs to be freed before a new value is set.

Attachments (1)

logging.patch (776 bytes ) - added by faginbagin <mythtv@…> 11 years ago.

Download all attachments as: .zip

Change History (9)

by faginbagin <mythtv@…>, 11 years ago

Attachment: logging.patch added

comment:1 by Karl Egly, 11 years ago

After a quick look at the patch and file I'm wondering if the various setters that use strdup shouldn't all be doing the same.

comment:2 by faginbagin <mythtv@…>, 11 years ago

This setter is the only one that popped up in the valgrind run that prompted me to test and then offer this patch, but that doesn't mean similar changes shouldn't be made to the other setters. I was also wondering if the project has any rules of thumb regarding the size and frequency of use of inline methods. IOW, should this setter (and maybe others) be moved to logging.cpp?

in reply to:  1 comment:3 by Stuart Auchterlonie, 11 years ago

Cc: Stuart Auchterlonie added

Replying to dekarl:

After a quick look at the patch and file I'm wondering if the various setters that use strdup shouldn't all be doing the same.

Yes i think they should!

comment:4 by JYA, 11 years ago

Owner: set to JYA
Status: newaccepted

comment:5 by Jean-Yves Avenard <jyavenard@…>, 11 years ago

Resolution: fixed
Status: acceptedclosed

In c8b359dfec03574bbfb30e2ea7ed0584d34de94d/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:6 by Jean-Yves Avenard <jyavenard@…>, 11 years ago

In b15009783583edc5c663d09ebb2a7baeeeab2c96/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:7 by Jean-Yves Avenard <jyavenard@…>, 11 years ago

In 881284c2f52f5138f2385a0686f38e8b7b14c0c9/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:8 by paulh, 11 years ago

Milestone: unknown0.27.2
Note: See TracTickets for help on using tickets.