Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not trace Rust values when thread is shutting down. #18952

Merged
merged 1 commit into from Oct 21, 2017

Conversation

@jdm
Copy link
Member

jdm commented Oct 19, 2017

This addresses a paint point when using debug-mozjs builds. jonco says that it is considered a leak when objects stored in side tables in a SpiderMonkey embedding are traced right before shutting down. This PR adds a per-thread flag that controls whether to run the Rust-side trace hooks, which is automatically toggled before the final GC occurs when destroying a JS runtime.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #18948 and fix #18947.
  • These changes do not require tests because we don't use debug-mozjs on CI

This change is Reviewable

@highfive
Copy link

highfive commented Oct 19, 2017

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/bindings/refcounted.rs, components/script/dom/workerglobalscope.rs, components/script/dom/dedicatedworkerglobalscope.rs, components/script/dom/worklet.rs, components/script/script_thread.rs and 3 more
  • @KiChjang: components/script/dom/bindings/refcounted.rs, components/script/dom/workerglobalscope.rs, components/script/dom/dedicatedworkerglobalscope.rs, components/script/dom/worklet.rs, components/script/script_thread.rs and 3 more
@highfive
Copy link

highfive commented Oct 19, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!
@jdm
Copy link
Member Author

jdm commented Oct 19, 2017

I am optimistic that these changes fix a bunch of other crashes that have been reported by nightly users.

@jdm jdm force-pushed the jdm:no-leak-on-shutdown branch from 221acba to b0f3a97 Oct 19, 2017
@jdm
Copy link
Member Author

jdm commented Oct 19, 2017

r? @nox

@highfive highfive assigned nox and unassigned wafflespeanut Oct 19, 2017
@jdm
Copy link
Member Author

jdm commented Oct 19, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Oct 19, 2017

Trying commit b0f3a97 with merge 58b7391...

bors-servo added a commit that referenced this pull request Oct 19, 2017
Do not trace Rust values when thread is shutting down.

This addresses a paint point when using debug-mozjs builds. jonco says that it is considered a leak when objects stored in side tables in a SpiderMonkey embedding are traced right before shutting down. This PR adds a per-thread flag that controls whether to run the Rust-side trace hooks, which is automatically toggled before the final GC occurs when destroying a JS runtime.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18948 and fix #18947.
- [x] These changes do not require tests because we don't use debug-mozjs on CI

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18952)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 19, 2017

The latest upstream changes (presumably #18944) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

bors-servo commented Oct 19, 2017

@jdm jdm force-pushed the jdm:no-leak-on-shutdown branch from b0f3a97 to 6f66b0c Oct 19, 2017
@jdm jdm removed the S-needs-rebase label Oct 19, 2017
@nox
Copy link
Member

nox commented Oct 20, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

📌 Commit 6f66b0c has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

Testing commit 6f66b0c with merge 7bef051...

bors-servo added a commit that referenced this pull request Oct 20, 2017
Do not trace Rust values when thread is shutting down.

This addresses a paint point when using debug-mozjs builds. jonco says that it is considered a leak when objects stored in side tables in a SpiderMonkey embedding are traced right before shutting down. This PR adds a per-thread flag that controls whether to run the Rust-side trace hooks, which is automatically toggled before the final GC occurs when destroying a JS runtime.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18948 and fix #18947.
- [x] These changes do not require tests because we don't use debug-mozjs on CI

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18952)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

💔 Test failed - linux-rel-css

@jdm jdm force-pushed the jdm:no-leak-on-shutdown branch from 6f66b0c to c075372 Oct 20, 2017
@jdm
Copy link
Member Author

jdm commented Oct 20, 2017

@bors-servo: r=nox

@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

📌 Commit c075372 has been approved by nox

@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

Testing commit c075372 with merge 1d61cb6...

bors-servo added a commit that referenced this pull request Oct 20, 2017
Do not trace Rust values when thread is shutting down.

This addresses a paint point when using debug-mozjs builds. jonco says that it is considered a leak when objects stored in side tables in a SpiderMonkey embedding are traced right before shutting down. This PR adds a per-thread flag that controls whether to run the Rust-side trace hooks, which is automatically toggled before the final GC occurs when destroying a JS runtime.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18948 and fix #18947.
- [x] These changes do not require tests because we don't use debug-mozjs on CI

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18952)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

The build was interrupted to prioritize another pull request.

@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

Testing commit c075372 with merge e542e69...

bors-servo added a commit that referenced this pull request Oct 20, 2017
Do not trace Rust values when thread is shutting down.

This addresses a paint point when using debug-mozjs builds. jonco says that it is considered a leak when objects stored in side tables in a SpiderMonkey embedding are traced right before shutting down. This PR adds a per-thread flag that controls whether to run the Rust-side trace hooks, which is automatically toggled before the final GC occurs when destroying a JS runtime.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18948 and fix #18947.
- [x] These changes do not require tests because we don't use debug-mozjs on CI

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18952)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member Author

jdm commented Oct 20, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Oct 21, 2017

Testing commit c075372 with merge a71470a...

bors-servo added a commit that referenced this pull request Oct 21, 2017
Do not trace Rust values when thread is shutting down.

This addresses a paint point when using debug-mozjs builds. jonco says that it is considered a leak when objects stored in side tables in a SpiderMonkey embedding are traced right before shutting down. This PR adds a per-thread flag that controls whether to run the Rust-side trace hooks, which is automatically toggled before the final GC occurs when destroying a JS runtime.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18948 and fix #18947.
- [x] These changes do not require tests because we don't use debug-mozjs on CI

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18952)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 21, 2017

@bors-servo bors-servo merged commit c075372 into servo:master Oct 21, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.