fptrace icon indicating copy to clipboard operation
fptrace copied to clipboard

some trapCause may lost

Open hengwu0 opened this issue 6 years ago • 5 comments
trafficstars

some trapCause may lost if "var suspended map[int]int" just record only one state.

hengwu0 avatar Feb 12 '19 02:02 hengwu0

I think that suspended is correct. If fptrace exits with an error, could you post the error message? Try running fptrace with -seccomp=false: if this helps, please show the output of uname -srv.

orivej avatar Feb 12 '19 04:02 orivej

NOT an error, i think it may lost some states. e.g. Progress B do some EXEC or FORK or exited before fptrace receive progress A(which B's Parent Process)‘s PTRACE_EVENT_FORK.

hengwu0 avatar Feb 12 '19 06:02 hengwu0

When fptrace marks a process as suspended here, that process is stopped (as after kill -STOP pid): it will not run and will not generate more events (like syscall, exec, fork, exit) until it is resumed here.

orivej avatar Feb 12 '19 14:02 orivej

Firstly, it still can be killed by -SIGKILL. Secondly, if progress A(which B's Parent Process) exited before it's PTRACE_EVENT_FORK, Progress B will be stopped forever.

hengwu0 avatar Feb 13 '19 00:02 hengwu0

Though it is rarely, but can replay by "go tool dist test" cmd.

[wuheng@localhost fptrace]$ ./fptrace -d a.json go tool dist test

##### Testing packages. panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xa8 pc=0x516167]

goroutine 1 [running, locked to thread]: main.terminate(0xb495, 0x0, 0xc4200bbc40) /home/wuheng/test/111111111/src/github.com/fptrace/main.go:262 +0x37 main.mainLoop.func1(0xb495) /home/wuheng/test/111111111/src/github.com/fptrace/main.go:150 +0xc3 main.mainLoop(0xc4200bbb90, 0xa920, 0xc4200bbbd0, 0xc4200bbc40, 0x0) /home/wuheng/test/111111111/src/github.com/fptrace/main.go:161 +0x1258 main.main() /home/wuheng/test/111111111/src/github.com/fptrace/main.go:115 +0x82c

hengwu0 avatar Feb 13 '19 01:02 hengwu0