* register_syctl_init error in linux-next-20250612
@ 2025-06-12 17:55 Bert Karwatzki
2025-06-19 11:50 ` Joel Granados
2025-06-19 12:39 ` Joel Granados
0 siblings, 2 replies; 8+ messages in thread
From: Bert Karwatzki @ 2025-06-12 17:55 UTC (permalink / raw)
To: Joel Granados
Cc: Bert Karwatzki, linux-kernel, linux-next, Waiman Long, Kees Cook
When starting evolution (gnome email client) on my debian sid with
linux-next-20250612 I get the following error message on the terminal
emulator (the Gtk messages also occur when):
Gtk-Message: 13:34:49.069: Failed to load module "colorreload-gtk-module"
Gtk-Message: 13:34:49.070: Failed to load module "window-decorations-gtk-module"
Gtk-Message: 13:34:51.012: Failed to load module "colorreload-gtk-module"
Gtk-Message: 13:34:51.013: Failed to load module "window-decorations-gtk-module"
bwrap: Can't read /proc/sys/kernel/overflowuid: No such file or directory
** (org.gnome.Evolution:3327): ERROR **: 13:34:51.245: Failed to fully launch dbus-proxy: Der Kindprozess wurde mit Status 1 beendet
Trace/Breakpoint ausgelöst
and the following message in dmesg:
[ 305.600587] [ T3327] traps: evolution[3327] trap int3 ip:7f64442d3ab7 sp:7ffc9f4e94d0 error:0 in libglib-2.0.so.0.8400.2[66ab7,7f644428c000+a1000]
I bisected this to commit cf47285025e6 ("locking/rtmutex: Move max_lock_depth
into rtmutex.c"). The absence of /proc/sys/kernel/overflow{uid,gid} seems to be the related
to the start failure, in affected kernel version the files are absent while they're present
when evolution starts normally.
Also when booting next-20250612 I get this error message regarding max_lock_depth and
rtmutex_sysctl_table:
[ 0.234399] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
[ 0.234402] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
[ 0.234405] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
[ 0.234407] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
Reverting commit cf47285025e6 in next-20250612 fixes the both the "sysctl duplicate
entry" issue and the missing overflow{gid,uid} files and evolution starts normally again.
As there were conflicts when reverting, here the revert patch for next-20250612
to illustrate conflict resolution:
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index dc9a51cda97c..7d049883a08a 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -18,6 +18,8 @@
#include <linux/rbtree_types.h>
#include <linux/spinlock_types_raw.h>
+extern int max_lock_depth; /* for sysctl */
+
struct rt_mutex_base {
raw_spinlock_t wait_lock;
struct rb_root_cached waiters;
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 705a0e0fd72a..c80902eacd79 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -29,29 +29,6 @@
#include "rtmutex_common.h"
#include "lock_events.h"
-/*
- * Max number of times we'll walk the boosting chain:
- */
-static int max_lock_depth = 1024;
-
-static const struct ctl_table rtmutex_sysctl_table[] = {
- {
- .procname = "max_lock_depth",
- .data = &max_lock_depth,
- .maxlen = sizeof(int),
- .mode = 0644,
- .proc_handler = proc_dointvec,
- },
-};
-
-static int __init init_rtmutex_sysctl(void)
-{
- register_sysctl_init("kernel", rtmutex_sysctl_table);
- return 0;
-}
-
-subsys_initcall(init_rtmutex_sysctl);
-
#ifndef WW_RT
# define build_ww_mutex() (false)
# define ww_container_of(rtm) NULL
diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
index 9e00ea0e5cfa..2d933528a0fa 100644
--- a/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -8,6 +8,11 @@
#define RT_MUTEX_BUILD_MUTEX
#include "rtmutex.c"
+/*
+ * Max number of times we'll walk the boosting chain:
+ */
+int max_lock_depth = 1024;
+
/*
* Debug aware fast / slowpath lock,trylock,unlock
*
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 0716c7df7243..82af6e6f5dbb 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -23,6 +23,14 @@
#include <linux/uaccess.h>
#include <asm/processor.h>
+#ifdef CONFIG_X86
+#include <asm/nmi.h>
+#include <asm/io.h>
+#endif
+#ifdef CONFIG_RT_MUTEXES
+#include <linux/rtmutex.h>
+#endif
+
/* shared constants to be used in various sysctls */
const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 };
EXPORT_SYMBOL(sysctl_vals);
@@ -1525,6 +1533,15 @@ static const struct ctl_table kern_table[] = {
.proc_handler = proc_dointvec,
},
#endif
+#ifdef CONFIG_RT_MUTEXES
+ {
+ .procname = "max_lock_depth",
+ .data = &max_lock_depth,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
+#endif
};
int __init sysctl_init_bases(void)
Bert Karwatzki
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: register_syctl_init error in linux-next-20250612
2025-06-12 17:55 register_syctl_init error in linux-next-20250612 Bert Karwatzki
@ 2025-06-19 11:50 ` Joel Granados
2025-06-19 12:39 ` Joel Granados
1 sibling, 0 replies; 8+ messages in thread
From: Joel Granados @ 2025-06-19 11:50 UTC (permalink / raw)
To: Bert Karwatzki; +Cc: linux-kernel, linux-next, Waiman Long, Kees Cook
[-- Attachment #1: Type: text/plain, Size: 5443 bytes --]
Hey Bert
Thx for the report.
I just tested on my https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/log/?h=sysctl-next
and can't see the issue. Maybe its something that I'm missing in the
configuration. Do you happen to have your the .config that you used?
On Thu, Jun 12, 2025 at 07:55:13PM +0200, Bert Karwatzki wrote:
> When starting evolution (gnome email client) on my debian sid with
> linux-next-20250612 I get the following error message on the terminal
> emulator (the Gtk messages also occur when):
>
> Gtk-Message: 13:34:49.069: Failed to load module "colorreload-gtk-module"
> Gtk-Message: 13:34:49.070: Failed to load module "window-decorations-gtk-module"
> Gtk-Message: 13:34:51.012: Failed to load module "colorreload-gtk-module"
> Gtk-Message: 13:34:51.013: Failed to load module "window-decorations-gtk-module"
> bwrap: Can't read /proc/sys/kernel/overflowuid: No such file or directory
>
> ** (org.gnome.Evolution:3327): ERROR **: 13:34:51.245: Failed to fully launch dbus-proxy: Der Kindprozess wurde mit Status 1 beendet
> Trace/Breakpoint ausgelöst
>
> and the following message in dmesg:
>
> [ 305.600587] [ T3327] traps: evolution[3327] trap int3 ip:7f64442d3ab7 sp:7ffc9f4e94d0 error:0 in libglib-2.0.so.0.8400.2[66ab7,7f644428c000+a1000]
>
> I bisected this to commit cf47285025e6 ("locking/rtmutex: Move max_lock_depth
> into rtmutex.c"). The absence of /proc/sys/kernel/overflow{uid,gid} seems to be the related
> to the start failure, in affected kernel version the files are absent while they're present
> when evolution starts normally.
>
> Also when booting next-20250612 I get this error message regarding max_lock_depth and
> rtmutex_sysctl_table:
>
> [ 0.234399] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> [ 0.234402] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> [ 0.234405] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> [ 0.234407] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
that is weird. I made sure that we only call register once. Will test
this on next and see what I get
>
> Reverting commit cf47285025e6 in next-20250612 fixes the both the "sysctl duplicate
> entry" issue and the missing overflow{gid,uid} files and evolution starts normally again.
I would like to fix this instead of reverting. Let me give it a go and
revert if there is no easy fix.
>
> As there were conflicts when reverting, here the revert patch for next-20250612
> to illustrate conflict resolution:
Thx for this.
>
> diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
> index dc9a51cda97c..7d049883a08a 100644
> --- a/include/linux/rtmutex.h
> +++ b/include/linux/rtmutex.h
> @@ -18,6 +18,8 @@
> #include <linux/rbtree_types.h>
> #include <linux/spinlock_types_raw.h>
>
> +extern int max_lock_depth; /* for sysctl */
> +
> struct rt_mutex_base {
> raw_spinlock_t wait_lock;
> struct rb_root_cached waiters;
> diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
> index 705a0e0fd72a..c80902eacd79 100644
> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -29,29 +29,6 @@
> #include "rtmutex_common.h"
> #include "lock_events.h"
>
> -/*
> - * Max number of times we'll walk the boosting chain:
> - */
> -static int max_lock_depth = 1024;
> -
> -static const struct ctl_table rtmutex_sysctl_table[] = {
> - {
> - .procname = "max_lock_depth",
> - .data = &max_lock_depth,
> - .maxlen = sizeof(int),
> - .mode = 0644,
> - .proc_handler = proc_dointvec,
> - },
> -};
> -
> -static int __init init_rtmutex_sysctl(void)
> -{
> - register_sysctl_init("kernel", rtmutex_sysctl_table);
> - return 0;
> -}
> -
> -subsys_initcall(init_rtmutex_sysctl);
> -
> #ifndef WW_RT
> # define build_ww_mutex() (false)
> # define ww_container_of(rtm) NULL
> diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
> index 9e00ea0e5cfa..2d933528a0fa 100644
> --- a/kernel/locking/rtmutex_api.c
> +++ b/kernel/locking/rtmutex_api.c
> @@ -8,6 +8,11 @@
> #define RT_MUTEX_BUILD_MUTEX
> #include "rtmutex.c"
>
> +/*
> + * Max number of times we'll walk the boosting chain:
> + */
> +int max_lock_depth = 1024;
> +
> /*
> * Debug aware fast / slowpath lock,trylock,unlock
> *
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 0716c7df7243..82af6e6f5dbb 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -23,6 +23,14 @@
> #include <linux/uaccess.h>
> #include <asm/processor.h>
>
> +#ifdef CONFIG_X86
> +#include <asm/nmi.h>
> +#include <asm/io.h>
> +#endif
> +#ifdef CONFIG_RT_MUTEXES
> +#include <linux/rtmutex.h>
> +#endif
> +
> /* shared constants to be used in various sysctls */
> const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 };
> EXPORT_SYMBOL(sysctl_vals);
> @@ -1525,6 +1533,15 @@ static const struct ctl_table kern_table[] = {
> .proc_handler = proc_dointvec,
> },
> #endif
> +#ifdef CONFIG_RT_MUTEXES
> + {
> + .procname = "max_lock_depth",
> + .data = &max_lock_depth,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec,
> + },
> +#endif
> };
>
> int __init sysctl_init_bases(void)
>
>
> Bert Karwatzki
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: register_syctl_init error in linux-next-20250612
2025-06-12 17:55 register_syctl_init error in linux-next-20250612 Bert Karwatzki
2025-06-19 11:50 ` Joel Granados
@ 2025-06-19 12:39 ` Joel Granados
2025-06-20 9:37 ` Bert Karwatzki
1 sibling, 1 reply; 8+ messages in thread
From: Joel Granados @ 2025-06-19 12:39 UTC (permalink / raw)
To: Bert Karwatzki; +Cc: linux-kernel, linux-next, Waiman Long, Kees Cook
[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]
On Thu, Jun 12, 2025 at 07:55:13PM +0200, Bert Karwatzki wrote:
> When starting evolution (gnome email client) on my debian sid with
> linux-next-20250612 I get the following error message on the terminal
> emulator (the Gtk messages also occur when):
>
> Gtk-Message: 13:34:49.069: Failed to load module "colorreload-gtk-module"
> Gtk-Message: 13:34:49.070: Failed to load module "window-decorations-gtk-module"
> Gtk-Message: 13:34:51.012: Failed to load module "colorreload-gtk-module"
> Gtk-Message: 13:34:51.013: Failed to load module "window-decorations-gtk-module"
> bwrap: Can't read /proc/sys/kernel/overflowuid: No such file or directory
>
> ** (org.gnome.Evolution:3327): ERROR **: 13:34:51.245: Failed to fully launch dbus-proxy: Der Kindprozess wurde mit Status 1 beendet
> Trace/Breakpoint ausgelöst
>
> and the following message in dmesg:
>
> [ 305.600587] [ T3327] traps: evolution[3327] trap int3 ip:7f64442d3ab7 sp:7ffc9f4e94d0 error:0 in libglib-2.0.so.0.8400.2[66ab7,7f644428c000+a1000]
>
> I bisected this to commit cf47285025e6 ("locking/rtmutex: Move max_lock_depth
> into rtmutex.c"). The absence of /proc/sys/kernel/overflow{uid,gid} seems to be the related
> to the start failure, in affected kernel version the files are absent while they're present
> when evolution starts normally.
I just tested with next-20250619 and I see /proc/sys/kernel/overflow{uid,gid}
>
> Also when booting next-20250612 I get this error message regarding max_lock_depth and
> rtmutex_sysctl_table:
>
> [ 0.234399] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> [ 0.234402] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> [ 0.234405] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> [ 0.234407] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
And I do not see these messages in my dmesg. And
/proc/sys/kernel/max_lock_depth exists.
Maybe its something that only happened with the version from the 12th?
Could you test again with the version from the 19?
Best
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: register_syctl_init error in linux-next-20250612
2025-06-19 12:39 ` Joel Granados
@ 2025-06-20 9:37 ` Bert Karwatzki
2025-06-20 11:11 ` Joel Granados
0 siblings, 1 reply; 8+ messages in thread
From: Bert Karwatzki @ 2025-06-20 9:37 UTC (permalink / raw)
To: Joel Granados; +Cc: linux-kernel, linux-next, Waiman Long, Kees Cook
Am Donnerstag, dem 19.06.2025 um 14:39 +0200 schrieb Joel Granados:
> On Thu, Jun 12, 2025 at 07:55:13PM +0200, Bert Karwatzki wrote:
> > When starting evolution (gnome email client) on my debian sid with
> > linux-next-20250612 I get the following error message on the terminal
> > emulator (the Gtk messages also occur when):
> >
> > Gtk-Message: 13:34:49.069: Failed to load module "colorreload-gtk-module"
> > Gtk-Message: 13:34:49.070: Failed to load module "window-decorations-gtk-module"
> > Gtk-Message: 13:34:51.012: Failed to load module "colorreload-gtk-module"
> > Gtk-Message: 13:34:51.013: Failed to load module "window-decorations-gtk-module"
> > bwrap: Can't read /proc/sys/kernel/overflowuid: No such file or directory
> >
> > ** (org.gnome.Evolution:3327): ERROR **: 13:34:51.245: Failed to fully launch dbus-proxy: Der Kindprozess wurde mit Status 1 beendet
> > Trace/Breakpoint ausgelöst
> >
> > and the following message in dmesg:
> >
> > [ 305.600587] [ T3327] traps: evolution[3327] trap int3 ip:7f64442d3ab7 sp:7ffc9f4e94d0 error:0 in libglib-2.0.so.0.8400.2[66ab7,7f644428c000+a1000]
> >
> > I bisected this to commit cf47285025e6 ("locking/rtmutex: Move max_lock_depth
> > into rtmutex.c"). The absence of /proc/sys/kernel/overflow{uid,gid} seems to be the related
> > to the start failure, in affected kernel version the files are absent while they're present
> > when evolution starts normally.
> I just tested with next-20250619 and I see /proc/sys/kernel/overflow{uid,gid}
>
> >
> > Also when booting next-20250612 I get this error message regarding max_lock_depth and
> > rtmutex_sysctl_table:
> >
> > [ 0.234399] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> > [ 0.234402] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> > [ 0.234405] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> > [ 0.234407] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> And I do not see these messages in my dmesg. And
> /proc/sys/kernel/max_lock_depth exists.
>
> Maybe its something that only happened with the version from the 12th?
> Could you test again with the version from the 19?
>
> Best
I tested next-202506{12,17,19} and sysctl-next and they all show the buggy behaviour.
CONFIG_PREEMPT_RT=y is needed for the bug to appear.
Bert Karwatzki
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: register_syctl_init error in linux-next-20250612
2025-06-20 9:37 ` Bert Karwatzki
@ 2025-06-20 11:11 ` Joel Granados
2025-06-20 11:17 ` Bert Karwatzki
0 siblings, 1 reply; 8+ messages in thread
From: Joel Granados @ 2025-06-20 11:11 UTC (permalink / raw)
To: Bert Karwatzki; +Cc: linux-kernel, linux-next, Waiman Long, Kees Cook
[-- Attachment #1: Type: text/plain, Size: 2719 bytes --]
On Fri, Jun 20, 2025 at 11:37:40AM +0200, Bert Karwatzki wrote:
> Am Donnerstag, dem 19.06.2025 um 14:39 +0200 schrieb Joel Granados:
> > On Thu, Jun 12, 2025 at 07:55:13PM +0200, Bert Karwatzki wrote:
> > > When starting evolution (gnome email client) on my debian sid with
> > > linux-next-20250612 I get the following error message on the terminal
> > > emulator (the Gtk messages also occur when):
> > >
> > > Gtk-Message: 13:34:49.069: Failed to load module "colorreload-gtk-module"
> > > Gtk-Message: 13:34:49.070: Failed to load module "window-decorations-gtk-module"
> > > Gtk-Message: 13:34:51.012: Failed to load module "colorreload-gtk-module"
> > > Gtk-Message: 13:34:51.013: Failed to load module "window-decorations-gtk-module"
> > > bwrap: Can't read /proc/sys/kernel/overflowuid: No such file or directory
> > >
> > > ** (org.gnome.Evolution:3327): ERROR **: 13:34:51.245: Failed to fully launch dbus-proxy: Der Kindprozess wurde mit Status 1 beendet
> > > Trace/Breakpoint ausgelöst
> > >
> > > and the following message in dmesg:
> > >
> > > [ 305.600587] [ T3327] traps: evolution[3327] trap int3 ip:7f64442d3ab7 sp:7ffc9f4e94d0 error:0 in libglib-2.0.so.0.8400.2[66ab7,7f644428c000+a1000]
> > >
> > > I bisected this to commit cf47285025e6 ("locking/rtmutex: Move max_lock_depth
> > > into rtmutex.c"). The absence of /proc/sys/kernel/overflow{uid,gid} seems to be the related
> > > to the start failure, in affected kernel version the files are absent while they're present
> > > when evolution starts normally.
> > I just tested with next-20250619 and I see /proc/sys/kernel/overflow{uid,gid}
> >
> > >
> > > Also when booting next-20250612 I get this error message regarding max_lock_depth and
> > > rtmutex_sysctl_table:
> > >
> > > [ 0.234399] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> > > [ 0.234402] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> > > [ 0.234405] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> > > [ 0.234407] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> > And I do not see these messages in my dmesg. And
> > /proc/sys/kernel/max_lock_depth exists.
> >
> > Maybe its something that only happened with the version from the 12th?
> > Could you test again with the version from the 19?
> >
> > Best
>
> I tested next-202506{12,17,19} and sysctl-next and they all show the buggy behaviour.
> CONFIG_PREEMPT_RT=y is needed for the bug to appear.
Hey
I have managed to reproduce, thx for the clarification.
Did you have the chance to test with the patch that I sent?
Best
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: register_syctl_init error in linux-next-20250612
2025-06-20 11:11 ` Joel Granados
@ 2025-06-20 11:17 ` Bert Karwatzki
2025-06-23 7:55 ` Joel Granados
0 siblings, 1 reply; 8+ messages in thread
From: Bert Karwatzki @ 2025-06-20 11:17 UTC (permalink / raw)
To: Joel Granados; +Cc: linux-kernel, linux-next, Waiman Long, Kees Cook, spasswolf
Am Freitag, dem 20.06.2025 um 13:11 +0200 schrieb Joel Granados:
> On Fri, Jun 20, 2025 at 11:37:40AM +0200, Bert Karwatzki wrote:
> > Am Donnerstag, dem 19.06.2025 um 14:39 +0200 schrieb Joel Granados:
> > > On Thu, Jun 12, 2025 at 07:55:13PM +0200, Bert Karwatzki wrote:
> > > > When starting evolution (gnome email client) on my debian sid with
> > > > linux-next-20250612 I get the following error message on the terminal
> > > > emulator (the Gtk messages also occur when):
> > > >
> > > > Gtk-Message: 13:34:49.069: Failed to load module "colorreload-gtk-module"
> > > > Gtk-Message: 13:34:49.070: Failed to load module "window-decorations-gtk-module"
> > > > Gtk-Message: 13:34:51.012: Failed to load module "colorreload-gtk-module"
> > > > Gtk-Message: 13:34:51.013: Failed to load module "window-decorations-gtk-module"
> > > > bwrap: Can't read /proc/sys/kernel/overflowuid: No such file or directory
> > > >
> > > > ** (org.gnome.Evolution:3327): ERROR **: 13:34:51.245: Failed to fully launch dbus-proxy: Der Kindprozess wurde mit Status 1 beendet
> > > > Trace/Breakpoint ausgelöst
> > > >
> > > > and the following message in dmesg:
> > > >
> > > > [ 305.600587] [ T3327] traps: evolution[3327] trap int3 ip:7f64442d3ab7 sp:7ffc9f4e94d0 error:0 in libglib-2.0.so.0.8400.2[66ab7,7f644428c000+a1000]
> > > >
> > > > I bisected this to commit cf47285025e6 ("locking/rtmutex: Move max_lock_depth
> > > > into rtmutex.c"). The absence of /proc/sys/kernel/overflow{uid,gid} seems to be the related
> > > > to the start failure, in affected kernel version the files are absent while they're present
> > > > when evolution starts normally.
> > > I just tested with next-20250619 and I see /proc/sys/kernel/overflow{uid,gid}
> > >
> > > >
> > > > Also when booting next-20250612 I get this error message regarding max_lock_depth and
> > > > rtmutex_sysctl_table:
> > > >
> > > > [ 0.234399] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> > > > [ 0.234402] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> > > > [ 0.234405] [ T1] sysctl duplicate entry: /kernel/max_lock_depth
> > > > [ 0.234407] [ T1] failed when register_sysctl_sz rtmutex_sysctl_table to kernel
> > > And I do not see these messages in my dmesg. And
> > > /proc/sys/kernel/max_lock_depth exists.
> > >
> > > Maybe its something that only happened with the version from the 12th?
> > > Could you test again with the version from the 19?
> > >
> > > Best
> >
> > I tested next-202506{12,17,19} and sysctl-next and they all show the buggy behaviour.
> > CONFIG_PREEMPT_RT=y is needed for the bug to appear.
> Hey
>
> I have managed to reproduce, thx for the clarification.
>
> Did you have the chance to test with the patch that I sent?
>
> Best
I did not test your patch, but it seems I independently came up with the
same soulution:
It seems to be a compile/file include issue: kernel/locking/rtmutex.c is not compiled
via a Makefile but it's included in via #include:
$ rg "include.*rtmutex.c\>"
kernel/locking/rwsem.c
1405:#include "rtmutex.c"
kernel/locking/spinlock_rt.c
25:#include "rtmutex.c"
kernel/locking/ww_rt_mutex.c
10:#include "rtmutex.c"
kernel/locking/rtmutex_api.c
9:#include "rtmutex.c"
which in the case of PREEMPT_RT=y leads to four call to init_rtmutex_sysctl().
I solved this by moving the code to kernel/locking/rtmutex_api.c:
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 705a0e0fd72a..cf24eacef48d 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -34,24 +34,6 @@
*/
static int max_lock_depth = 1024;
-static const struct ctl_table rtmutex_sysctl_table[] = {
- {
- .procname = "max_lock_depth",
- .data = &max_lock_depth,
- .maxlen = sizeof(int),
- .mode = 0644,
- .proc_handler = proc_dointvec,
- },
-};
-
-static int __init init_rtmutex_sysctl(void)
-{
- register_sysctl_init("kernel", rtmutex_sysctl_table);
- return 0;
-}
-
-subsys_initcall(init_rtmutex_sysctl);
-
#ifndef WW_RT
# define build_ww_mutex() (false)
# define ww_container_of(rtm) NULL
diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
index 9e00ea0e5cfa..a133870b4519 100644
--- a/kernel/locking/rtmutex_api.c
+++ b/kernel/locking/rtmutex_api.c
@@ -8,6 +8,24 @@
#define RT_MUTEX_BUILD_MUTEX
#include "rtmutex.c"
+static const struct ctl_table rtmutex_sysctl_table[] = {
+ {
+ .procname = "max_lock_depth",
+ .data = &max_lock_depth,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
+};
+
+static int __init init_rtmutex_sysctl(void)
+{
+ register_sysctl_init("kernel", rtmutex_sysctl_table);
+ return 0;
+}
+
+subsys_initcall(init_rtmutex_sysctl);
+
/*
* Debug aware fast / slowpath lock,trylock,unlock
*
I tested this patch with and without CONFIG_PREEMPT_RT=y and it
works in both cases.
Bert Karwatzki
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: register_syctl_init error in linux-next-20250612
2025-06-20 11:17 ` Bert Karwatzki
@ 2025-06-23 7:55 ` Joel Granados
0 siblings, 0 replies; 8+ messages in thread
From: Joel Granados @ 2025-06-23 7:55 UTC (permalink / raw)
To: Bert Karwatzki
Cc: linux-kernel, linux-next, Waiman Long, Kees Cook, Peter Zijlstra,
Ingo Molnar, Will Deacon
[-- Attachment #1: Type: text/plain, Size: 3356 bytes --]
On Fri, Jun 20, 2025 at 01:17:15PM +0200, Bert Karwatzki wrote:
> Am Freitag, dem 20.06.2025 um 13:11 +0200 schrieb Joel Granados:
> > On Fri, Jun 20, 2025 at 11:37:40AM +0200, Bert Karwatzki wrote:
> > > Am Donnerstag, dem 19.06.2025 um 14:39 +0200 schrieb Joel Granados:
> > > > On Thu, Jun 12, 2025 at 07:55:13PM +0200, Bert Karwatzki wrote:
...
> >
> > Did you have the chance to test with the patch that I sent?
> >
> > Best
>
> I did not test your patch, but it seems I independently came up with the
> same soulution:
>
> It seems to be a compile/file include issue: kernel/locking/rtmutex.c is not compiled
> via a Makefile but it's included in via #include:
>
> $ rg "include.*rtmutex.c\>"
> kernel/locking/rwsem.c
> 1405:#include "rtmutex.c"
>
> kernel/locking/spinlock_rt.c
> 25:#include "rtmutex.c"
>
> kernel/locking/ww_rt_mutex.c
> 10:#include "rtmutex.c"
>
> kernel/locking/rtmutex_api.c
> 9:#include "rtmutex.c"
>
> which in the case of PREEMPT_RT=y leads to four call to init_rtmutex_sysctl().
>
> I solved this by moving the code to kernel/locking/rtmutex_api.c:
>
> diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
> index 705a0e0fd72a..cf24eacef48d 100644
> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -34,24 +34,6 @@
> */
> static int max_lock_depth = 1024;
I think leaving max_lock_depth hear is not a good idea. Every time rtmutex.c is
included, it will create a private (inside the scope of the file that is
including rtmutex.c) copy of max_lock_depth. This might not result in
misbehavior at the outset, but it increases the potential for trouble.
For now I'll push my original fix to next. Which leaves the definition
of max_lock_depth in rtmutex_api.c avoiding multiptle definitions when
rtmutex.c is included in other files.
Also: CCing maintainers to see if they have any additional info.
Best
> -static const struct ctl_table rtmutex_sysctl_table[] = {
> - {
> - .procname = "max_lock_depth",
> - .data = &max_lock_depth,
> - .maxlen = sizeof(int),
> - .mode = 0644,
> - .proc_handler = proc_dointvec,
> - },
> -};
> -
> -static int __init init_rtmutex_sysctl(void)
> -{
> - register_sysctl_init("kernel", rtmutex_sysctl_table);
> - return 0;
> -}
> -
> -subsys_initcall(init_rtmutex_sysctl);
> -
> #ifndef WW_RT
> # define build_ww_mutex() (false)
> # define ww_container_of(rtm) NULL
> diff --git a/kernel/locking/rtmutex_api.c b/kernel/locking/rtmutex_api.c
> index 9e00ea0e5cfa..a133870b4519 100644
> --- a/kernel/locking/rtmutex_api.c
> +++ b/kernel/locking/rtmutex_api.c
> @@ -8,6 +8,24 @@
> #define RT_MUTEX_BUILD_MUTEX
> #include "rtmutex.c"
> +static const struct ctl_table rtmutex_sysctl_table[] = {
> + {
> + .procname = "max_lock_depth",
> + .data = &max_lock_depth,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec,
> + },
> +};
> +
> +static int __init init_rtmutex_sysctl(void)
> +{
> + register_sysctl_init("kernel", rtmutex_sysctl_table);
> + return 0;
> +}
> +
> +subsys_initcall(init_rtmutex_sysctl);
> +
> /*
> * Debug aware fast / slowpath lock,trylock,unlock
> *
>
> I tested this patch with and without CONFIG_PREEMPT_RT=y and it
> works in both cases.
>
> Bert Karwatzki
>
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* register_syctl_init error in linux-next-20250612
@ 2025-06-19 15:22 Bert Karwatzki
0 siblings, 0 replies; 8+ messages in thread
From: Bert Karwatzki @ 2025-06-19 15:22 UTC (permalink / raw)
To: Joel Granados; +Cc: Bert Karwatzki, linux-kernel, linux-next
I just confirmed that this bug occurs only with CONFIG_PREEMPT_RT=y,
and also occurs in your sysctl-next branch.
Bert Karwatzki
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-06-23 9:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12 17:55 register_syctl_init error in linux-next-20250612 Bert Karwatzki
2025-06-19 11:50 ` Joel Granados
2025-06-19 12:39 ` Joel Granados
2025-06-20 9:37 ` Bert Karwatzki
2025-06-20 11:11 ` Joel Granados
2025-06-20 11:17 ` Bert Karwatzki
2025-06-23 7:55 ` Joel Granados
-- strict thread matches above, loose matches on Subject: below --
2025-06-19 15:22 Bert Karwatzki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox