zgrab2
zgrab2 copied to clipboard
Zgrab2 is getting stuck intermittently while doing tls on port 443
I am running the command zgrab2
zgrab2 -f bhQ5Temp tls -p 443 -t 20
Ideally, zgrab2 should timeout after some time, but it's not happening.
Need help in diagnosing the issue, as a first step I recorded the below output from perf tool and strace tool
Please check the zgrab2 stack as recorded with perf-tool
`Samples: 79 of event 'cpu-clock', Event count (approx.): 19750000
Children Self Command Shared Object Symbol ▒
- 84.81% 0.00% zgrab2 zgrab2 [.] runtime.goexit ▒
- runtime.goexit ▒
- 69.62% runtime.systemstack ▒
runtime.gcBgMarkWorker.func2 ◆
- runtime.gcDrain ▒
- 45.57% runtime.scanobject ▒
10.13% runtime.findObject ▒
6.33% runtime.greyobject ▒
- 1.27% apic_timer_interrupt ▒ smp_apic_timer_interrupt ▒ irq_exit ▒ do_softirq ▒ call_softirq ▒ __do_softirq ▒ run_timer_softirq ▒
- 22.78% runtime.markroot ▒
- 11.39% runtime.markroot.func1 ▒
- runtime.scanstack ▒
- 7.59% runtime.gentraceback ▒
- 5.06% runtime.scanstack.func1 ▒
- runtime.scanframeworker ▒
2.53% runtime.(*stackScanState).addObject ▒
1.27% runtime.getStackMap ▒
- 1.27% runtime.scanblock ▒ runtime.findObject ▒ 1.27% runtime.findfunc ▒
- runtime.scanframeworker ▒
2.53% runtime.(*stackScanState).addObject ▒
1.27% runtime.getStackMap ▒
- 5.06% runtime.scanstack.func1 ▒
- 2.53% runtime.shrinkstack ▒ runtime.findfunc ▒ 1.27% runtime.findfunc ▒
- 7.59% runtime.gentraceback ▒
- runtime.scanstack ▒
- 8.86% runtime.markrootBlock ▒
- runtime.scanblock ▒
- 2.53% runtime.greyobject ▒
runtime.(*gcWork).put ▒
runtime.(*gcWork).init ▒
runtime.getempty ▒
runtime.getempty.func1 ▒
runtime.(*mheap).allocManual ▒
- runtime.(*mheap).allocSpan ▒
- 1.27% runtime.(*pageCache).alloc ▒ runtime.findBitRange64 ▒ 1.27% runtime.(*pageAlloc).allocRange ▒ 1.27% runtime.(*gcWork).put ▒ 1.27% runtime.findObject ▒ 2.53% runtime.markrootSpans ▒
- runtime.(*mheap).allocSpan ▒
- 2.53% runtime.greyobject ▒
runtime.(*gcWork).put ▒
runtime.(*gcWork).init ▒
runtime.getempty ▒
runtime.getempty.func1 ▒
runtime.(*mheap).allocManual ▒
- runtime.scanblock ▒
- 11.39% runtime.markroot.func1 ▒
- 45.57% runtime.scanobject ▒
10.13% runtime.findObject ▒
6.33% runtime.greyobject ▒
- runtime.gcDrain ▒
- 6.33% runtime.forcegchelper ▒
- runtime.systemstack ▒
- 3.80% runtime.bgsweep ▒
- 2.53% runtime.mcall ▒
- 2.53% runtime.gcBgMarkWorker `
- 69.62% runtime.systemstack ▒
runtime.gcBgMarkWorker.func2 ◆
strace output --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=14868, si_uid=1002} --- rt_sigreturn({mask=[]}) = 14868 tgkill(14868, 14873, SIGURG) = 0 futex(0x1243f68, FUTEX_WAIT_PRIVATE, 0, NULL) = -1 EAGAIN (Resource temporarily unavailable) futex(0x1243710, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x12435f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0xc000608148, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x1243f68, FUTEX_WAIT_PRIVATE, 0, NULL) = 0 epoll_pwait(14, [], 128, 0, NULL, 3312989) = 0 futex(0x12436f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x12435f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0xc000608148, FUTEX_WAKE_PRIVATE, 1) = 1 sched_yield() = 0 futex(0x125b2e0, FUTEX_WAKE_PRIVATE, 1) = 0 getpid() = 14868 tgkill(14868, 14874, SIGURG) = 0 getpid() = 14868 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=14868, si_uid=1002} --- rt_sigreturn({mask=[]}) = 14868 tgkill(14868, 14874, SIGURG) = 0 futex(0xc00018e148, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x1243710, FUTEX_WAIT_PRIVATE, 0, {0, 100000}) = -1 EAGAIN (Resource temporarily unavailable) epoll_pwait(14, [], 128, 0, NULL, 3312989) = 0 futex(0x12436f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x12435f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0xc00018e148, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x1243710, FUTEX_WAIT_PRIVATE, 0, {0, 100000}) = 0 futex(0x1243f68, FUTEX_WAIT_PRIVATE, 0, NULL) = 0 epoll_pwait(14, [], 128, 0, NULL, 3313109) = 0 futex(0x12436f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x12435f8, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0xc00018e148, FUTEX_WAKE_PRIVATE, 1) = 1 sched_yield() = 0 futex(0x125b2e0, FUTEX_WAKE_PRIVATE, 1) = 0 getpid() = 14868 tgkill(14868, 14875, SIGURG) = 0
Please find the complete stack trace from perf tool
- 84.81% 0.00% zgrab2 zgrab2 [.] runtime.goexit
- 77.22% 0.00% zgrab2 zgrab2 [.] runtime.systemstack
- 69.62% 0.00% zgrab2 zgrab2 [.] runtime.gcBgMarkWorker.func2
- 69.62% 1.27% zgrab2 zgrab2 [.] runtime.gcDrain
- 46.84% 27.85% zgrab2 zgrab2 [.] runtime.scanobject
- 22.78% 0.00% zgrab2 zgrab2 [.] runtime.markroot
- 12.66% 12.66% zgrab2 zgrab2 [.] runtime.findObject
- 12.66% 0.00% zgrab2 [unknown] [.] 0x18e92d244cb60f08
- 12.66% 0.00% zgrab2 [unknown] [.] 0x000000c000038800
- 12.66% 0.00% zgrab2 zgrab2 [.] runtime.clone
- 12.66% 0.00% zgrab2 zgrab2 [.] runtime.mstart
- 12.66% 0.00% zgrab2 zgrab2 [.] runtime.mstart1
- 12.66% 0.00% zgrab2 zgrab2 [.] runtime.sysmon
- 11.39% 0.00% zgrab2 zgrab2 [.] runtime.markroot.func1
- 11.39% 0.00% zgrab2 zgrab2 [.] runtime.scanstack
- 10.13% 6.33% zgrab2 zgrab2 [.] runtime.futex
- 10.13% 3.80% zgrab2 zgrab2 [.] runtime.scanblock
- 8.86% 6.33% zgrab2 zgrab2 [.] runtime.greyobject
- 8.86% 0.00% zgrab2 [kernel.kallsyms] [k] system_call_fastpath
- 8.86% 0.00% zgrab2 zgrab2 [.] runtime.markrootBlock
- 7.59% 1.27% zgrab2 zgrab2 [.] runtime.gentraceback
- 7.59% 1.27% zgrab2 zgrab2 [.] runtime.notetsleep_internal
- 7.59% 0.00% zgrab2 zgrab2 [.] runtime.notetsleep
- 6.33% 0.00% zgrab2 zgrab2 [.] runtime.forcegchelper
- 5.06% 5.06% zgrab2 zgrab2 [.] runtime.gcResetMarkState
- 5.06% 0.00% zgrab2 zgrab2 [.] runtime.scanstack.func1
- 5.06% 0.00% zgrab2 zgrab2 [.] runtime.scanframeworker
- 3.80% 3.80% zgrab2 [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore
- 3.80% 3.80% zgrab2 [kernel.kallsyms] [k] finish_task_switch
- 3.80% 3.80% zgrab2 zgrab2 [.] runtime.findfunc
- 3.80% 1.27% zgrab2 zgrab2 [.] runtime.(*gcWork).put
- 3.80% 0.00% zgrab2 zgrab2 [.] runtime.mcall
- 3.80% 0.00% zgrab2 [kernel.kallsyms] [k] sys_futex
- 3.80% 0.00% zgrab2 [kernel.kallsyms] [k] do_futex
- 3.80% 0.00% zgrab2 zgrab2 [.] runtime.usleep
- 3.80% 0.00% zgrab2 [kernel.kallsyms] [k] sys_nanosleep
- 3.80% 0.00% zgrab2 [kernel.kallsyms] [k] hrtimer_nanosleep
- 3.80% 0.00% zgrab2 [kernel.kallsyms] [k] do_nanosleep
- 3.80% 0.00% zgrab2 [kernel.kallsyms] [k] schedule
- 3.80% 0.00% zgrab2 [kernel.kallsyms] [k] __schedule
- 3.80% 0.00% zgrab2 zgrab2 [.] runtime.bgsweep
- 3.80% 0.00% zgrab2 zgrab2 [.] runtime.sweepone
- 2.53% 2.53% zgrab2 zgrab2 [.] runtime.(*stackScanState).addObject
- 2.53% 2.53% zgrab2 zgrab2 [.] runtime.markrootSpans
- 2.53% 1.27% zgrab2 zgrab2 [.] runtime.(*mspan).sweep
- 2.53% 0.00% zgrab2 zgrab2 [.] runtime.gosched_m
- 2.53% 0.00% zgrab2 zgrab2 [.] runtime.goschedImpl
- 2.53% 1.27% zgrab2 zgrab2 [.] runtime.shrinkstack
- 2.53% 0.00% zgrab2 zgrab2 [.] runtime.(*gcWork).init
- 2.53% 0.00% zgrab2 zgrab2 [.] runtime.(*mheap).allocManual
- 2.53% 0.00% zgrab2 zgrab2 [.] runtime.(*mheap).allocSpan
- 2.53% 0.00% zgrab2 zgrab2 [.] runtime.gcBgMarkWorker
- 2.53% 0.00% zgrab2 zgrab2 [.] runtime.findrunnable