Closed
Bug 202363
Opened 23 years ago
Closed 23 years ago
Cannot start up Mozilla 1.4a by clicking on a URL in AOL Communicator Mail
Categories
(Core Graveyard :: Embedding: GRE Core, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: wtc, Assigned: dougt)
Details
Attachments
(1 file, 2 obsolete files)
|
1.10 KB,
patch
|
wtc
:
review+
asa
:
approval1.4+
|
Details | Diff | Splinter Review |
To reproduce this bug, make Mozilla 1.4a the default web
browser on your Windows machine.
Make sure Mozilla 1.4a is not running.
Use AOL Communicator Mail to view an email message containing
a URL, for example, a bug mail from Bugzilla.
Click on the URL in the email message. Windows pops up this
error message dialog four times:
The procedure entry point ?Init@nsStaticCaseInsensitiveNameTable@@QAEHQAPBDH@Z
could not be located in the dynamic link library xpcom.dll.
I believe this bug was introduced when Mozilla started to use
the GRE.
| Reporter | ||
Comment 1•23 years ago
|
||
If I view the email message in Outlook Express and
click on the URL, Mozilla 1.4a can be started up
with no problem.
| Assignee | ||
Comment 2•23 years ago
|
||
This resets the current working directory to the application's process
directory after the application is started up. This should fix the problem
that some applications sees if it starts up Mozilla using ShellExecute().
| Assignee | ||
Comment 3•23 years ago
|
||
i tested the above patch and it seams to fix the problem. I was using the
following test program that wtc sent me:
#include <windows.h>
#include <shellapi.h>
#include <stdio.h>
int main()
{
int rv;
rv = (int)ShellExecute(NULL, "open", "http://bugzilla.mozilla.org/", NULL, NULL,
SW_SHOWNORMAL);
printf("ShellExecute returned %d\n", rv);
return 0;
}
Note, i rebuilt mozilla so that the GRE and app directory were disjoint to
simulate the offical release.
| Reporter | ||
Comment 4•23 years ago
|
||
Here is a simpler way to reproduce the bug. It only
requires that you have both Netscape 7 and Mozilla 1.4a
installed.
1. Start up a Command Prompt window.
2. In the Command Prompt window, change to Netscape 7's
installation directory. For example,
C:
cd \Program Files\Netscape\Netscape
3. Invoke Mozilla 1.4a from that directory. For example,
C:\"Program Files"\mozilla.org\Mozilla\mozilla.exe
| Assignee | ||
Updated•23 years ago
|
Attachment #120860 -
Flags: superreview?(darin)
Attachment #120860 -
Flags: review?(chak)
Comment 5•23 years ago
|
||
Comment on attachment 120860 [details] [diff] [review]
patch v.1
r=chak
Attachment #120860 -
Flags: review?(chak) → review+
Comment 6•23 years ago
|
||
Comment on attachment 120860 [details] [diff] [review]
patch v.1
>Index: nsGREDirServiceProvider.cpp
>- if (PR_GetEnv("MOZILLA_FIVE_HOME") == nsnull)
>+ if (getenv("MOZILLA_FIVE_HOME") == nsnull)
ok, why the change to getenv? there's a reason for PR_GetEnv, no?
iirc it has something to do with getenv not necessarily being
thread safe. wtc?
>+char*
>+nsGREDirServiceProvider::GetNSPRPath()
>+{
>+ char* grePath = GetGREDirectoryPath();
>+ if (!grePath) {
>+ char* greEnv = getenv("MOZILLA_FIVE_HOME");
>+ if (!greEnv) {
>+ return nsnull;
>+ }
>+ grePath = strdup(greEnv);
nsCRT::strdup or PL_strdup since strdup is not portable.
>+#define NSPR_DLL "libnspr"MOZ_DLL_SUFFIX
>+
>+ int len = strlen(grePath);
>+ char* nsprPath = (char*) malloc(len + sizeof(NSPR_DLL) + sizeof(XPCOM_FILE_PATH_SEPARATOR) + 1);
>+
>+ sprintf(nsprPath, "%s" XPCOM_FILE_PATH_SEPARATOR NSPR_DLL, grePath);
sizeof("foo") returns 4 not 3, so really:
len + sizeof(...) + sizeof(...) - 1
would be sufficient.
>Index: nsXPCOMGlue.cpp
>+ char* nsprPath = nsGREDirServiceProvider::GetNSPRPath();
>+
>+#if defined(WIN32)
>+ HINSTANCE h = LoadLibrary(nsprPath);
...
>+#elif defined(XP_UNIX)
>+ void * h = dlopen(nsprPath, RTLD_LAZY | RTLD_GLOBAL);
...
>+#endif
>+ if (nsprPath)
>+ free(nsprPath);
hmm.. maybe you should null check |nsprPath| up above where it
is first used. how about a NS_NOTREACHED("not implemented")
for other platforms?
general comment: does GetNSPRPath really need to return a
dynamically allocated string? couldn't it just populate a
global string buffer and then return a const reference to it
each time? that would simplify consumer code a lot don't you
think?
Attachment #120860 -
Flags: superreview?(darin) → superreview-
| Reporter | ||
Comment 7•23 years ago
|
||
Comment on attachment 120860 [details] [diff] [review]
patch v.1
I was wondering why Doug changed PR_GetEnv() to getenv() too.
Is it because we will be running this piece of code before
NSPR is loaded?
>+#define NSPR_DLL "libnspr"MOZ_DLL_SUFFIX
Is this code for Unix only? NSPR DLL doesn't have the "lib"
prefix on Windows.
| Assignee | ||
Comment 8•23 years ago
|
||
Comment on attachment 120860 [details] [diff] [review]
patch v.1
OH my. I am sorry about that. this isn't the patch that I wanted to add here.
:-/
| Assignee | ||
Comment 9•23 years ago
|
||
Attachment #120860 -
Attachment is obsolete: true
| Assignee | ||
Updated•23 years ago
|
Attachment #120964 -
Flags: superreview?(darin)
Attachment #120964 -
Flags: review?(chak)
| Assignee | ||
Comment 10•23 years ago
|
||
sorry about that. the initial patch was from a different tree where I am trying
to remove the nspr dependencies -- clearly that patch isn't ready :-)
Comment 11•23 years ago
|
||
>> sorry about that. the initial patch was from a different tree
And i should've done a better job r='ing :-)
| Reporter | ||
Comment 12•23 years ago
|
||
Comment on attachment 120964 [details] [diff] [review]
patch v.1.1
r=wtc.
Nit: you might want to use the Win32
::SetCurrentDirectory() function instead of the
libc chdir() function, then you don't need to
include <direct.h>.
Updated•23 years ago
|
Attachment #120964 -
Flags: review?(chak) → review+
Comment 13•23 years ago
|
||
Comment on attachment 120964 [details] [diff] [review]
patch v.1.1
>Index: nsGREDirServiceProvider.cpp
>+ // On windows, the current directory is searched before the
>+ // library search environment variable. This is a very bad
do you mean the "PATH" environment variable? if so, then just
say so ;-)
>+ // thing since libraries in the cwd will be picked up before
>+ // any that in either the application or GRE directory.
any that _are_ in either...
i agree with wtc on using SetCurrentDirectory.
sr=darin
Attachment #120964 -
Flags: superreview?(darin) → superreview+
| Reporter | ||
Comment 14•23 years ago
|
||
Build 2003050610 still has this problem. Doug, you
haven't checked in your patch, right?
| Assignee | ||
Comment 15•23 years ago
|
||
no, this patch was not checked in.
asa/seth, this is a very low risk / high gain patch. it should have been
checked days agos.
Assignee: chak → dougt
Flags: blocking1.4b?
| Assignee | ||
Updated•23 years ago
|
Flags: blocking1.4?
Comment 16•23 years ago
|
||
dougt, how about attaching the patch you intend to checkin?
/be
| Assignee | ||
Comment 17•23 years ago
|
||
Attachment #120964 -
Attachment is obsolete: true
| Reporter | ||
Comment 18•23 years ago
|
||
Comment on attachment 122710 [details] [diff] [review]
updated patch
r=wtc.
Attachment #122710 -
Flags: review+
Comment 19•23 years ago
|
||
Comment on attachment 122710 [details] [diff] [review]
updated patch
a=asa (on behalf of drivers) for checkin to 1.4.
Attachment #122710 -
Flags: approval1.4+
Updated•23 years ago
|
Flags: blocking1.4b?
| Assignee | ||
Comment 20•23 years ago
|
||
Checked into the trunk for 1.4 final.
Checking in nsGREDirServiceProvider.cpp;
/cvsroot/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.cpp,v <--
nsGREDirServiceProvider.cpp
new revision: 1.18; previous revision: 1.17
done
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•23 years ago
|
Flags: blocking1.4?
| Reporter | ||
Comment 21•23 years ago
|
||
Verified with nightly build ID 2003050908 on Windows XP.
Status: RESOLVED → VERIFIED
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•