zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.75k stars 2.36k forks source link

'pthread_getschedparam' result = 1(EPERM (not permitted)) and abort() #4563

Open Zerone216 opened 1 year ago

Zerone216 commented 1 year ago

Please use this template for reporting suspected bugs or requests for help.

Issue description

'pthread_getschedparam' result = 1(EPERM (not permitted)) and abort()

Environment

libvirt - 6.0.0 qemu - 4.1.0 ceph - 12.2.1

Minimal test code / Steps to reproduce the issue

  1. Build a ceph cluster and virtualized environment
  2. Create a virtual machine, use the rbd client method (cache=none) to allocate rbd volumes, format the corresponding vdb as xfs in the virtual machine, and mount it to a directory
  3. Use fio to test reading and writing, without setting o_direct
  4. The system cache usage soared in guestos, and after a while the virtual machine crashed, it was qemu-kvm that triggered the assertion and exited directly

What's the actual result? (include assertion message & call stack if applicable)

Program received signal SIGABRT, Aborted. [Switching to Thread 0x7f20cacec700 (LWP 3214659)] 0x00007f61e1dd1387 in raise () from /lib64/libc.so.6 (gdb) bt

0 0x00007f61e1dd1387 in raise () at /lib64/libc.so.6

1 0x00007f61e1dd2a78 in abort () at /lib64/libc.so.6

2 0x00007f61cf13802b in zmq::zmqabort(char const*) (errmsg=0x7f61e1f231af "Operation not permitted") at src/err.cpp:88

3 0x00007f61cf181708 in zmq::thread_t::applySchedulingParameters() (this=0x7f619c002a88) at src/thread.cpp:309

4 0x00007f61cf181454 in threadroutine(void*) (arg=0x7f619c002a88) at src/thread.cpp:255

5 0x00007f61e2170ea5 in start_thread () at /lib64/libpthread.so.0

6 0x00007f61e1e99b0d in clone () at /lib64/libc.so.6

What's the expected result?

The qemu-kvm program runs without crashing

bluca commented 1 year ago

are you using selinux in enforcing mode?

Zerone216 commented 1 year ago

I set the selinux configuration to disabled

[root@localhost ~]# getenforce Disabled

Zerone216 commented 1 year ago

My guess is that there are some problems with the system environment configuration, because it is running ok on other hosts. But I cannot find the difference quickly

Zerone216 commented 1 year ago

echo $$ >> /sys/fs/cgroup/cpu/tasks