Closed Bug 1622855 Opened 5 years ago Closed 5 years ago

Running xpcshell-tests locally on Mac is broken

Categories

(Core :: Networking, defect, P1)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1621601

People

(Reporter: standard8, Assigned: haik)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [necko-triaged])

Attachments

(2 files)

Attached file xpcshell-fail.txt (deleted) —

When running with an artifact build with the latest mozilla-central, I am unable to run xpcshell-tests.

Attempting to run the test shuts down straight away (see attached log).

If as a workaround I do:

MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1 ./mach xpcshell-test toolkit/components/places/tests/unit/test_annotations.js

then the test runs fine.

Flags: needinfo?(mfroman)

This isn't just artifact builds, I've just managed to do a full build and it is broken there as well.

Summary: Running xpcshell-tests on Mac artifact builds is broken → Running xpcshell-tests locally on Mac is broken

I'm looking into this.

We're crashing in GeckoChildProcessHost::StaticFillMacSandboxInfo() called from SocketProcessHost::StaticFillMacSandboxInfo() due to nsMacUtilsImpl::GetAppPath() failing. GetAppPath() fails because it expects the executable name in argv[0] to have "Contents/MacOS/" in the path but for xpcshell, that is not the case.

In my local tests, argv[0] ends up being ${OBJDIR}/dist/NightlyDebug.app/Contents/Resources/browser/nonexistent-executable which appears to be because CommandLine was not initialized when NS_InitXPCOM() was called.

I think the best thing to do here is a quick fix to allow xpcshell tests to work again by disabling the socket process sandbox for xpcshell tests. We already disable the content sandbox for xpcshell tests so the sandbox setup code has never been used during xpcshell tests.

Once this fix lands, I'll file a follow-up bug to improve the path checking and allow the socket process sandbox to be enabled for these tests.

Assignee: nobody → haftandilian
Status: NEW → ASSIGNED

Sorry, I was on PTO yesterday. Haik, thank you for looking at this in my absense!

Flags: needinfo?(mfroman)
Priority: -- → P1
Whiteboard: [necko-triaged]

I have a similar issue in bug 1621601.
Maybe we should disabling the socket process sandbox for all platforms.

(In reply to Kershaw Chang [:kershaw] from comment #6)

I have a similar issue in bug 1621601.
Maybe we should disabling the socket process sandbox for all platforms.

Thanks. I've r+'d the patch on bug 1621601. Disabling on all platforms is the right choice for now. See also bug 1257098. We can close this bug as a dupe of 1621601 since the fix will address this bug too.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: