Closed Bug 645531 Opened 13 years ago Closed 11 years ago

Content process xpcshell dies if a JS error occurs

Categories

(Core :: IPC, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jdm, Unassigned)

References

()

Details

Attachments

(1 file, 1 obsolete file)

From XPCShellEnvironment::EvaluateString:

>  JSScript* script =
>      JS_CompileUCScriptForPrincipals(mCx, global, GetPrincipal(),
>                                      aString.get(), aString.Length(),
>                                      "typein", 0);
>  if (!script) {
>     return false;
>  }

This is probably not ideal.
I think all this needs is a change from |return false| to |return true|, but it's worth testing to see what the output looks like when this fails.  I'm willing to explain how to do that for anyone who picks this up.
Whiteboard: [good first bug]
The way to test this is to take any xpcshell test that runs in the content process (such as anything wrapped by a test in netwerk/test/unit_ipc/ (see netwerk/test/unit/ for the originals)) and introduce a syntax error. If you run the test |SOLO_FILE=test_foo_wrap.js make -C objdir/netwerk/test/ check-one|, you should see a crash right now. Changing the line in linked in the URL field should make this crash go away.
Whiteboard: [good first bug] → [good first bug] [mentor=jdm]
Whiteboard: [good first bug] [mentor=jdm] → [good first bug] [mentor=jdm] [lang=c++]
I would like to work on this bug....
Attached patch patch_1 (obsolete) — Splinter Review
Attachment #582565 - Flags: review?(bent.mozilla)
Attached patch patch_2Splinter Review
reverted back the change in test_httpcancel_wrap.js
Attachment #582565 - Attachment is obsolete: true
Attachment #582565 - Flags: review?(bent.mozilla)
Attachment #582574 - Flags: review?(bent.mozilla)
Comment on attachment 582574 [details] [diff] [review]
patch_2

Review of attachment 582574 [details] [diff] [review]:
-----------------------------------------------------------------

I think what you really want to do is change TestShellChild::RecvExecuteCommand and TestShellChild::RecvPTestShellCommandConstructor to not return false if EvaluateString returns false. XPCShellEnvironment should just do its job and report whether the command succeeded or not.
Attachment #582574 - Flags: review?(bent.mozilla) → review-
I like to work on this one.
Actually, this code is being removed very soon, so it's not worth the effort to fix this any longer. Sorry.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Whiteboard: [good first bug] [mentor=jdm] [lang=c++]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: