Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#11660 closed Patch - Bug Fix (fixed)

Patch to initialize Initialize member variables in MythRenderOpenGL ctor - fixes Coverity 700926 and 700927

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by: Gary Buhrmaster <gary.buhrmaster@…>
Priority: minor Milestone: 0.27
Component: MythTV - User Interface Library Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Static analysis detected that the member variables were not being initialized in the MythRenderOpenGL ctor.

In actuality, after the OpenGL re-factor, the code appears to result in the ResetVars? and ResetProcs? functions being called from the ctors of MythRenderOpenGL[12], but invoke them explicitly in the ctor to keep Coverity happy.

Fixes Coverity 700926 and 700927

github ref: https://github.com/garybuhrmaster/mythtv/commit/99e0e577d7f5aa789fbeabffae8b989a61a72288

github git-am ref: https://github.com/garybuhrmaster/mythtv/commit/99e0e577d7f5aa789fbeabffae8b989a61a72288.patch

Attachments (0)

Change History (6)

comment:1 follow-up: Changed 10 months ago by natanojl

This introduces a small leak of m_lock unless MythRenderOpenGL::ResetVars?() is removed from MythRenderOpenGL[12]::ResetVars?(void).

comment:2 in reply to: ↑ 1 ; follow-up: Changed 10 months ago by Gary Buhrmaster <gary.buhrmaster@…>

Replying to natanojl:

This introduces a small leak of m_lock unless MythRenderOpenGL::ResetVars?() is removed from MythRenderOpenGL[12]::ResetVars?(void).

Good catch. Thanks. I had seen the "new" a month or so ago when I first reviewed a possible fix, and then completely forgot about it (and missed it) in this second pass. I'll try to get a revised patch worked out when I have some time this weekend. In case it takes me some time to get around to it, you should feel free to close this ticket (as "broken"/"wontfix") and I'll submit a new ticket with a new patch.

comment:3 in reply to: ↑ 2 Changed 10 months ago by Gary Buhrmaster <gary.buhrmaster@…>

Replying to Gary Buhrmaster <gary.buhrmaster@…>:

Replying to natanojl:

This introduces a small leak of m_lock unless MythRenderOpenGL::ResetVars?() is removed from MythRenderOpenGL[12]::ResetVars?(void).

Good catch. Thanks. I had seen the "new" a month or so ago when I first reviewed a possible fix, and then completely forgot about it (and missed it) in this second pass. I'll try to get a revised patch worked out when I have some time this weekend. In case it takes me some time to get around to it, you should feel free to close this ticket (as "broken"/"wontfix") and I'll submit a new ticket with a new patch.

Here is an additional patch (apply at the same time, or it can be applied first) that is a "minimal" fix that eliminates the use of the pointer and uses the initialization list (I can find no reason that was not done originally; I may have simply missed the history). A quick look suggests that most of the member variables should move to the initialization list (and would be a better long term fix). But that is a much bigger change, and then there is the longer term re-factor for all this code that would make it all moot anyway.

github ref: https://github.com/garybuhrmaster/mythtv/commit/ff042bddaf85a25f0faa019d081f1dd8921ed68d
github git-am ref: https://github.com/garybuhrmaster/mythtv/commit/ff042bddaf85a25f0faa019d081f1dd8921ed68d.patch

comment:4 Changed 10 months ago by Gary Buhrmaster <gary.buhrmaster@…>

  • Owner set to Gary Buhrmaster <gary.buhrmaster@…>
  • Resolution set to fixed
  • Status changed from new to closed

In 07c54f07872c764f5f355775b27d9ee6f93daf0c/mythtv:

Initialize member variables in MythRenderOpenGL ctor

The refactor of the OpenGL code appears to result
in the ResetVars? and ResetProcs? functions being
called from the ctors of MythRenderOpenGL[12], but
invoke them explicitly to keep Coverity happy.

Fixes Coverity 700926 and 700927

Fixes #11660.

Signed-off-by: Paul Harrison <pharrison@…>

comment:5 Changed 10 months ago by Gary Buhrmaster <gary.buhrmaster@…>

In cd314dc6cab8b212221d6318876b2c3f46503a3e/mythtv:

Eliminate memory leak in MythRenderOpenGL

In commit 07c54f07872c764f5f355775b27d9ee6f93daf0c
a memory leak was introduced. This patch eliminates
the use of the pointer where the lock member object
is lost and replaces it by appropriate creation in
the initializer. This is a "minimal" fix to the issue.

Refs #11660

Signed-off-by: Paul Harrison <pharrison@…>

comment:6 Changed 10 months ago by paulh

  • Milestone changed from unknown to 0.27

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.