Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Latest commit

 

History

History
16 lines (12 loc) · 615 Bytes

README.md

File metadata and controls

16 lines (12 loc) · 615 Bytes

SIGPROF causes infinite loop

This repo reproduces an interaction between the Go runtime CPU profiler and the BPF_PROG_LOAD syscall on Linux.

Set SetCPUProfileRate(1000) causes the thread executing the syscall to be interrupted every ~1 ms. This in turn leads to BPF_PROG_LOAD to never finish, given a complex enough BPF program.

test_cls_redirect.o is a precompiled version of test_cls_redirect.c from the Linux kernel sources.

$ go run -exec sudo . # sudo is required to allow the BPF syscall