public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* Re: REGRESSION: armv7 build mismatched types
       [not found] <700ebe13-c2d3-48e3-800f-8dc327efb6fc@gmail.com>
@ 2025-05-30  7:46 ` Thorsten Leemhuis
       [not found] ` <CANiq72mFL4dn+0JppLLfxyKnM+xYwKeduFw2j07hUfxWVVHdUw@mail.gmail.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Thorsten Leemhuis @ 2025-05-30  7:46 UTC (permalink / raw)
  To: Rudraksha Gupta, linux-kernel, Linux regressions mailing list,
	rust-for-linux, Miguel Ojeda, Linux Next Mailing List,
	Tamir Duberstein

CCing linux-next and Tamir Duberstein, who authored the culprit.

On 30.05.25 08:23, Rudraksha Gupta wrote:
> Logs: https://gitlab.postmarketos.org/LogicalErzor/pmaports/-/jobs/1368490
> 
> Archive: https://web.archive.org/web/20250530060232/https://
> gitlab.postmarketos.org/LogicalErzor/pmaports/-/jobs/1368490/raw

I ran into the same error on aarch64 and x86_64 when building -next for
Fedora today using the rawhide config:

https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-x86_64/09103515-next-next-all/builder-live.log.gz
https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-aarch64/09103515-next-next-all/builder-live.log.gz

Reverting b20fbbc08a363f ("rust: check type of `$ptr` in
`container_of!`") fixed things. That's the patch Rudraksha suspected to
be the root of the problem (see the quote below).

Ciao, Thorsten

> Snip:
> 
> ||
> 
> |EXPORTS rust/exports_core_generated.h|
> |
> ||
> RUSTC L rust/compiler_builtins.o
> ||
> RUSTC L rust/ffi.o
> ||
> RUSTC L rust/build_error.o
> ||
> RUSTC L rust/pin_init.o
> ||
> RUSTC L rust/bindings.o
> ||
> RUSTC L rust/uapi.o
> ||
> EXPORTS rust/exports_bindings_generated.h
> ||
> RUSTC L rust/kernel.o
> ||
> error[E0308]: mismatched types
> ||
> --> rust/kernel/lib.rs:234:45
> ||
> |
> ||
> 234 | $crate::assert_same_type(field_ptr, (&raw const (*container_ptr).
> $($fields)*).cast_mut());
> ||
> | ------------------------ ---------
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const
> drm_device`, found `*mut Opaque<drm_device>`
> ||
> | | |
> ||
> | | expected all arguments to be this `*const drm_device` type because
> they need to match the type of this parameter
> ||
> | arguments to this function are incorrect
> ||
> |
> ||
> ::: rust/kernel/drm/device.rs:140:18
> ||
> |
> ||
> 140 | unsafe { crate::container_of!(ptr, Self, dev) }.cast_mut()
> ||
> | ------------------------------------ in this macro invocation
> ||
> |
> ||
> = note: expected raw pointer `*const drm_device`
> ||
> found raw pointer `*mut Opaque<drm_device>`
> ||
> note: function defined here
> ||
> --> rust/kernel/lib.rs:241:8
> ||
> |
> ||
> 241 | pub fn assert_same_type<T>(_: T, _: T) {}
> ||
> | ^^^^^^^^^^^^^^^^ - ---- ---- this parameter needs to match the `*const
> drm_device` type of parameter #1
> ||
> | | |
> ||
> | | parameter #2 needs to match the `*const drm_device` type of this
> parameter
> ||
> | parameter #1 and parameter #2 both reference this parameter `T`
> ||
> = note: this error originates in the macro `crate::container_of` (in
> Nightly builds, run with -Z macro-backtrace for more info)
> ||
> error[E0308]: mismatched types
> ||
> --> rust/kernel/lib.rs:234:45
> ||
> |
> ||
> 234 | $crate::assert_same_type(field_ptr, (&raw const (*container_ptr).
> $($fields)*).cast_mut());
> ||
> | ------------------------ ---------
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*mut
> drm_gem_object`, found `*mut Opaque<drm_gem_object>`
> ||
> | | |
> ||
> | | expected all arguments to be this `*mut drm_gem_object` type because
> they need to match the type of this parameter
> ||
> | arguments to this function are incorrect
> ||
> |
> ||
> ::: rust/kernel/drm/gem/mod.rs:130:20
> ||
> |
> ||
> 130 | unsafe { &*crate::container_of!(self_ptr, Object<T>, obj) }
> ||
> | ---------------------------------------------- in this macro invocation
> ||
> |
> ||
> = note: expected raw pointer `*mut drm_gem_object`
> ||
> found raw pointer `*mut Opaque<drm_gem_object>`
> ||
> note: function defined here
> ||
> --> rust/kernel/lib.rs:241:8
> ||
> |
> ||
> 241 | pub fn assert_same_type<T>(_: T, _: T) {}
> ||
> | ^^^^^^^^^^^^^^^^ - ---- ---- this parameter needs to match the `*mut
> drm_gem_object` type of parameter #1
> ||
> | | |
> ||
> | | parameter #2 needs to match the `*mut drm_gem_object` type of this
> parameter
> ||
> | parameter #1 and parameter #2 both reference this parameter `T`
> ||
> = note: this error originates in the macro `crate::container_of` (in
> Nightly builds, run with -Z macro-backtrace for more info)
> ||
> error[E0308]: mismatched types
> ||
> --> rust/kernel/lib.rs:234:45
> ||
> |
> ||
> 234 | $crate::assert_same_type(field_ptr, (&raw const (*container_ptr).
> $($fields)*).cast_mut());
> ||
> | ------------------------ ---------
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*mut
> drm_gem_object`, found `*mut Opaque<drm_gem_object>`
> ||
> | | |
> ||
> | | expected all arguments to be this `*mut drm_gem_object` type because
> they need to match the type of this parameter
> ||
> | arguments to this function are incorrect
> ||
> |
> ||
> ::: rust/kernel/drm/gem/mod.rs:273:29
> ||
> |
> ||
> 273 | let this = unsafe { crate::container_of!(obj, Self, obj) };
> ||
> | ------------------------------------ in this macro invocation
> ||
> |
> ||
> = note: expected raw pointer `*mut drm_gem_object`
> ||
> found raw pointer `*mut Opaque<drm_gem_object>`
> ||
> note: function defined here
> ||
> --> rust/kernel/lib.rs:241:8
> ||
> |
> ||
> 241 | pub fn assert_same_type<T>(_: T, _: T) {}
> ||
> | ^^^^^^^^^^^^^^^^ - ---- ---- this parameter needs to match the `*mut
> drm_gem_object` type of parameter #1
> ||
> | | |
> ||
> | | parameter #2 needs to match the `*mut drm_gem_object` type of this
> parameter
> ||
> | parameter #1 and parameter #2 both reference this parameter `T`
> ||
> = note: this error originates in the macro `crate::container_of` (in
> Nightly builds, run with -Z macro-backtrace for more info)
> ||
> error: aborting due to 3 previous errors
> ||
> For more information about this error, try `rustc --explain E0308`.
> ||
> make[2]: *** [rust/Makefile:538: rust/kernel.o] Error 1
> ||
> make[1]: *** [/home/pmos/build/src/linux-next-next-20250530/
> Makefile:1285: prepare] Error 2
> ||make: *** [Makefile:248: __sub-make] Error 2|
> 
> 
> Bad: next-20250530
> 
> Good: next-20250528
> 
> 
> Likely introduced with: https://lore.kernel.org/all/
> CANiq72mFiCrzawVUVOU2giJtBVsRdAO3sGtDsZptPuFvmid3EQ@mail•gmail.com/
> 
> 
> Repo: https://gitlab.postmarketos.org/LogicalErzor/pmaports/-/tree/rust/
> device/testing/linux-next
> 
> How it's built (Alpine-like build system):
> 
> - https://archive.ph/vxEmk
> 
> Config fragments (in addition to qcom_defconfig):
> 
> - https://archive.ph/q4hfc
> 
> - https://archive.ph/RKgFf
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: REGRESSION: armv7 build mismatched types
       [not found] ` <CANiq72mFL4dn+0JppLLfxyKnM+xYwKeduFw2j07hUfxWVVHdUw@mail.gmail.com>
@ 2025-06-03 12:51   ` Thorsten Leemhuis
  2025-06-03 13:04     ` Miguel Ojeda
  0 siblings, 1 reply; 7+ messages in thread
From: Thorsten Leemhuis @ 2025-06-03 12:51 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-kernel, Linux regressions mailing list, rust-for-linux,
	Miguel Ojeda, Linux Next Mailing List, Miguel Ojeda

On 30.05.25 11:53, Miguel Ojeda wrote:
> On Fri, May 30, 2025 at 8:23 AM Rudraksha Gupta <guptarud@gmail•com> wrote:
>>
>> Bad: next-20250530
>> Good: next-20250528
> 
> Thanks Rudraksha, the diff attached was needed on merge -- Stephen
> didn't hit the error in his build so he didn't apply it just in case I
> think, but it should be fixed in the next tag.

Stephen, would be nice to see this picked up for -next, as I ran into
the error described at the start of the thread again with todays -next
on Fedora x86_64 and aarch64 using a Fedora rawhide config.

Or is this heading towards mainline really soon now anyway?

> (If the diff doesn't work, of course, please let us know!)

Thx, it fixed things for me.

Ciao, Thorsten



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: REGRESSION: armv7 build mismatched types
  2025-06-03 12:51   ` Thorsten Leemhuis
@ 2025-06-03 13:04     ` Miguel Ojeda
  2025-06-03 21:31       ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Miguel Ojeda @ 2025-06-03 13:04 UTC (permalink / raw)
  To: Thorsten Leemhuis, Stephen Rothwell
  Cc: linux-kernel, Linux regressions mailing list, rust-for-linux,
	Miguel Ojeda, Linux Next Mailing List

On Tue, Jun 3, 2025 at 2:51 PM Thorsten Leemhuis <linux@leemhuis•info> wrote:
>
> Or is this heading towards mainline really soon now anyway?

The Rust PR is, but it would be nice to have the fix in -next before
sending the PR (I will give Linus a test merge anyway, but it is nice
to know everything is OK in -next too, and to have another reference
point for Linus).

> Thx, it fixed things for me.

Thanks for checking!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: REGRESSION: armv7 build mismatched types
  2025-06-03 13:04     ` Miguel Ojeda
@ 2025-06-03 21:31       ` Stephen Rothwell
  2025-06-03 22:26         ` Miguel Ojeda
  2025-06-04 10:46         ` Miguel Ojeda
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Rothwell @ 2025-06-03 21:31 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Thorsten Leemhuis, linux-kernel, Linux regressions mailing list,
	rust-for-linux, Miguel Ojeda, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

Hi Miguel,

On Tue, 3 Jun 2025 15:04:02 +0200 Miguel Ojeda <miguel.ojeda.sandonis@gmail•com> wrote:
>
> On Tue, Jun 3, 2025 at 2:51 PM Thorsten Leemhuis <linux@leemhuis•info> wrote:
> >
> > Or is this heading towards mainline really soon now anyway?  
> 
> The Rust PR is, but it would be nice to have the fix in -next before
> sending the PR (I will give Linus a test merge anyway, but it is nice
> to know everything is OK in -next too, and to have another reference
> point for Linus).

Damn!  I knew I would forget.  Sorry about that, it will be applied
today.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: REGRESSION: armv7 build mismatched types
  2025-06-03 21:31       ` Stephen Rothwell
@ 2025-06-03 22:26         ` Miguel Ojeda
  2025-06-04 10:46         ` Miguel Ojeda
  1 sibling, 0 replies; 7+ messages in thread
From: Miguel Ojeda @ 2025-06-03 22:26 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Thorsten Leemhuis, linux-kernel, Linux regressions mailing list,
	rust-for-linux, Miguel Ojeda, Linux Next Mailing List

On Tue, Jun 3, 2025 at 11:32 PM Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Damn!  I knew I would forget.  Sorry about that, it will be applied
> today.

No worries! If you prefer that I send a reminder in this kind of
cases, I would be happy to do so.

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: REGRESSION: armv7 build mismatched types
  2025-06-03 21:31       ` Stephen Rothwell
  2025-06-03 22:26         ` Miguel Ojeda
@ 2025-06-04 10:46         ` Miguel Ojeda
  2025-06-04 10:59           ` Rudraksha Gupta
  1 sibling, 1 reply; 7+ messages in thread
From: Miguel Ojeda @ 2025-06-04 10:46 UTC (permalink / raw)
  To: Stephen Rothwell, Thorsten Leemhuis, Rudraksha Gupta
  Cc: linux-kernel, Linux regressions mailing list, rust-for-linux,
	Miguel Ojeda, Linux Next Mailing List

On Tue, Jun 3, 2025 at 11:32 PM Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Damn!  I knew I would forget.  Sorry about that, it will be applied
> today.

Looks good to me today, thanks!

Rudraksha/Thorsten: the error should be gone from your builds now.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: REGRESSION: armv7 build mismatched types
  2025-06-04 10:46         ` Miguel Ojeda
@ 2025-06-04 10:59           ` Rudraksha Gupta
  0 siblings, 0 replies; 7+ messages in thread
From: Rudraksha Gupta @ 2025-06-04 10:59 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Stephen Rothwell, Thorsten Leemhuis, linux-kernel,
	Linux regressions mailing list, rust-for-linux, Miguel Ojeda,
	Linux Next Mailing List

Perfect! Works for me now, thanks :)

Thanks,
Rudraksha

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-06-04 11:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <700ebe13-c2d3-48e3-800f-8dc327efb6fc@gmail.com>
2025-05-30  7:46 ` REGRESSION: armv7 build mismatched types Thorsten Leemhuis
     [not found] ` <CANiq72mFL4dn+0JppLLfxyKnM+xYwKeduFw2j07hUfxWVVHdUw@mail.gmail.com>
2025-06-03 12:51   ` Thorsten Leemhuis
2025-06-03 13:04     ` Miguel Ojeda
2025-06-03 21:31       ` Stephen Rothwell
2025-06-03 22:26         ` Miguel Ojeda
2025-06-04 10:46         ` Miguel Ojeda
2025-06-04 10:59           ` Rudraksha Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox