Running the stress-ng utime stressor causes the 15.0 kernel to hang: to reproduce this issue: git clone https://github.com/ColinIanKing/stress-ng cd stress-ng gmake clean gmake -j $(nproc) ./stress-ng --utime -t 60 --verify .. test locks up the kernel Tested in QEMU, 8 CPUs, 4GB RAM, amd64
Using IDE drive emulation
Simple reproducer, run this with vmstat 1 and it shows the free memory reducing and eventually we run out of memory with various services getting killed. #include <fcntl.h> #include <sys/time.h> #include <stdlib.h> #include <stdio.h> int main(void) { struct timeval timevals[2]; char filename[] = "testfile"; int fd; (void)unlink(filename); fd = creat(filename, 0777); if (fd < 0) { fprintf(stderr, "faile to creat %s\n", filename); exit(1); } for (;;) { gettimeofday(&timevals[0], NULL); timevals[1] = timevals[0]; utimes(filename, timevals); } }
(In reply to Colin Ian King from comment #2) stress.c:12:8: warning: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 12 | (void)unlink(filename); | ^ 1 warning generated. You forgot about including <unistd.h> Please add #include <unistd.h> and you will be fine.
^Triage: to submitter: does the recommended change fix your problem?
(In reply to Mark Linimon from comment #4) Adding the <unistd.h> and running the resulting program will still lead to the kernel running out of memory and hanging. The problem is not in the example code I provided, the issue seems to be a resource leak that causes the kernel to hang.
(In reply to Colin Ian King from comment #5) I have been running your code for several hours on arm64, but so far can't spot any leaks or exhaustion. Giving it a short try on adm64 also doesn't ring any bells. How long do I need to run one process of this PoC code to observe regression?
On amd64 it took about 5 minutes to fully run out of memory
(In reply to Colin Ian King from comment #7) I apologise, but I am unable to reproduce it within a finite time.
This does not reproduce for me. Can you clarify which filesystem the file resides on in your case? (notably is it ufs, zfs or tmpfs). Apart from that, does the utimes syscall succeed? Since it takes few minutes to get there, can you validate halfway through if it is kernel memory or process RSS going up? top should show both If this is kernel stuff, then "vmstat -mz" from fresh boot vs after things start getting bad for comparison should help out here.