Closed Bug 7308 Opened 25 years ago Closed 25 years ago

THREADING: xpcom FindFactory() randomly fails.

Categories

(Core :: XPCOM, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: dp, Assigned: dp)

References

Details

Intl guys have code that proves that FindFactory() randomly fails. Here is a patch that lets you put a breakpoint and see it happen. Index: nsCharsetConverterManager.cpp =================================================================== RCS file: /cvsroot/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp,v retrieving revision 1.16 diff -r1.16 nsCharsetConverterManager.cpp 185a186 > CreateMapping(); 269c270,275 < if (NS_FAILED(res)) goto reduceArray; --- > if (NS_FAILED(res)) { > #if 1 > printf(" get charest info FindFactory failed %d %x", aIndex, res); > #endif > goto reduceArray; > } 273c279,284 < if (NS_FAILED(res)) goto reduceArray; --- > if (NS_FAILED(res)) { > #if 1 > printf(" get charest info QI failed %d %x", aIndex, res); > #endif > goto reduceArray; > } 282c293 < for (i=aIndex; i<*aSize;) aArray[i] = aArray[i++]; --- > for (i=aIndex; i<*aSize;) aArray[i] = aArray[++i]; I analyzed the xpcom log file and here is what I see: FindFactory({379c2771-ec77-11d2-8aac-00600811a836}) not found in factory cache. Looking in registry -->another thread-->ProgIDToCLSID(application/x-unknown-content-type)->[FAILED] FindFactory() FAILED FindFactory({379c2771-ec77-11d2-8aac-00600811a836}) not found in factory cache. Looking in registry nsComponentManager: Found in mDllStore "D:/seamonkey/mozilla/dist/WIN32_D.OBJ/bin/components/ucvcn.dll". found in registry. FindFactory() succeeded So the same call to FindFactory() fails at one point and passes at another. The only difference is the ProgIDToCLSID() calls from another thread. Need to investigate if this is xpcom or registry.
Blocks: 6890
Status: NEW → ASSIGNED
Target Milestone: M7
Blocks: 4270
Target Milestone: M7 → M8
Non one is hitting this yet. The code that hits it has changed. So fixing this along with other threading bugs in M8.
Blocks: 8150
Target Milestone: M8 → M7
Checked in a course level fix. Keeping it open to checkin the real full fix. The problem is a member mErr of nsRegistry. When multiple threads access nsRegistry, mErr is getting overwritten causing some of the functions to return error even when they really passed.
Target Milestone: M7 → M8
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fix checked in morning of 6/22 Cathleen wang and Peterl was seeing these crashes. Could you guys try out the latest builds.
Status: RESOLVED → VERIFIED
marking as verified
You need to log in before you can comment on or make changes to this bug.