NEW227019
PNGImageDecoder needs clang Thread Safety annotations
https://bugs.webkit.org/show_bug.cgi?id=227019
Summary PNGImageDecoder needs clang Thread Safety annotations
Alicia Boya García
Reported 2021-06-15 02:41:55 PDT
+ cmake --build /app/webkit/WebKitBuild/Release --config Release -- [5/87] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/platform/image-decoders/ScalableImageDecoder.cpp.o In file included from ../../Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp:31: ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:78:17: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:81:35: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] for (auto& imageFrame : m_frameBufferCache) { ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:81:35: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:91:29: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] return (index < m_frameBufferCache.size() && m_frameBufferCache[index].isComplete()); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:91:58: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] return (index < m_frameBufferCache.size() && m_frameBufferCache[index].isComplete()); ^ 5 warnings generated. [6/87] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/platform/image-decoders/ico/ICOImageDecoder.cpp.o In file included from ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:37: ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:78:17: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:81:35: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] for (auto& imageFrame : m_frameBufferCache) { ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:81:35: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:91:29: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] return (index < m_frameBufferCache.size() && m_frameBufferCache[index].isComplete()); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:91:58: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] return (index < m_frameBufferCache.size() && m_frameBufferCache[index].isComplete()); ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:90:12: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] return m_frameBufferCache.size(); ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:99:21: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] auto* buffer = &m_frameBufferCache[index]; ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:163:15: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] else if ((m_frameBufferCache.size() > index) && m_frameBufferCache[index].isComplete()) { ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:163:53: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] else if ((m_frameBufferCache.size() > index) && m_frameBufferCache[index].isComplete()) { ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:168:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:169:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] m_frameBufferCache.grow(m_dirEntries.size()); ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:200:45: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] m_bmpReaders[index]->setBuffer(&m_frameBufferCache[index]); ^ ../../Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp:216:5: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] m_frameBufferCache[index] = *m_pngDecoders[index]->frameBufferAtIndex(0); ^ 13 warnings generated. [7/87] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/platform/image-decoders/png/PNGImageDecoder.cpp.o In file included from ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:42: ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:78:17: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:81:35: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] for (auto& imageFrame : m_frameBufferCache) { ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:81:35: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:91:29: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] return (index < m_frameBufferCache.size() && m_frameBufferCache[index].isComplete()); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h:91:58: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] return (index < m_frameBufferCache.size() && m_frameBufferCache[index].isComplete()); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:264:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:265:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] m_frameBufferCache.grow(1); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:267:19: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] auto& frame = m_frameBufferCache[index]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:450:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:458:20: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] auto& buffer = m_frameBufferCache[m_currentFrame]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:577:10: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (!m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:578:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] m_frameBufferCache.first().setDecodingStatus(DecodingStatus::Complete); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:620:13: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.size() == m_frameCount) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:623:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] m_frameBufferCache.resize(m_frameCount); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:665:13: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:666:13: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] m_frameBufferCache.grow(1); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:668:30: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_currentFrame < m_frameBufferCache.size()) { ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:669:28: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] auto& buffer = m_frameBufferCache[m_currentFrame]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:756:9: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] if (m_frameBufferCache.isEmpty()) ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:760:51: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] clearBeforeFrame = std::min(clearBeforeFrame, m_frameBufferCache.size() - 1); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:761:59: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] const Vector<ScalableImageDecoderFrame>::iterator end(m_frameBufferCache.begin() + clearBeforeFrame); ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:764:18: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] for (; (i != m_frameBufferCache.begin()) && (i->isInvalid() || (i->disposalMethod() == ScalableImageDecoderFrame::DisposalMethod::RestoreToPrevious)); --i) { ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:770:56: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] for (Vector<ScalableImageDecoderFrame>::iterator j(m_frameBufferCache.begin()); j != i; ++j) { ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:782:20: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] auto& buffer = m_frameBufferCache[frameIndex]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:792:31: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] const auto* prevBuffer = &m_frameBufferCache[--frameIndex]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:795:23: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] prevBuffer = &m_frameBufferCache[--frameIndex]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:842:20: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] auto& buffer = m_frameBufferCache[m_currentFrame]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:880:43: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] const auto* prevBuffer = &m_frameBufferCache[--frameIndex]; ^ ../../Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp:882:35: warning: reading variable 'm_frameBufferCache' requires holding mutex 'm_lock' [-Wthread-safety-analysis] prevBuffer = &m_frameBufferCache[--frameIndex]; ^ 29 warnings generated.
Attachments
Radar WebKit Bug Importer
Comment 1 2021-06-22 02:42:18 PDT
Note You need to log in before you can comment on or make changes to this bug.