[gecko] font timestamp cache may be invalid timestamp

UNCONFIRMED
Unassigned

Status

()

Core
Graphics: Text
UNCONFIRMED
4 years ago
3 years ago

People

(Reporter: hiroaki.kawai, Unassigned)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 8483554 [details] [diff] [review]
gfxFT2FontList_FindFontsInOmnijar.patch

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36

Steps to reproduce:

I run B2G (master HEAD) ./run-valgrind.sh with flame attached.

In B2G directory, I have .userconfig as following:
```
export LOCALE_BASEDIR=$PWD/gaia-l10n
export LOCALES_FILE=$PWD/gaia/locales/languages_dev.json
export GAIA_KEYBOARD_LAYOUTS="en,pt-BR,es,de,fr,pl,zh-Hans-Pinyin,en-Dvorak,jp-kanji"
export L10NBASEDIR=$PWD/gecko-l10n
export MOZ_CHROME_MULTILOCALE="ja en"
export B2G_VALGRIND=1
export B2G_DEBUG=1
export DEVICE_DEBUG=1
```



Actual results:

I get valgrind warnings:

```
==1395== Use of uninitialised value of size 4
==1395==w    at 0x6A1F956: MOZ_Z_crc32 (crc32.c:268)
==1395==    by 0x59955C9: nsZipDataStream::ProcessData(nsIRequest*, nsISupports*, char*, unsigned long long, unsigned int) (nsZipDataStream.cpp:139)
==1395==    by 0x5997B4B: nsZipDataStream::ReadStream(nsIInputStream*) (nsZipDataStream.cpp:175)
==1395==    by 0x5997DE1: nsZipWriter::AddEntryStream(nsACString_internal const&, long long, int, nsIInputStream*, bool, unsigned int) (nsZipWriter.cpp:504)
==1395==    by 0x5997E51: nsZipWriter::AddEntryStream(nsACString_internal const&, long long, int, nsIInputStream*, bool) (nsZipWriter.cpp:448)
==1395==    by 0x677DC53: mozilla::scache::CacheCloseHelper(nsACString_internal const&, nsAutoPtr<mozilla::scache::CacheEntry>&, void*) (StartupCache.cpp:426)
==1395==    by 0x677D06B: nsBaseHashtable<nsCStringHashKey, nsAutoPtr<mozilla::scache::CacheEntry>, mozilla::scache::CacheEntry*>::s_EnumStub(PLDHashTable*, PLDHashEntryHdr*, unsigned int, void*) (nsBaseHashtable.h:411)
==1395==    by 0x56480A7: PLDHashTable::Enumerate(PLDHashOperator (*)(PLDHashTable*, PLDHashEntryHdr*, unsigned int, void*), void*) (pldhash.cpp:722)
==1395==    by 0x677EC39: mozilla::scache::StartupCache::WriteToDisk() (nsBaseHashtable.h:208)
==1395==    by 0x677ECE3: mozilla::scache::StartupCache::ThreadedWrite(void*) (StartupCache.cpp:550)
==1395==    by 0x523A81F: ??? (in /data/valgrind-b2g/libnss3.so)
==1395==  Uninitialised value was created by a stack allocation
==1395==    at 0x5B39C88: gfxFT2FontList::FindFontsInOmnijar(FontNameCache*) (gfxFT2FontList.cpp:981)
```


Expected results:

Warnings should not appear. I'll attach a patch.
You need to log in before you can comment on or make changes to this bug.