xref: /freebsd/tools/test/stress2/misc/syzkaller30.sh (revision fd45b686f9d92f583366c75b22c04c7ee49709c0)
1#!/bin/sh
2
3# panic: sched_pickcpu: Failed to find a cpu.
4# cpuid = 1
5# time = 1607419071
6# KDB: stack backtrace:
7# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01bb640770
8# vpanic() at vpanic+0x181/frame 0xfffffe01bb6407c0
9# panic() at panic+0x43/frame 0xfffffe01bb640820
10# sched_pickcpu() at sched_pickcpu+0x4a2/frame 0xfffffe01bb6408d0
11# sched_add() at sched_add+0x5d/frame 0xfffffe01bb640900
12# setrunnable() at setrunnable+0x77/frame 0xfffffe01bb640930
13# wakeup_one() at wakeup_one+0x1d/frame 0xfffffe01bb640950
14# do_lock_umutex() at do_lock_umutex+0x64c/frame 0xfffffe01bb640a40
15# __umtx_op_wait_umutex() at __umtx_op_wait_umutex+0x49/frame 0xfffffe01bb640a80
16# sys__umtx_op() at sys__umtx_op+0x7a/frame 0xfffffe01bb640ac0
17# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe01bb640bf0
18# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01bb640bf0
19# --- syscall (454, FreeBSD ELF64, sys__umtx_op), rip = 0x800254a8c, rsp = 0x7fffdf3f7e88, rbp = 0x7fffdf3f7eb0 ---
20# KDB: enter: panic
21# [ thread pid 58597 tid 106100 ]
22# Stopped at      kdb_enter+0x37: movq    $0,0x10a7766(%rip)
23# db> x/s version
24# version: FreeBSD 13.0-CURRENT #0 r368405: Mon Dec  7 10:33:35 CET 2020
25# pho@t2.osted.lan:/usr/src/sys/amd64/compile/PHO
26# db>
27
28[ `uname -p` != "amd64" ] && exit 0
29
30# Fixed by r368462
31
32# May change policy for random threads to domainset_fixed
33exit 0
34
35. ../default.cfg
36cat > /tmp/syzkaller30.c <<EOF
37// https://syzkaller.appspot.com/bug?id=6652adb41773e5c471c98342fefcbfb041af9ac8
38// autogenerated by syzkaller (https://github.com/google/syzkaller)
39// Reported-by: syzbot+4e3b1009de98d2fabcda@syzkaller.appspotmail.com
40
41#define _GNU_SOURCE
42
43#include <pwd.h>
44#include <stdarg.h>
45#include <stdbool.h>
46#include <stdint.h>
47#include <stdio.h>
48#include <stdlib.h>
49#include <string.h>
50#include <sys/endian.h>
51#include <sys/syscall.h>
52#include <unistd.h>
53
54int main(void)
55{
56  syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul);
57
58  *(uint64_t*)0x200000c0 = 0;
59  syscall(SYS_cpuset_setaffinity, 2ul, 2ul, 0x100000000000000ul, 0x20ul,
60          0x200000c0ul);
61  return 0;
62}
63EOF
64mycc -o /tmp/syzkaller30 -Wall -Wextra -O0 /tmp/syzkaller30.c ||
65    exit 1
66
67(cd /tmp; timeout 3m ./syzkaller30)
68
69rm -rf /tmp/syzkaller30 /tmp/syzkaller30.c /tmp/syzkaller.*
70exit 0
71