Closed Bug 874331 Opened 8 years ago Closed 8 years ago

Skia/GL: Canvas 2D tests deadlock in Valgrind with "Syscall param futex(op) contains uninitialised byte(s)"

Categories

(Core :: Canvas: 2D, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 874682

People

(Reporter: bjacob, Unassigned)

References

Details

STR:
 1. using Linux x86-64
 2. enable GL layers and Skia/GL with the latest rebase (bug 848491)
 3. run Canvas 2D tests: http://philip.html5.org/tests/canvas/suite/tests/index.all.html

Result:
Tests run for a while, then stall with these Valgrind errors:

==25332== Conditional jump or move depends on uninitialised value(s)
==25332==    at 0x4A338A2: __lll_lock_wait (lowlevellock.S:136)
==25332==    by 0x4A2F064: _L_lock_858 (pthread_mutex_lock.c:117)
==25332==    by 0x4A2EEB8: pthread_mutex_lock (pthread_mutex_lock.c:61)
==25332==    by 0x858E211: SkGlyphCache::VisitCache(SkTypeface*, SkDescriptor const*, bool (*)(SkGlyphCache const*, void*), void*) (SkGlyphCache.cpp:540)
==25332==    by 0x85A3681: DetachDescProc(SkTypeface*, SkDescriptor const*, void*) (SkPaint.cpp:419)
==25332==    by 0x85A5608: SkPaint::descriptorProc(SkDeviceProperties const*, SkMatrix const*, void (*)(SkTypeface*, SkDescriptor const*, void*), void*, bool) const (SkPaint.
==25332==    by 0x85A5666: SkPaint::detachCache(SkDeviceProperties const*, SkMatrix const*) const (SkPaint.cpp:1884)
==25332==    by 0x85A5783: SkTextToPathIter::SkTextToPathIter(char const*, unsigned long, SkPaint const&, bool) (SkPaint.cpp:2444)
==25332==    by 0x85A5907: SkPaint::getPosTextPath(void const*, unsigned long, SkPoint const*, SkPath*) const (SkPaint.cpp:1411)
==25332==    by 0x85392F6: mozilla::gfx::ScaledFontBase::GetPathForGlyphs(mozilla::gfx::GlyphBuffer const&, mozilla::gfx::DrawTarget const*) (ScaledFontBase.cpp:69)
==25332==    by 0x73BC25D: mozilla::dom::CanvasBidiProcessor::DrawText(int, int) (CanvasRenderingContext2D.cpp:2447)
==25332==    by 0x70BFAB9: nsBidiPresUtils::ProcessText(unsigned short const*, int, nsBidiDirection, nsPresContext*, nsBidiPresUtils::BidiProcessor&, nsBidiPresUtils::Mode, n
==25332==
==25332== Syscall param futex(op) contains uninitialised byte(s)
==25332==    at 0x4A3389C: __lll_lock_wait (lowlevellock.S:132)
==25332==    by 0x4A2F064: _L_lock_858 (pthread_mutex_lock.c:117)
==25332==    by 0x4A2EEB8: pthread_mutex_lock (pthread_mutex_lock.c:61)
==25332==    by 0x858E211: SkGlyphCache::VisitCache(SkTypeface*, SkDescriptor const*, bool (*)(SkGlyphCache const*, void*), void*) (SkGlyphCache.cpp:540)
==25332==    by 0x85A3681: DetachDescProc(SkTypeface*, SkDescriptor const*, void*) (SkPaint.cpp:419)
==25332==    by 0x85A5608: SkPaint::descriptorProc(SkDeviceProperties const*, SkMatrix const*, void (*)(SkTypeface*, SkDescriptor const*, void*), void*, bool) const (SkPaint.
==25332==    by 0x85A5666: SkPaint::detachCache(SkDeviceProperties const*, SkMatrix const*) const (SkPaint.cpp:1884)
==25332==    by 0x85A5783: SkTextToPathIter::SkTextToPathIter(char const*, unsigned long, SkPaint const&, bool) (SkPaint.cpp:2444)
==25332==    by 0x85A5907: SkPaint::getPosTextPath(void const*, unsigned long, SkPoint const*, SkPath*) const (SkPaint.cpp:1411)
==25332==    by 0x85392F6: mozilla::gfx::ScaledFontBase::GetPathForGlyphs(mozilla::gfx::GlyphBuffer const&, mozilla::gfx::DrawTarget const*) (ScaledFontBase.cpp:69)
==25332==    by 0x73BC25D: mozilla::dom::CanvasBidiProcessor::DrawText(int, int) (CanvasRenderingContext2D.cpp:2447)
==25332==    by 0x70BFAB9: nsBidiPresUtils::ProcessText(unsigned short const*, int, nsBidiDirection, nsPresContext*, nsBidiPresUtils::BidiProcessor&, nsBidiPresUtils::Mode, n
==25332==


SkGlyphCache.cpp:540 is:

SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface,
                              const SkDescriptor* desc,
                              bool (*proc)(const SkGlyphCache*, void*),
                              void* context) {
    if (!typeface) {
        typeface = SkTypeface::GetDefaultTypeface();
    }
    SkASSERT(desc);

    SkGlyphCache_Globals& globals = getGlobals();
    SkAutoMutexAcquire    ac(globals.fMutex);       // <--- line 540

getGlobals() is (in the same file):

// Returns the TLS globals (if set), or the shared globals
static SkGlyphCache_Globals& getGlobals() {
    SkGlyphCache_Globals* tls = SkGlyphCache_Globals::FindTLS();
    return tls ? *tls : getSharedGlobals();
}

If the Valgrind error is legit, this must be returning a |tls| object where fMutex is uninitialized.
This is due to SkThread_pthreads not being compiled. It was fixed in the patch that was supposed to land for bug 736276.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 874682
Yup, that patch fixes it for me. Thanks!
You need to log in before you can comment on or make changes to this bug.