Open
Description
Environment info
- NooBaa Version: 4.19
- Platform: NC in oowy container
Actual behavior
- We use
getpwuid(uid)
in our os_linux.cpp and os_darwin.cpp code while it's an unsafe for multi threaded usage per the getpwuid man page, while the thread safe function we should use isgetpwuid_r()
.
The getpwuid() function need not be thread-safe.
...
The getpwuid_r() function is thread-safe and returns values in a
user-supplied buffer instead of possibly using a static data area
that may be overwritten by each call.
One more issue that might be related (or not) is the following -
4.19 -
Apr 22 13:28:37 node[1234]: PANIC: MUST SYSCALL FAILED: syscall(SYS_setgroups, groups.size(), &groups[0]) = -1 Operation not permitted (1) set_supplemental_groups() at ../src/native/util/os_linux.cpp:75
4.18.2 -
Apr 24 11:10:23 d93e136f730c node[442]: PANIC: MUST SYSCALL FAILED: syscall(SYS_setgroups, orig_groups.size(), &orig_groups[0]) = -1 Op
eration not permitted (1) restore_user() at ../src/native/util/os_linux.cpp:63
Apr 24 11:10:23 d93e136f730c node[442]: qemu: uncaught target signal 6 (Aborted) - core dumped
Expected behavior
- All napi functions in use should be thread safe and we should not fail on PANIC.
Steps to reproduce
- Run RHEL 9 container -
docker run --privileged --user root -d --platform=linux/amd64 oowy/redhat:ubi9
- login to the container - docker exec -it <container_id> bash
- install NooBaa RPM per the instructions mentioned in https://github.com/noobaa/noobaa-core/blob/master/docs/NooBaaNonContainerized/GettingStarted.md#install
- Check NooBaa restarts in the logs -
journalctl -u noobaa