Opened 6 years ago
Closed 6 years ago
Last modified 6 years ago
#13412 closed Patch - Bug Fix (fixed)
Valgrind error in threadedfilewriter
Reported by: | Klaas de Waal | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 31.0 |
Component: | MythTV - General | Version: | Master Head |
Severity: | medium | Keywords: | TFW uninitialized memory |
Cc: | Stuart Auchterlonie, gigem | Ticket locked: | no |
Description
Running mythbackend with valgrind gives the following error message:
==14156== Conditional jump or move depends on uninitialised value(s) ==14156== at 0x72CC8A3: ThreadedFileWriter::DiskLoop() (threadedfilewriter.cpp:455) .... ==14156== Uninitialised value was created by a heap allocation ==14156== at 0x4838E86: operator new(unsigned long) (vg_replace_malloc.c:344) ==14156== by 0x667A50E: FileRingBuffer::FileRingBuffer(QString const&, bool, bool, int) (fileringbuffer.cpp:72)
This is line 455 of threadedfilewriter.cpp:
if (!m_flush && (mwte < 250) && (m_totalBufferUse < kMinWriteSize))
The problem is caused by m_flush; this class member is not initialized when a new instance of ThreadedFileWriter? is created.
The fix is to add initialization of m_flush in threadedfilewriter.h.
Patch is attached.
Attachments (1)
Change History (5)
Changed 6 years ago by
Attachment: | 20190223-threadedfilewriter.patch added |
---|
comment:1 Changed 6 years ago by
According to the github history of threadedfilewriter.cpp, this bug is introduced in commit 28b709d on Feb 15, when the initialization has been moved to the header file.
comment:2 Changed 6 years ago by
Owner: | set to Klaas de Waal <klaas.de.waal@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In efc9123f4/mythtv:
comment:3 Changed 6 years ago by
Milestone: | needs_triage → 31.0 |
---|
Note: See
TracTickets for help on using
tickets.
Initialize m_flush to false in ThreadedFileWriter? instantiation