Summary: | [Qt] NonSharedCharacterBreakIterator leads to CRASH() in configurations that do not have COMPARE_AND_SWAP enabled | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Cedric Hombourger <chombourger> | ||||
Component: | WebKit Qt | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | allan.jensen, rdieter | ||||
Priority: | P3 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Cedric Hombourger
2012-11-06 05:09:43 PST
Adding compareAndSwapNonSharedCharacterBreakIterator() to Source/WebCore/platform/text/qt/TextBreakIteratorQt.cpp + static inline bool compareAndSwapNonSharedCharacterBreakIterator(TextBreakIterator* expected, TextBreakIterator* newV + { +#if ENABLE(COMPARE_AND_SWAP) + return weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), expected, newValue); +#else + DEFINE_STATIC_LOCAL(QMutex, nonSharedCharacterBreakIteratorMutex, ()); + QMutexLocker locker(&nonSharedCharacterBreakIteratorMutex); + if (nonSharedCharacterBreakIterator != expected) + return false; + nonSharedCharacterBreakIterator = newValue; + return true; +#endif + } and use from: NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length) NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator() Created attachment 205080 [details]
Patch to fix TextBreakIteratorQt.cpp
I've also encountered this problem when building and running QtWebkit 2.3 on MiPS.
Since the TextBreakIteratorICU.cpp already has a similar patch, I think this should also be patched. I've attached the proposed patch based on Cedric's comment.
I think we're seeing this too downstream on fedora20/arm : https://bugzilla.redhat.com/show_bug.cgi?id=1006539 Will test out the proposed patch here, and give feedback. The patch has been applied to qtwebkit-2.3-staging and will be part of 2.3.4 when released. Comment on attachment 205080 [details]
Patch to fix TextBreakIteratorQt.cpp
Qt has been removed, clearing review flags.
|