Closed Bug 1865120 Opened 2 years ago Closed 2 years ago

Quiet coverity false-positive warning about chunk_typeZEROED_CHUNK

Categories

(Core :: Memory Allocator, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: jesup, Assigned: jesup)

Details

Attachments

(1 file)

This is a false-positive from coverity. clean it up and do some minor optimizations

/memory/build/mozjemalloc.cpp: 2260 in chunk_recycle(unsigned long, unsigned long)()


________________________________________________________________________________________________________
*** CID 1550130:  Concurrent data access violations  (ATOMICITY)
/memory/build/mozjemalloc.cpp: 2260 in chunk_recycle(unsigned long, unsigned long)()
2254             return nullptr;
2255           }
2256           chunks_mtx.Lock();
2257         }
2258         node->mAddr = (void*)((uintptr_t)(ret) + aSize);
2259         node->mSize = trailsize;
>>>     CID 1550130:  Concurrent data access violations  (ATOMICITY)
>>>     Using an unreliable value of "chunk_type" inside the second locked section. If the data that "chunk_type" depends on was changed by another thread, this use might be incorrect.
2260         node->mChunkType = chunk_type;
2261         gChunksBySize.Insert(node);
2262         gChunksByAddress.Insert(node);
2263         node = nullptr;
2264       }
Pushed by rjesup@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/57d8c816770a clean up chunk_type use in mozjemalloc to reduce false positives r=pbone
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: