Nmap Development mailing list archives

Re: Assertion error related to Lua garbage collection of nsock pcap objects


From: jah <jah () zadkiel plus com>
Date: Tue, 31 Jul 2012 19:30:47 +0100

On 31/07/2012 17:21, Daniel Miller wrote:
On 07/31/2012 10:57 AM, Patrick Donnelly wrote:
On Tue, Jul 31, 2012 at 8:06 AM, Daniel Miller <bonsaiviking () gmail com> wrote:
I'm attaching a patch that adds the pcap nsiod to the socket's
uservalue every time. This seems to be working well so far.
Good catch! Please commit it.

Ok, thanks. Committed in r29418.

Dan

I was able to reproduce the error on Windows 7 with r29414:

C:> nmap -d --script sniffer-detect.nse -T5 192.168.1.0/24 -sn -n

NSE: Script scanning 2 hosts.
NSE: Starting runlevel 1 (of 1) scan.
NSE: Starting sniffer-detect against 192.168.1.1.
NSE: Starting sniffer-detect against 192.168.1.10.
Initiating NSE at 01:20
NSE: Finished sniffer-detect against 192.168.1.1.
Trying to delete NSI, but could not find 1 of the purportedly pending events on that IOD.

C:> nmap -d9 --script sniffer-detect.nse -T5 192.168.1.0/24 -sn -n

NSE: Script scanning 2 hosts.
NSE: Starting runlevel 1 (of 1) scan.
NSE: Starting 'sniffer-detect' (thread: 02017B78) against 192.168.1.1.
NSE: Starting 'sniffer-detect' (thread: 0202D0E0) against 192.168.1.10.
Initiating NSE at 01:27
NSOCK (0.0470s) nsi_new (IOD #1)
...
NSOCK (3.0730s) Callback: READ-PCAP TIMEOUT for EID 677
NSOCK (3.0730s) Callback: READ-PCAP TIMEOUT for EID 669
NSOCK (3.0730s) Pcap read request from IOD #1  EID 685
NSOCK (3.0730s) Pcap read request from IOD #1  EID 693
NSOCK (3.0730s) Callback: READ-PCAP SUCCESS for EID 693
NSOCK (3.0730s) Callback: READ-PCAP SUCCESS for EID 685
NSE: > | CLOSE
NSE: Finished 'sniffer-detect' (thread: 02017B78) against 192.168.1.1.
...
NSOCK (4.5240s) Callback: READ-PCAP TIMEOUT for EID 853
NSOCK (4.5240s) Pcap read request from IOD #1  EID 861
NSOCK (4.5710s) Callback: READ-PCAP SUCCESS for EID 861
NSOCK (4.5710s) Pcap read request from IOD #1  EID 869
NSOCK (4.6800s) Callback: READ-PCAP TIMEOUT for EID 869
NSOCK (4.6800s) nsi_delete (IOD #1)
Assertion failed: msiod->state != NSIOD_STATE_DELETED, file src\nsock_event.c, line 406

Now, with the fixed r29418, the scan completes normally:

Nmap done: 255 IP addresses (5 hosts up) scanned in 13.41 seconds
           Raw packets sent: 506 (14.168KB) | Rcvd: 5 (140B)

jah
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: