Skip to content

cargo: Bump rustc to 1.89#36818

Merged
sagudev merged 5 commits intoservo:mainfrom
webbeef:rustc-1.86
Aug 19, 2025
Merged

cargo: Bump rustc to 1.89#36818
sagudev merged 5 commits intoservo:mainfrom
webbeef:rustc-1.86

Conversation

@webbeef
Copy link
Copy Markdown
Contributor

@webbeef webbeef commented May 3, 2025

@webbeef webbeef marked this pull request as draft May 3, 2025 04:00
@webbeef webbeef marked this pull request as ready for review May 3, 2025 04:50
sagudev
sagudev previously approved these changes May 3, 2025
@jdm jdm added this pull request to the merge queue May 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 3, 2025
@sagudev sagudev added this pull request to the merge queue May 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 3, 2025
@sagudev
Copy link
Copy Markdown
Member

sagudev commented May 3, 2025

macos unit test fails:

test fetch::test_fetch_redirect_updates_method has been running for over 60 seconds
  Warning: Attempt 1 failed. Reason: Timeout of 2400000ms hit

but there is no change to fetch(-related) code

@atouchet
Copy link
Copy Markdown
Contributor

atouchet commented May 3, 2025

Should rust-version in Cargo.toml be updated as well?

@webbeef
Copy link
Copy Markdown
Contributor Author

webbeef commented May 3, 2025

Should rust-version in Cargo.toml be updated as well?

Good catch! I changed it in the latest version.

@jdm
Copy link
Copy Markdown
Member

jdm commented May 4, 2025

Huh, I don't reproduce the hang with a debug/release build locally, but I do get this:

failures:

---- hsts::test_preload_hsts_domains_well_formed stdout ----

thread 'hsts::test_preload_hsts_domains_well_formed' panicked at components/net/tests/hsts.rs:395:5:
assertion failed: !hsts_list.entries_map.is_empty()


failures:
    hsts::test_preload_hsts_domains_well_formed

test result: FAILED. 432 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.51s

Filed #36837 since this also reproduces on main.

@sagudev

This comment was marked as resolved.

@jdm

This comment was marked as resolved.

@sagudev

This comment was marked as resolved.

@sagudev
Copy link
Copy Markdown
Member

sagudev commented May 5, 2025

my plan to fix this:

  1. minimize command invocation for repro (fetch, httploader)
  2. bisect rustc

@sagudev
Copy link
Copy Markdown
Member

sagudev commented May 5, 2025

It works normally in my fork: https://github.com/sagudev/servo/actions/runs/14840532532/job/41662172500

I think the problem is in our self hosted runners. @delan we might need CLOBBER

@jdm
Copy link
Copy Markdown
Member

jdm commented May 6, 2025

This PR consistently breaks about:memory for me with:

null pointer dereference occurred (thread Script(2,3), at components/script_bindings/conversions.rs:248)
   0: backtrace::backtrace::libunwind::trace
             at /Users/jdm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.74/src/backtrace/libunwind.rs:116:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/jdm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/backtrace-0.3.74/src/backtrace/mod.rs:66:5
   1: <servoshell::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/jdm/src/servo/ports/servoshell/backtrace.rs:65:13
   2: core::fmt::rt::Argument::fmt
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/fmt/rt.rs:177:76
      core::fmt::write
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/fmt/mod.rs:1449:21
   3: std::io::Write::write_fmt
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/io/mod.rs:1890:15
   4: servoshell::backtrace::print
             at /Users/jdm/src/servo/ports/servoshell/backtrace.rs:18:5
   5: servoshell::panic_hook::panic_hook
             at /Users/jdm/src/servo/ports/servoshell/panic_hook.rs:40:17
   6: core::ops::function::Fn::call
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:79:5
   7: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/alloc/src/boxed.rs:1990:9
      std::panicking::rust_panic_with_hook
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/std/src/panicking.rs:839:13
   8: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/std/src/panicking.rs:697:13
   9: std::sys::backtrace::__rust_end_short_backtrace
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/std/src/sys/backtrace.rs:168:18
  10: rust_begin_unwind
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/std/src/panicking.rs:695:5
  11: core::panicking::panic_nounwind_fmt::runtime
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/panicking.rs:117:22
      core::panicking::panic_nounwind_fmt
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/intrinsics/mod.rs:3886:9
  12: core::panicking::panic_null_pointer_dereference
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/panicking.rs:304:5
  13: script_bindings::conversions::get_dom_class
             at /Users/jdm/src/servo/components/script_bindings/conversions.rs:248:19
  14: script::script_runtime::get_size
             at /Users/jdm/src/servo/components/script/script_runtime.rs:795:11
  15: _ZN15ServoDOMVisitor19sizeOfIncludingThisEP11nsISupports
             at /Users/runner/work/mozjs/mozjs/mozjs-sys/src/jsglue.cpp:472:16
  16: __ZL17StatsCellCallbackIL11Granularity1EEvP9JSRuntimePvN2JS9GCCellPtrEmRKNS4_15AutoRequireNoGCE
  17: __ZL35IterateRealmsArenasCellsUnbarrieredP9JSContextPN2JS4ZoneEPvPFvS0_S4_PNS1_5RealmERKNS1_15AutoRequireNoGCEEPFvP9JSRuntimeS4_PN2js2gc5ArenaENS1_9TraceKindEmS9_EPFvSD_S4_NS1_9GCCellPtrEmS9_ES9_
  18: __ZN2js22IterateHeapUnbarrieredEP9JSContextPvPFvP9JSRuntimeS2_PN2JS4ZoneERKNS5_15AutoRequireNoGCEEPFvS1_S2_PNS5_5RealmESA_EPFvS4_S2_PNS_2gc5ArenaENS5_9TraceKindEmSA_EPFvS4_S2_NS5_9GCCellPtrEmSA_E
  19: __ZL25CollectRuntimeStatsHelperP9JSContextPN2JS12RuntimeStatsEPNS1_20ObjectPrivateVisitorEbPFvP9JSRuntimePvNS1_9GCCellPtrEmRKNS1_15AutoRequireNoGCEE
  20: __ZN2JS14AddServoSizeOfEP9JSContextPFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE
  21: CollectServoSizes
             at /Users/runner/work/mozjs/mozjs/mozjs-sys/src/jsglue.cpp:830:10
  22: <script_bindings::script_runtime::JSContext as script::script_runtime::JSContextHelper>::get_reports
             at /Users/jdm/src/servo/components/script/script_runtime.rs:917:17
  23: script::script_thread::ScriptThread::collect_reports::{{closure}}
             at /Users/jdm/src/servo/components/script/script_thread.rs:2445:28
  24: profile_traits::mem::perform_memory_report
             at /Users/jdm/src/servo/components/shared/profile/mem.rs:289:5
  25: script::script_thread::ScriptThread::collect_reports
             at /Users/jdm/src/servo/components/script/script_thread.rs:2436:9
  26: script::script_thread::ScriptThread::handle_msg_from_script
             at /Users/jdm/src/servo/components/script/script_thread.rs:1974:17
  27: script::script_thread::ScriptThread::handle_msgs::{{closure}}
             at /Users/jdm/src/servo/components/script/script_thread.rs:1502:60
  28: script::script_thread::ScriptThread::profile_event
             at /Users/jdm/src/servo/components/script/script_thread.rs:1714:13
  29: script::script_thread::ScriptThread::handle_msgs
             at /Users/jdm/src/servo/components/script/script_thread.rs:1493:27
  30: script::script_thread::ScriptThread::start
             at /Users/jdm/src/servo/components/script/script_thread.rs:988:15
  31: <script::script_thread::ScriptThread as script_layout_interface::ScriptThreadFactory>::create::{{closure}}::{{closure}}
             at /Users/jdm/src/servo/components/script/script_thread.rs:436:25
  32: profile_traits::mem::ProfilerChan::run_with_memory_reporting
             at /Users/jdm/src/servo/components/shared/profile/mem.rs:131:9
  33: <script::script_thread::ScriptThread as script_layout_interface::ScriptThreadFactory>::create::{{closure}}
             at /Users/jdm/src/servo/components/script/script_thread.rs:434:17
  34: std::sys::backtrace::__rust_begin_short_backtrace
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:152:18
  35: std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:559:17
  36: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9
  37: std::panicking::try::do_call
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:587:40
  38: ___rust_try
  39: std::panicking::try
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:550:19
      std::panic::catch_unwind
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:358:14
      std::thread::Builder::spawn_unchecked_::{{closure}}
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:557:30
  40: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /Users/jdm/.rustup/toolchains/1.86.0-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  41: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/alloc/src/boxed.rs:1976:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/alloc/src/boxed.rs:1976:9
      std::sys::pal::unix::thread::Thread::new::thread_start
             at /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/std/src/sys/pal/unix/thread.rs:106:17
  42: __pthread_deallocate
[2025-05-06T03:31:50Z ERROR servoshell::panic_hook] null pointer dereference occurred
thread caused non-unwinding panic. aborting.
Redirecting call to abort() to mozalloc_abort

Caught signal 11 in thread "Script(2,3)"

@jdm
Copy link
Copy Markdown
Member

jdm commented May 6, 2025

Ah, we're hitting https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/#debug-assertions-that-pointers-are-non-null-when-required-for-soundness rather than a miscompilation. I've opened #36869 that avoids this.

github-merge-queue bot pushed a commit that referenced this pull request May 6, 2025
…ndler custom data (#36869)

While the vast majority of DOM proxy objects created have a non-null
pointer in the handler's extra data field, there is one place we create
a proxy object that has a null pointer:
https://github.com/servo/servo/blob/8b05b7449d3ceaeb6ae834246012ac04a4f048c6/components/script/window_named_properties.rs#L76
. Before #36818, dereferencing this null pointer was undefined behaviour
that was silently being ignored; now that Rust 1.86 adds debug pointer
validity checks, we get a panic when trying to dereference it.

Testing: Tested about:memory with rustc 1.86.

---------

Signed-off-by: Josh Matthews <[email protected]>
Narfinger pushed a commit to Narfinger/servo that referenced this pull request May 6, 2025
…ndler custom data (servo#36869)

While the vast majority of DOM proxy objects created have a non-null
pointer in the handler's extra data field, there is one place we create
a proxy object that has a null pointer:
https://github.com/servo/servo/blob/8b05b7449d3ceaeb6ae834246012ac04a4f048c6/components/script/window_named_properties.rs#L76
. Before servo#36818, dereferencing this null pointer was undefined behaviour
that was silently being ignored; now that Rust 1.86 adds debug pointer
validity checks, we get a panic when trying to dereference it.

Testing: Tested about:memory with rustc 1.86.

---------

Signed-off-by: Josh Matthews <[email protected]>
@webbeef
Copy link
Copy Markdown
Contributor Author

webbeef commented May 16, 2025

And now rustc 1.87 is available :)

mrobinson
mrobinson previously approved these changes May 16, 2025
@mrobinson mrobinson added this pull request to the merge queue May 16, 2025
@github-actions github-actions bot removed the T-macos Do a try run on macOS label Aug 19, 2025
@github-actions
Copy link
Copy Markdown

🔨 Triggering try run (#17066407600) for MacOS

@github-actions
Copy link
Copy Markdown

🔨 Triggering try run (#17066477502) for Linux (Build libservo)

@github-actions
Copy link
Copy Markdown

⚠️ Try run (#17066477502) failed.

Signed-off-by: sagudev <[email protected]>
@github-actions
Copy link
Copy Markdown

🔨 Triggering try run (#17067002229) for Linux (Build libservo)

@github-actions
Copy link
Copy Markdown

✨ Try run (#17067002229) succeeded.

@sagudev sagudev enabled auto-merge August 19, 2025 10:48
@sagudev sagudev added this pull request to the merge queue Aug 19, 2025
Merged via the queue into servo:main with commit 3225d19 Aug 19, 2025
35 checks passed
@jschwe
Copy link
Copy Markdown
Member

jschwe commented Aug 19, 2025

Thanks @webbeef and @sagudev! Great to have this landed :)

github-merge-queue bot pushed a commit that referenced this pull request Aug 19, 2025
…38780)

This is a follow up to
#36818 (comment). Since
openxr is a feature only available on Windows, it was omitted.

Testing: Fixes
```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> components\webxr\openxr\input.rs:366:9
    |
366 |         &self,
    |         ^^^^^ the lifetime is elided here
...
371 |     ) -> Vec<Binding> {
    |              ------- the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
371 |     ) -> Vec<Binding<'_>> {
```

Signed-off-by: Euclid Ye <[email protected]>
PotatoCP pushed a commit to PotatoCP/servo that referenced this pull request Aug 20, 2025
Update Rustc to 1.89.

Reviewable by commit.

Leftover work:
- servo#37330 
- servo#38777

---------

Signed-off-by: sagudev <[email protected]>
Co-authored-by: sagudev <[email protected]>
PotatoCP pushed a commit to PotatoCP/servo that referenced this pull request Aug 20, 2025
…ervo#38780)

This is a follow up to
servo#36818 (comment). Since
openxr is a feature only available on Windows, it was omitted.

Testing: Fixes
```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> components\webxr\openxr\input.rs:366:9
    |
366 |         &self,
    |         ^^^^^ the lifetime is elided here
...
371 |     ) -> Vec<Binding> {
    |              ------- the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
371 |     ) -> Vec<Binding<'_>> {
```

Signed-off-by: Euclid Ye <[email protected]>
PotatoCP pushed a commit to PotatoCP/servo that referenced this pull request Aug 20, 2025
Update Rustc to 1.89.

Reviewable by commit.

Leftover work:
- servo#37330 
- servo#38777

---------

Signed-off-by: sagudev <[email protected]>
Co-authored-by: sagudev <[email protected]>
PotatoCP pushed a commit to PotatoCP/servo that referenced this pull request Aug 20, 2025
…ervo#38780)

This is a follow up to
servo#36818 (comment). Since
openxr is a feature only available on Windows, it was omitted.

Testing: Fixes
```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> components\webxr\openxr\input.rs:366:9
    |
366 |         &self,
    |         ^^^^^ the lifetime is elided here
...
371 |     ) -> Vec<Binding> {
    |              ------- the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
371 |     ) -> Vec<Binding<'_>> {
```

Signed-off-by: Euclid Ye <[email protected]>
PotatoCP pushed a commit to PotatoCP/servo that referenced this pull request Aug 20, 2025
Update Rustc to 1.89.

Reviewable by commit.

Leftover work:
- servo#37330 
- servo#38777

---------

Signed-off-by: sagudev <[email protected]>
Co-authored-by: sagudev <[email protected]>
PotatoCP pushed a commit to PotatoCP/servo that referenced this pull request Aug 20, 2025
…ervo#38780)

This is a follow up to
servo#36818 (comment). Since
openxr is a feature only available on Windows, it was omitted.

Testing: Fixes
```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> components\webxr\openxr\input.rs:366:9
    |
366 |         &self,
    |         ^^^^^ the lifetime is elided here
...
371 |     ) -> Vec<Binding> {
    |              ------- the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
371 |     ) -> Vec<Binding<'_>> {
```

Signed-off-by: Euclid Ye <[email protected]>
@Loirooriol
Copy link
Copy Markdown
Contributor

The mismatched_lifetime_syntaxes lint is complaining a lot when I compile Servo patched with a local Stylo. Was there a way to automatically address the warnings, or does it need to be manual?

@webbeef
Copy link
Copy Markdown
Contributor Author

webbeef commented Sep 5, 2025

The mismatched_lifetime_syntaxes lint is complaining a lot when I compile Servo patched with a local Stylo. Was there a way to automatically address the warnings, or does it need to be manual?

Setting RUSTFLAGS="-A mismatched_lifetime_syntaxes" in your environment should do the trick.

@Loirooriol
Copy link
Copy Markdown
Contributor

@webbeef Yes, that's what I'm doing for now, but would be better to fix the code in Stylo. Doing it manually will be quite tedious, though.

Was fb17b63 done in some automated way?

@sagudev
Copy link
Copy Markdown
Member

sagudev commented Sep 8, 2025

Not really, I did do find and replace on most common types tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants