Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Nmap Development: Re: How to debug a segmentation fault

Re: How to debug a segmentation fault

From: Brett Hutley <brett_at_hutley.net>
Date: Thu, 9 Nov 2006 13:07:05 +0000

On Thu, Nov 09, 2006 at 06:06:11AM -0500, Douglas F. Calvert wrote:
> Hello,
> I am testing out nmap4.20a11 with linux 2.6.19-rc5. I am getting a lot
> of segmentation faults when I scan with:
>
> nmap -sV -O -n -oA basename -PE --version_all --allports
> --randomize_hosts -n -v -v --max_retries 3 --log-errors -d5
> 1.1.14-16.1-254 > nmap.out 2>&1

*snip*
 
> How would I go about figuring out why nmap is dying?

Typically you would compile with nmap debug enabled (the "-g" option
in gcc), then start gdb with the nmap binary.

shell$ gdb nmap

(gdb) set args -sV -O -n -oA basename -PE --version_all --allports (etc)

(gdb) run

When the program segfaults, type "up" to move up the stack frame
until you can see the line of the source code that is causing the
segfault (usually overwriting memory, or NULL pointer or some such).

I like running gdb under Emacs, so I can see the source code
easily, if you're not experienced with Emacs then that probably
isn't a good idea.

HTH, Brett

-- 
Brett Hutley
mailto:brett_at_hutley.net
http://hutley.net/brett/
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Nov 09 2006
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]