zmap / zgrab2

Fast Go Application Scanner
Other
1.71k stars 294 forks source link

fix: close CPU profile #416

Closed testwill closed 3 months ago

testwill commented 5 months ago

Add a description of your changes here.

How to Test

Add brief instructions on how to test your changes.

Notes & Caveats

If necessary, explain the motivation for this PR, and note any caveats that apply to your changes or future work that will be needed.

Issue Tracking

Add a link to the relevant GitHub issue(s) if the pull request resolves it.

developStorm commented 3 months ago

Thanks for the PR! 🚀 Just a quick note: pprof.StartCPUProfile() is non-blocking, so deferring the file close right after might cut off data logging prematurely. Maybe we can close the file in stopCPUProfile() instead? That way, we ensure everything is logged properly before closing. Thoughts?