arena_t::mId is uninitialised in the constructor
Categories
(Core :: Memory Allocator, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: pbone, Assigned: pbone)
Details
Attachments
(1 file)
This is benign because mId is filled in during CreateArena after the constructor is called. But we can patch it to make Covertly happy anyway.
New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)
** CID 1470619: Uninitialized members (UNINIT_CTOR)
/memory/build/mozjemalloc.cpp: 3565 in arena_t::arena_t(arena_params_s *,
bool)()
+________________________
*** CID 1470619: Uninitialized members (UNINIT_CTOR)
/memory/build/mozjemalloc.cpp: 3565 in arena_t::arena_t(arena_params_s *,
bool)()
3559 }
3560 MOZ_ASSERT(i == NUM_SMALL_CLASSES - 1);
3561 3562 #if defined(MOZ_DIAGNOSTIC_ASSERT_ENABLED)
3563 mMagic = ARENA_MAGIC;
3564 #endif
CID 1470619: Uninitialized members (UNINIT_CTOR)
Non-static class member "mId" is not initialized in this
constructor nor in any functions that it calls.
3565 }
3566 3567 arena_t::~arena_t() {
3568 size_t i;
3569 MutexAutoLock lock(mLock);
3570 MOZ_RELEASE_ASSERT(!mLink.Left() && !mLink.Right(),
Assignee | ||
Comment 1•5 years ago
|
||
Hi Glandium.
I see this comment here:
https://searchfox.org/mozilla-central/source/memory/build/mozjemalloc.cpp#890
But I'm not sure what it means when we clear mId in the destructor:
https://searchfox.org/mozilla-central/source/memory/build/mozjemalloc.cpp#3589
Maybe it's referring to TypedBaseAlloc<arena_t>
's destructor, but that makes less sense. Should I delete this line of this comment as it seems to not match the code?
Assignee | ||
Comment 2•5 years ago
|
||
Comment 4•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•