mirror of
https://github.com/nmap/nmap.git
synced 2025-12-27 18:09:01 +00:00
[NSE] Patch to nse_main.lua to print out all active scripts (running & waiting)
at debugging level 2 or higher and when a key is pressed. This is especially useful when we have a rare deadlock and we want to know which scripts are involved and where (a traceback is also printed).
This commit is contained in:
10
nse_main.lua
10
nse_main.lua
@@ -544,6 +544,16 @@ local function run (threads)
|
||||
print_verbose(1, "Active NSE Script Threads: %d (%d waiting)\n",
|
||||
nr+nw, nw);
|
||||
progress("printStats", 1-(nr+nw)/total);
|
||||
if debugging() >= 2 then
|
||||
for co, thread in pairs(running) do
|
||||
thread:d("Running: %THREAD\n\t%s",
|
||||
(gsub(traceback(co), "\n", "\n\t")));
|
||||
end
|
||||
for co, thread in pairs(waiting) do
|
||||
thread:d("Waiting: %THREAD\n\t%s",
|
||||
(gsub(traceback(co), "\n", "\n\t")));
|
||||
end
|
||||
end
|
||||
elseif progress "mayBePrinted" then
|
||||
if verbosity() > 1 or debugging() > 0 then
|
||||
progress("printStats", 1-(nr+nw)/total);
|
||||
|
||||
Reference in New Issue
Block a user