Open Bug 1253727 Opened 8 years ago Updated 2 years ago

NS_XPCOM_LIBRARY_FILE might not always reflect reality

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

Tracking Status
firefox47 --- affected

People

(Reporter: bugzilla, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Since bug 671564, it has been based on NS_GRE_DIR. This might not be the case, however, if dependentlibs.list points elsewhere.

Normally this is not an issue, but it is for gtests where this can happen.
Comment on attachment 8728123 [details]
MozReview Request: Bug 1253727: Derive NS_XPCOM_LIBRARY_FILE from the actual location of the loaded library; r?froydnj

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/38805/diff/1-2/
(In reply to Aaron Klotz [:aklotz] (please use needinfo) from comment #0)
> Since bug 671564, it has been based on NS_GRE_DIR. This might not be the
> case, however, if dependentlibs.list points elsewhere.
> 
> Normally this is not an issue, but it is for gtests where this can happen.

Can you elaborate on this?  I am too dense to understand what the problem is, and the blocked bug does not provide any enlightenment.
Flags: needinfo?(aklotz)
(In reply to Nathan Froyd [:froydnj] from comment #4)
> Can you elaborate on this?  I am too dense to understand what the problem
> is, and the blocked bug does not provide any enlightenment.

xul.dll and other dependent libraries are loaded by XPCOM glue here:
https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/standalone/nsXPCOMGlue.cpp#343

We iterate through dependentlibs.list and dynamically load each line.
In the case of gtests, dependentlibs.list points to a different xul.dll (ie, the gtest variant). With the status quo, NS_XPCOM_LIBRARY_FILE doesn't reflect a xul.dll that is in a different location from the default.
Flags: needinfo?(aklotz)
Comment on attachment 8728123 [details]
MozReview Request: Bug 1253727: Derive NS_XPCOM_LIBRARY_FILE from the actual location of the loaded library; r?froydnj

https://reviewboard.mozilla.org/r/38805/#review35895

I think with the change below, you don't need a separate LibPath file; the code is short enough to be inlined directly into XPCOM init.

::: xpcom/build/LibPath.cpp:31
(Diff revision 2)
> +#if defined(XP_WIN)

I think you can avoid all the ifdeffery here by using PR_GetLibraryFilePathname(XUL_DLL, &appropriate_function), similar to FFVPXRuntimeLinker::Init:

http://mxr.mozilla.org/mozilla-central/source/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp#51
Attachment #8728123 - Flags: review?(nfroyd)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: