Closed Bug 425055 Opened 17 years ago Closed 4 years ago

If I register a custom nsIDNSService implementation via nsIComponentRegistrar, then jvm crashes when trying to resolve a url.

Categories

(Core Graveyard :: Java to XPCOM Bridge, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: artem.g, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12 Build Identifier: If I register a custom nsIDNSService implementation via nsIComponentRegistrar, then jvm crashes when trying to resolve a url. The crash is caused by NS_ASSERTION in GetJNIEnv() function in nsJavaXPCOMBindingUtils.cpp, since the a thread that is trying to perform dns resolution is not registered with JVM. The fix is to register that thread with JVM: if (rc == JNI_EDETACHED) { rc = gCachedJVM->AttachCurrentThread((void**)&env, nsnull); } Reproducible: Always Steps to Reproduce: 1. Create a DNSServiceImpl class that implements nsIDNSService interface. 2. Create a DNSFactoryImpl class that implements nsIFactory interface and returns DNServiceImpl in createInstance method. 3. Register DSNFactorImpl instance with nsIComponentRegistrar 4. Obtain instance of nsIWebNavigation from webBroser 5. Call nsIWebNavigation.loadURI to load the content.
Summary: Attaching → If I register a custom nsIDNSService implementation via nsIComponentRegistrar, then jvm crashes when trying to resolve a url.
Assignee: jhpedemonte → nobody
Product: Core → Core Graveyard

JavaXPCOM was removed in bug 648593.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.