iovisor / iovisor/bcc

tools/funclatency: run funclatency with go program cause SIGILL

Open
#3,034 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

Example go program:
```
package main

import (
"math/rand"
"time"
)

func randomsleep() {
time.Sleep(time.Duration(rand.Int63n(1000)) * time.Millisecond)
}

func main() {
for {
randomsleep()
}
}
```
1. run this go program, like `go build testbcc.go && ./testbcc`
2. run funclatency, like `sudo ./funclatency -p $pid -i 1 '/data01/home/cholerae/testbcc:main.randomsleep'`
3. will print a few histgram, then go program will crash.
```
SIGILL: illegal instruction
PC=0x7fffffffe001 m=2 sigcode=0
instruction bytes: 0x75 0x73 0x72 0x2f 0x62 0x69 0x6e 0x2f 0x7a 0x73 0x68 0x0 0x0 0x0 0x0 0x0

goroutine 1 [running]:
runtime: unknown pc 0x7fffffffe001
stack: frame={sp:0xc0000ca778, fp:0x0} stack=[0xc0000ca000,0xc0000ca800)
000000c0000ca678: 0000000000000030 0000000000000048
000000c0000ca688: 000000c0000f4050 00007ffb0c28ed20
000000c0000ca698: 0000000000000000 00000000004dd6a0
000000c0000ca6a8: 00007ffb0c283108 0000000000000000
000000c0000ca6b8: 000000c0000c2040 0000000000000037
000000c0000ca6c8: 000000c0000ca718 000000000046311a
000000c0000ca6d8: 000000c0000ca708 000000000040bb38
000000c0000ca6e8: 0000000000000050 0000000000430b65
000000c0000ca6f8: 00000000004819d0 000000c000010030
000000c0000ca708: 000000c0000ca748 00000000004589bf
000000c0000ca718: 0000000000481a10 000000c0000f4050
000000c0000ca728: 0000000000451313 0000000000000001
000000c0000ca738: 000000c0000f4050 00000000000002ce
000000c0000ca748: 000000c0000ca768 000000000046321f
000000c0000ca758: 000000002acbcf80 00000000000002ce
000000c0000ca768: 000000c0000ca778 00007fffffffe000
000000c0000ca778: <000000c0000ca7d0 0000000000430769
000000c0000ca788: 000000c0000f6000 0000000000000000
000000c0000ca798: 000000c0000f6000 0000000000000000
000000c0000ca7a8: 0100000000000000 0000000000000000
000000c0000ca7b8: 000000c000000180 000000c0000ca7ae
000000c0000ca7c8: 0000000000481958 0000000000000000
000000c0000ca7d8: 000000000045b6e1 0000000000000000
000000c0000ca7e8: 0000000000000000 0000000000000000
000000c0000ca7f8: 0000000000000000
runtime: unknown pc 0x7fffffffe001
stack: frame={sp:0xc0000ca778, fp:0x0} stack=[0xc0000ca000,0xc0000ca800)
000000c0000ca678: 0000000000000030 0000000000000048
000000c0000ca688: 000000c0000f4050 00007ffb0c28ed20
000000c0000ca698: 0000000000000000 00000000004dd6a0
000000c0000ca6a8: 00007ffb0c283108 0000000000000000
000000c0000ca6b8: 000000c0000c2040 0000000000000037
000000c0000ca6c8: 000000c0000ca718 000000000046311a
000000c0000ca6d8: 000000c0000ca708 000000000040bb38
000000c0000ca6e8: 0000000000000050 0000000000430b65
000000c0000ca6f8: 00000000004819d0 000000c000010030
000000c0000ca708: 000000c0000ca748 00000000004589bf
000000c0000ca718: 0000000000481a10 000000c0000f4050
000000c0000ca728: 0000000000451313 0000000000000001
000000c0000ca738: 000000c0000f4050 00000000000002ce
000000c0000ca748: 000000c0000ca768 000000000046321f
000000c0000ca758: 000000002acbcf80 00000000000002ce
000000c0000ca768: 000000c0000ca778 00007fffffffe000
000000c0000ca778: <000000c0000ca7d0 0000000000430769
000000c0000ca788: 000000c0000f6000 0000000000000000
000000c0000ca798: 000000c0000f6000 0000000000000000
000000c0000ca7a8: 0100000000000000 0000000000000000
000000c0000ca7b8: 000000c000000180 000000c0000ca7ae
000000c0000ca7c8: 0000000000481958 0000000000000000
000000c0000ca7d8: 000000000045b6e1 0000000000000000
000000c0000ca7e8: 0000000000000000 0000000000000000
000000c0000ca7f8: 0000000000000000

rax 0x0
rbx 0x430b65
rcx 0xc0000ca000
rdx 0x0
rdi 0x0
rsi 0x0
rbp 0xc0000ca778
rsp 0xc0000ca778
r8 0x1
r9 0x0
r10 0x0
r11 0x206
r12 0x2
r13 0xc000000900
r14 0x80c000180000
r15 0x80c0001fffff
rip 0x7fffffffe001
rflags 0x212
cs 0x33
fs 0x0
gs 0x0
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the failure with the Go program and command in the issue, then inspect tools/funclatency and how it attaches to main.randomsleep. Done means the program continues running while funclatency reports histograms, with coverage or a documented repeatable check for this regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.