I can reproduce the bug on -22 and -25 kernels. Here are almost full dmesg logs. You can see SSD errors where swap is placed. This issue may be related to them somehow. To exclude hardware element of errors, I will try other more recent laptop or VirtualBox.
Steps:
1. sudo mount -t tmpfs -o mode=775 tmpfs /mnt
2. sudo dd if=/dev/urandom of=/mnt/garbage
Wait till ENOSPC. In my case, the garbage file becomes of 8 GB.
3. ./eatmem 5000000
This hand-made program only consumes a lot of memory in a loop then sleeps.
So I speculate when the kernel wants to displace tmpfs content to a swap, it encounters the bug. If I reverse second and third steps, the bug does not appear.
I can reproduce the bug on -22 and -25 kernels. Here are almost full dmesg logs. You can see SSD errors where swap is placed. This issue may be related to them somehow. To exclude hardware element of errors, I will try other more recent laptop or VirtualBox.
Steps:
1. sudo mount -t tmpfs -o mode=775 tmpfs /mnt
2. sudo dd if=/dev/urandom of=/mnt/garbage
Wait till ENOSPC. In my case, the garbage file becomes of 8 GB.
3. ./eatmem 5000000
This hand-made program only consumes a lot of memory in a loop then sleeps.
So I speculate when the kernel wants to displace tmpfs content to a swap, it encounters the bug. If I reverse second and third steps, the bug does not appear.