Ticket #547 (closed defect: fixed)

Opened 3 years ago

Last modified 13 months ago

lib/sysdep/os/linux/lcpu.cpp sched_getaffinity fails with errno 22 (EINVAL)

Reported by: markelov Owned by:
Priority: Should Have Milestone: Alpha 2
Component: Non-game systems Keywords: lcpu sched_getaffinity
Cc:

Description

PROBLEM: after compiling and running test_dbg stack call trace lead us to the problem in lib/sysdep/os/linux/lcpu.cpp file while calling to sched_getaffinity function which fails with errno 22 (EINVAL) if you choose Launch debug and test errno after calling to this function.

DESCRIPTION: problem comes not from the game, but from incompatibility of the Linux kernel with NUMA support and glibc. The whole description with solution you may find by the link in the section below.

SOLUTION: http://sourceware.org/ml/libc-help/2009-10/msg00017.html

Change History

comment:1 in reply to: ↑ description Changed 3 years ago by markelov

before applying the solution test fails in lcpu file and pyrogenesis shows black screen which can be killed only by going to a new tty and running killall -9 pyrogenesis

comment:2 Changed 3 years ago by Philip

From that mail thread it looks like we should avoid the problems by using CPU_*_S(), but I'm not sure exactly how to do that and I don't have any way to test whether it fixes this error. If you have a working patch then I'd be happy to apply it.

comment:3 Changed 3 years ago by philip

  • Status changed from new to closed
  • Resolution set to fixed

(In [8024]) Disable implementation of os_cpu_SetThreadAffinityMask on Linux, since it's not necessary and it causes errors. Should fix #547.

comment:4 Changed 3 years ago by markelov

or change CONFIG_NR_CPUS to something lesser or equal 1024

comment:5 Changed 3 years ago by anonymous

  • Milestone Complete deleted

Milestone Complete deleted

comment:6 Changed 13 months ago by historic_bruno

  • Milestone set to Alpha 2
Note: See TracTickets for help on using tickets.