Skip to content

Commit eb22d7c

Browse files
committed
chore: temp 26.04 fs probe
1 parent 6eac757 commit eb22d7c

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/probe2604.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: probe2604
2+
on: [push]
3+
jobs:
4+
probe:
5+
runs-on: ${{ matrix.os }}
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
os: [ubuntu-24.04, ubuntu-26.04]
10+
steps:
11+
- run: |
12+
uname -a
13+
for d in / /home/runner/work /home/runner /tmp /var/tmp /mnt; do
14+
printf '%s -> %s\n' "$d" "$(stat -f -c %T "$d" 2>/dev/null)"
15+
done
16+
findmnt -o TARGET,SOURCE,FSTYPE | head -30
17+
- name: repro
18+
run: |
19+
mkdir -p "$HOME/work/probe/target/tmp"
20+
cat > /tmp/r.c <<'EOF'
21+
#include <stdio.h>
22+
#include <stdlib.h>
23+
#include <string.h>
24+
#include <sys/mman.h>
25+
#include <unistd.h>
26+
int main(int argc, char** argv) {
27+
size_t len = 64UL*1024*1024;
28+
char t[4096]; snprintf(t, sizeof t, "%s/probe-XXXXXX", argv[1]);
29+
int fd = mkstemp(t); if (fd < 0) return 1; unlink(t);
30+
char c[65536]; memset(c, 0x42, sizeof c);
31+
for (size_t o = 0; o < len; o += sizeof c) if (write(fd, c, sizeof c) < 0) return 1;
32+
void* m = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);
33+
if (m == MAP_FAILED) return 1;
34+
volatile char s = 0;
35+
for (size_t i = 0; i < len; i += 4096) s ^= ((volatile char*)m)[i];
36+
FILE* f = fopen("/proc/self/status", "r"); char line[256];
37+
while (fgets(line, sizeof line, f)) if (strstr(line, "Rss") || strstr(line, "VmHWM")) fputs(line, stdout);
38+
return s & 0;
39+
}
40+
EOF
41+
gcc -O0 -o /tmp/r /tmp/r.c
42+
for d in "$HOME/work/probe/target/tmp" /var/tmp /tmp; do echo "== $d ($(stat -f -c %T $d))"; /tmp/r "$d"; done

0 commit comments

Comments
 (0)