Skip to contentSkip to conversation

sigrelse01: Select signals based on SIGRTMIN/SIGRTMAX for musl compat

PATCH In review Florian Schmaus via ltp 3 participants 4 messages Aug 14, 2025 – Aug 18, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 sigrelse01: Select signals based on SIGRTMIN/SIGRTMAX for musl compat

This avoids selecting signal 34 when the test is run using musl. Signal 34 is used internally by musl as SIGSYNCCALL. Consequently, musl's signal() will return with an error status and errno set to EINVAL when trying to setup a signal handler for signal 34, causing the sigrelse01 test to fail.

Thanks to Pedro Falcato for suggesting using SIGRTMIN and SIGRTMAX for this check.

---

Changes in v3:
- base check on SIGRTMIN / SIGRTMAX, as suggested by Pedro Falcato

 testcases/kernel/syscalls/sigrelse/sigrelse01.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/sigrelse/sigrelse01.c +3 -1
index d1ed9d53a4dc..23c6758262bb 100644
@@ -739,8 +739,10 @@ int choose_sig(int sig)
 
 	}
 
-	return 1;
+	if (sig < 32)
+		return 1;
 
+	return sig >= SIGRTMIN && sig <= SIGRTMAX;
 }
 
 void setup(void)
Signature · 5 lines
2.49.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by Tested-by on v3 1/1
#1 lore raw

Hi Florian, Pedro,

Quoted 5 lines

This avoids selecting signal 34 when the test is run using musl. Signal 34 is used internally by musl as SIGSYNCCALL. Consequently, musl's signal() will return with an error status and errno set to EINVAL when trying to setup a signal handler for signal 34, causing the sigrelse01 test to fail.

+1, now it works on both glibc and musl (and hopefully in the rest of libc).

Quoted 2 lines

Thanks to Pedro Falcato for suggesting using SIGRTMIN and SIGRTMAX for this check.

nit: @Florian instead of the above I'll add:

@Pedro Can I merge with your RBT?

Kind regards,
Petr

Quoted 24 lines

---

Changes in v3:
- base check on SIGRTMIN / SIGRTMAX, as suggested by Pedro Falcato

 testcases/kernel/syscalls/sigrelse/sigrelse01.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/sigrelse/sigrelse01.c +3 -1
index d1ed9d53a4dc..23c6758262bb 100644
@@ -739,8 +739,10 @@ int choose_sig(int sig)
 
 	}
 
-	return 1;
+	if (sig < 32)
+		return 1;
 
+	return sig >= SIGRTMIN && sig <= SIGRTMAX;
 }
 
 void setup(void)
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
Quoted 13 lines · Petr Vorel

Hi Florian, Pedro,

Quoted 5 lines

This avoids selecting signal 34 when the test is run using musl. Signal 34 is used internally by musl as SIGSYNCCALL. Consequently, musl's signal() will return with an error status and errno set to EINVAL when trying to setup a signal handler for signal 34, causing the sigrelse01 test to fail.

+1, now it works on both glibc and musl (and hopefully in the rest of libc).

Quoted 7 lines
Quoted 2 lines

Thanks to Pedro Falcato for suggesting using SIGRTMIN and SIGRTMAX for this check.

nit: @Florian instead of the above I'll add:

@Pedro Can I merge with your RBT?

Assuming you mean Reviewed-by, yep, all fine by me.

Signature · 4 lines
Pedro

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi Florian, Pedro,

Quoted 17 lines · Petr Vorel
Quoted 15 lines

Hi Florian, Pedro,

Quoted 5 lines

This avoids selecting signal 34 when the test is run using musl. Signal 34 is used internally by musl as SIGSYNCCALL. Consequently, musl's signal() will return with an error status and errno set to EINVAL when trying to setup a signal handler for signal 34, causing the sigrelse01 test to fail.

+1, now it works on both glibc and musl (and hopefully in the rest of libc).

Quoted 2 lines

Thanks to Pedro Falcato for suggesting using SIGRTMIN and SIGRTMAX for this check.

Quoted 6 lines
Quoted 4 lines

nit: @Florian instead of the above I'll add:

@Pedro Can I merge with your RBT?

Assuming you mean Reviewed-by, yep, all fine by me.

Thank you both! Patch merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp