It looks like some pthread* functions call sched_setscheduler() that fails: > 13331 zoom CALL linux_sched_setscheduler(0x1917f,0x2,0x7fffffffbc60) > 13331 zoom RET linux_sched_setscheduler -1 errno -1 Operation not permitted Unfortunately ktrace doesn't show more detailed information about the arguments. 12.2-STABLE r365688
Also affects Beyond Compare: https://forums.freebsd.org/threads/a-linux-program-fails-to-create-thread-without-root-permissions.76332/. I see a few warnings from Steam as well (they are harmless, though): Warning: failed to init scheduler: failed to get rlimit Warning: failed to set thread priority: per-thread setup failed Warning: failed to set thread priority: set failed for priority 4 Warning: support for elevated priorities is most likely unavailable, suppressing future warnings
Is there a relatively small application that can be used to reproduce this? Also: ktrace and truss can't decode Linux-specific parameters, but Linux strace can, and this might also work with sched_setscheduler. Could you perhaps try that?
(In reply to Edward Tomasz Napierala from comment #2) % cat sched.c #define _GNU_SOURCE #include <assert.h> #include <pthread.h> #include <sched.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> void* thread_start(void* arg) { return 0; } int main() { { pthread_attr_t attr; assert(pthread_attr_init(&attr) == 0); assert(pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) == 0); pthread_t t; int err = pthread_create(&t, &attr, &thread_start, NULL); if (err != 0) { fprintf(stderr, "pthread_create: %s\n", strerror(err)); } pthread_attr_destroy(&attr); } { struct sched_param p; p.sched_priority = 0; if (sched_setscheduler(0, SCHED_RESET_ON_FORK, &p) == -1) { perror("sched_setscheduler"); } } { struct rlimit rl; int err = getrlimit(RLIMIT_RTTIME, &rl); if (err == -1) { perror("rlimit"); } } return 0; } % /compat/linux/bin/gcc sched.c -pthread -o sched % ./sched pthread_create: Operation not permitted sched_setscheduler: Invalid argument rlimit: Invalid argument
(In reply to Alex S from comment #3) Ah, so RLIMIT_RTTIME is actually fixed in 13: https://cgit.freebsd.org/src/commit/?id=139c09788bab89163a0378b753bc02f744b7ae10. Don't mind it then :)
(In reply to Alex S from comment #4) So, should it be closed?
(In reply to Dmitry Chagin from comment #5) > So, should it be closed? My comment definitely doesn't imply that.
My bad.
^Triage: canonicalize assignment.
Hi, Working on a revamp of priorities, including the Linuxulator part. The problem you're encountering is probably fixed in the new code I have, but I've yet to actually test. Taking the bug, and will give news during January. Thanks.
<https://www.freebsd.org/status/report-2024-07-2024-09/#_scheduling_priorities_256_queue_runqueues_sub_project>