Nmap Development mailing list archives

Re: nmap(5166) malloc: *** error for object 0x10101ce00: pointer being freed was not allocated


From: Patrik Karlsson <patrik () cqure net>
Date: Wed, 10 Aug 2011 18:38:47 +0200

I've committed the proposed patch as r25731.

//Patrik

On Jul 25, 2011, at 11:09 PM, Patrik Karlsson wrote:

This patch fixes the problem. I don't know whether it's elegant or correct enough, so someone should probably take a 
look at it.

<nsock_free.patch>

//Patrik

On Jul 25, 2011, at 9:08 PM, Patrik Karlsson wrote:

Hi list,

When running a pcap based script on one any of my virtualbox interfaces i get the following error.
The likely reason being that the vboxnet0 interface can not be opened using pcap.
This is, and has long been, a fact in Mac Os X for some (to me not obvious) reason.
I'm including a stack trace incase it helps someone find the bug.
Let me know if I can provide any additional information.

Starting Nmap 5.59BETA1 ( http://nmap.org ) at 2011-07-25 21:02 CEST
vboxnet0
pcap_open_live(vboxnet0, 1500, 0, 357913941) FAILED. Reported error: vboxnet0: No such device exists (BIOCSETIF 
failed: Device not configured).  Will wait 4 seconds then retry.
pcap_open_live(vboxnet0, 1500, 0, 357913941) FAILED. Reported error: vboxnet0: No such device exists (BIOCSETIF 
failed: Device not configured).  Will wait 8 seconds then retry.
Call to pcap_open_live(vboxnet0, 1500, 0, 357913941) failed three times. Reported error: vboxnet0: No such device 
exists (BIOCSETIF failed: Device not configured)
There are several possible reasons for this, depending on your operating system:
LINUX: If you are getting Socket type not supported, try modprobe af_packet or recompile your kernel with PACKET 
enabled.
*BSD:  If you are getting device not configured, you need to recompile your kernel with Berkeley Packet Filter 
support.  If you are getting No such file or directory, try creating the device (eg cd /dev; MAKEDEV <device>; or 
use mknod).
*WINDOWS:  Nmap only supports ethernet interfaces on Windows for most operations because Microsoft disabled raw 
sockets as of Windows XP SP2.  Depending on the reason for this error, it is possible that the --unprivileged 
command-line argument will help.
SOLARIS:  If you are trying to scan localhost and getting '/dev/lo0: No such file or directory', complain to Sun.  I 
don't think Solaris can support advanced localhost scans.  You can probably use "-PN -sT localhost" though.

nmap(5166) malloc: *** error for object 0x10101ce00: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x00007fff92dd482a in __kill ()
(gdb) bt
#0  0x00007fff92dd482a in __kill ()
#1  0x00007fff96577a9c in abort ()
#2  0x00007fff965d684c in free ()
#3  0x000000010006c6d1 in nsi_delete (nsockiod=0x1006ddf90, pending_response=1) at nsock_iod.c:254
#4  0x000000010005bf93 in pcap_gc (L=0x142e) at nse_nsock.cc:951
#5  0x000000010008c872 in luaD_precall (L=0x1006b2b80, func=0x100866cb0, nresults=0) at ldo.c:319
#6  0x000000010008ccae in luaD_call (L=0x1006b2b80, func=0x100866cb0, nResults=0) at ldo.c:376
#7  0x000000010008e58e in GCTM (L=0x1006b2b80) at lgc.c:467
#8  0x000000010008e662 in singlestep (L=0x1006b2b80) at lgc.c:594
#9  0x000000010008e9a8 in luaC_fullgc (L=0x1006b2b80) at lgc.c:656
#10 0x0000000100087cfa in lua_gc (L=0x1006b2b80, what=<value temporarily unavailable, due to optimizations>, 
data=<value temporarily unavailable, due to optimizations>) at lapi.c:914
#11 0x000000010009aaa9 in luaB_collectgarbage (L=0x1006b2b80) at lbaselib.c:200
#12 0x000000010008c872 in luaD_precall (L=0x1006b2b80, func=0x100866c90, nresults=0) at ldo.c:319
#13 0x0000000100097425 in luaV_execute (L=0x1006b2b80, nexeccalls=1) at lvm.c:587
#14 0x000000010008cd0d in luaD_call (L=0x1006b2b80, func=0x100866c30, nResults=0) at ldo.c:377
#15 0x000000010008c3b7 in luaD_rawrunprotected (L=0x1006b2b80, f=0x100088010 <f_call>, ud=0x7fff5fbfce70) at 
ldo.c:116
#16 0x000000010008c430 in luaD_pcall (L=0x1006b2b80, func=<value temporarily unavailable, due to optimizations>, 
u=<value temporarily unavailable, due to optimizations>, old_top=48, ef=<value temporarily unavailable, due to 
optimizations>) at ldo.c:463
#17 0x0000000100087e97 in lua_pcall (L=0x1006b2b80, nargs=<value temporarily unavailable, due to optimizations>, 
nresults=0, errfunc=<value temporarily unavailable, due to optimizations>) at lapi.c:821
#18 0x00000001000596a1 in run_main (L=0x1006b2b80) at nse_main.cc:469
#19 0x000000010008c872 in luaD_precall (L=0x1006b2b80, func=0x100866c10, nresults=0) at ldo.c:319
#20 0x000000010008ccae in luaD_call (L=0x1006b2b80, func=0x100866c10, nResults=0) at ldo.c:376
#21 0x000000010008c3b7 in luaD_rawrunprotected (L=0x1006b2b80, f=0x100087fa0 <f_Ccall>, ud=0x7fff5fbfd0b0) at 
ldo.c:116
#22 0x000000010008c430 in luaD_pcall (L=0x1006b2b80, func=<value temporarily unavailable, due to optimizations>, 
u=<value temporarily unavailable, due to optimizations>, old_top=16, ef=<value temporarily unavailable, due to 
optimizations>) at ldo.c:463
#23 0x0000000100087e3b in lua_cpcall (L=<value temporarily unavailable, due to optimizations>, func=<value 
temporarily unavailable, due to optimizations>, ud=<value temporarily unavailable, due to optimizations>) at 
lapi.c:856
#24 0x00000001000594b1 in script_scan (targets=@0x7fff5fbfe598, scantype=365840) at nse_main.cc:630
#25 0x00000001000081d1 in nmap_main (argc=1606415072, argv=0x7fff5fbff2e0) at nmap.cc:1679
#26 0x00000001000015a0 in main (argc=5, argv=0x7fff5fbffb58) at main.cc:195

Cheers,
Patrik

--
Patrik Karlsson
http://www.cqure.net
http://www.twitter.com/nevdull77


--
Patrik Karlsson
http://www.cqure.net
http://www.twitter.com/nevdull77


--
Patrik Karlsson
http://www.cqure.net
http://www.twitter.com/nevdull77

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


Current thread: