Bug 1620118 added a new field `isDependent` in the third-party-module ping
which is calculated in `UntrustedModulesProcessor`. However, bug 1684532
revealed it was not accurate because some third-party applications revert
the import table to the original state immediately after their module was
loaded.
Now that we have a logic to determine `isDependent` in `NtMapViewOfSection`
to automatically block a module injected through the import table, we can
pass that value to the ping and remove the original logic in `UntrustedModulesProcessor`.
Differential Revision: https://phabricator.services.mozilla.com/D112227
This is a little more than we need to disable it, but I figure we'll want to
support different UI densities in the skeleton UI long term.
Differential Revision: https://phabricator.services.mozilla.com/D111906
This is a little more than we need to disable it, but I figure we'll want to
support different UI densities in the skeleton UI long term.
Differential Revision: https://phabricator.services.mozilla.com/D111906
When restarting, we set the XRE_PROFILE_PATH env var. This normally would
prevent us from showing the skeleton UI. This patch just adds another env
var to indicate that we are restarting so the skeleton UI can know it's
safe to display.
Differential Revision: https://phabricator.services.mozilla.com/D111884
We specify our colors like 0xrrggbb, but CreateSolidBrush expects a
color created with the RGB macro, which actually arranges it as
0xbbggrr. This change has us use the RGB macro to give a color when
creating the brush.
Differential Revision: https://phabricator.services.mozilla.com/D107945
WASI lacks of support many memory stuff like mmap, memory protections and etc, but
it has malloc so we can use it instead. Also, here we are stubbing out all
uses of the missing WASI memory functionality.
Differential Revision: https://phabricator.services.mozilla.com/D110075
WASI lacks of support many memory stuff like mmap, memory protections and etc, but
it has malloc so we can use it instead. Also, here we are stubbing out all
uses of the missing WASI memory functionality.
Differential Revision: https://phabricator.services.mozilla.com/D110075
Before `SharedLibraryInfo::GetInfoForSelf` calls `GetPdbInfo` to parse a module's
PE header, it calls `LoadLibraryEx` to prevent the module from being unloaded
during `GetPdbInfo`. If the module was already unloaded before `LoadLibraryEx`,
however, `LoadLibraryEx` maps the module onto an address different from the original
mapped address, so that `module.lpBaseOfDll` becomes invalid.
This patch is to call `LoadLibraryEx` before `GetModuleInformation` to make sure
`LoadLibraryEx` increments the module's refcount and does not map the module onto
a new address. With this, `module.lpBaseOfDll` is always valid, thus we don't have
to call `VirtualQuery`.
Differential Revision: https://phabricator.services.mozilla.com/D110421
WalkTheStack* is the function that is being called to print stacks to
the user on e.g. MOZ_CRASH on debug builds. Until bug 1699375, some
cases weren't covered, which now cause unwanted side-effects with e.g.
fuzzing. At least as a stop-gap, allow to runtime-disable the behavior
via an environment variable.
Other uses of the stack-walker, like the profiler's, are not affected
when setting the environment variable.
Differential Revision: https://phabricator.services.mozilla.com/D110199
Lastly, we are changing the parts that requires a version bump and bumping the
profiler version in the end. This will require a PR in the front-end for a
version upgrader and changes related to the renaming.
Differential Revision: https://phabricator.services.mozilla.com/D109282
This patch is only about renaming the internals of the profiler codebase and
it doesn't touch any parts that requires a backwards compatibility or version
bump.
Differential Revision: https://phabricator.services.mozilla.com/D109280
- Add missing include directives and forward declarations.
- Remove some extra include directives.
- Add missing namespace qualifications.
- Move include directives out of namespace in toolkit/xre/GlobalSemaphore.h
Differential Revision: https://phabricator.services.mozilla.com/D98894
This commit adds a new command line option |-xpcshell| that, when passed, will
run an xpcshell instead of launching a full Gecko instance.
This command line option is restricted to org.mozilla.geckoview.test for now,
as it's really hard to use and not really a usecase outside mozilla. We can
revisit this if there's interest.
Differential Revision: https://phabricator.services.mozilla.com/D106211
This commit adds a new command line option |-xpcshell| that, when passed, will
run an xpcshell instead of launching a full Gecko instance.
This command line option is restricted to org.mozilla.geckoview.test for now,
as it's really hard to use and not really a usecase outside mozilla. We can
revisit this if there's interest.
Differential Revision: https://phabricator.services.mozilla.com/D106211
A long standing issue is that MOZ_ASSERT and related don't print stack
traces in debug builds when they're directly or indirectly emitted from
non-libxul code. Moving WalkTheStack to mozglue alleviates the problem.
It's also not printing stack traces when emitted from C code (and for
some C third party libraries, we do redirect assert to MOZ_ASSERT),
which we solve by making the corresponding API available without C++
(which WalkTheStack being a static method of the nsTraceRefCnt class
didn't allow, or the use of a closure on Android).
This requires some adjustements to headers that indirectly assume that
Assertions.h includes ErrorList.h through nsError.h through nscore.h
through nsTraceRefcnt.h.
We also remove TestStackCrawl.cpp because it hasn't been built since
bug 158528, 19 years ago.
Differential Revision: https://phabricator.services.mozilla.com/D108913
It requires including <windows.h>, preventing the inclusion of StackWalk.h
from some places (and upcoming changes will make StackWalk.h included in
more places).
Differential Revision: https://phabricator.services.mozilla.com/D108910
In the case of FramePointerStackwalk, the caller gives a pointer to the
top-most frame to walk from. There isn't really a reason to give a
number of frames to skip, as the right frame pointer could be given in
the first place if that was really necessary. And in practice, it's
hasn't been used so far.
In the case of MozStackWalkThread, the caller presumably doesn't know
what the thread the stack is being walked for is doing, and it would be
a guesswork to pass a valid number of frames to skip. In practice, it's
also not used.
The aSkipFrames is already a footgun on MozStackWalk (and we're going to
change that in bug 1515229), we don't need to keep a footgun on these
other stack walking methods.
Differential Revision: https://phabricator.services.mozilla.com/D108563
Currently, printf_stderr doesn't show up when running with ./mach run.
This is because we run with -attach-console and that redirects stderr
to a different file descriptor using freopen in UseParentConsole.
The change from just using stderr directly happened in bug 340443 and was done
to avoid some linking issues. That problem doesn't seem to apply anymore so you'd
expect we'd be able to go back to the straightforward implemention that works even
if stderr has been redirected. Unfortunately, Windows takes not buffering
stderr very seriously and fprintf will write out the results character
by character. This can cause log output lines to be intermixed which
breaks log parsing in CI. We keep using fdopen to create a new FILE*
that's buffered but instead of hard coding fd 2, we get the actual fd
that corresponds to stderr using fileno.
The mozglue implementation was cargo culted from xpcom, so we update it
as well.
Differential Revision: https://phabricator.services.mozilla.com/D98550
This patch makes sure the repo can be built without `MOZ_LAUNCHER_PROCESS`.
- Compile WinTokenUtils.cpp under winlaucher regardless of `MOZ_LAUNCHER_PROCESS`
because we still need `IsAdminWithoutUac`.
- Skip TestDllBlocklist.NoOpEntryPoint GTest because the `RedirectToNoOpEntryPoint`
feature is only available with the new blocklist with the launcher process.
Differential Revision: https://phabricator.services.mozilla.com/D108142
Instead of snprintf.
Because some standalone code uses those functions directly or indirectly,
and PrintfTarget lives in mozglue, they now need to depend on mozglue
instead of mfbt. Except logalloc/replay, which cherry-picks what it
uses, and the updater, for which we keep using vsnprintf.
Differential Revision: https://phabricator.services.mozilla.com/D103730
This code is important for transitioning between the skeleton UI code and the
full-featured browser window code. Additionally, the original logic of disabling
when not on the default theme no longer applies, because it was intended to
eliminate white flashes in dark mode. However, with the skeleton UI, those
white flashes no longer occur.
Differential Revision: https://phabricator.services.mozilla.com/D107293