# Nmap giving an Illegal instruction error

## jessler

I have tried to use a couple different versions of nmap, and each time I get the following error.

```
nmap -v -sS -P0 x.x.x.x

Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2006-11-28 17:06 CST

Initiating SYN Stealth Scan against xxxxxxx (x.x.x.x) [1663 ports] at 17:06

Discovered open port 25/tcp on x.x.x.x

Illegal instruction

```

I hid the IP address to protect the innocent.

I'm using an older version because I have that version on another machine and I do not get an error. Also the original command syntax was much longer. I'm using this command syntax just to test a scan.

I also tried the stable version 4.01 and masked version 4.11. All gave the same error. I have a feeling that this is something that is wrong with this particular machine since I could not find any information about this anywhere.

Additional the network settings seem to work fine. I can ping several other systems.

Any help would be greatly appreciated.

----------

## gerdesj

Start off with:

#revdep-rebuild

If that doesn't sort it out then post back and we'll look a bit deeper.

Cheers

Jon

----------

## jessler

What do you mean by revdep-rebuild. Is this a command or a syntax option to emerge or some other command.

I tried running it from a command line and I get "command not found". I also tried to search for an ebuild, but no luck.

Thanks

----------

## gerdesj

 *jessler wrote:*   

> What do you mean by revdep-rebuild. Is this a command or a syntax option to emerge or some other command.
> 
> I tried running it from a command line and I get "command not found". I also tried to search for an ebuild, but no luck.
> 
> Thanks

 

emerge gentoolkit to get revdep-rebuild.  It will run through all your binaries and check the linking, then it will re emerge broken ones.  It effectively checks reverse dependencies, hence the name.

Alternatively, you can run

#ldd /usr/bin/nmap

which will tell you what nmap depends on in libraries.  Then using equery, you can determine the ebuilds that installed those. Then re emerge them.  Running revdep-rebuild a couple of times is a bit quicker and easier thogh!

Cheers

Jon

----------

## jessler

Thanks for the help with revdep-rebuild. I emerge gentoolkit as instructed and ran the command revdep-rebuild. Here is the output:

```
 # revdep-rebuild

Configuring search environment for revdep-rebuild

Checking reverse dependencies...

Packages containing binaries and libraries broken by a package update

will be emerged.

Collecting system binaries and libraries... done.

  (/root/.revdep-rebuild.1_files)

Collecting complete LD_LIBRARY_PATH... done.

  (/root/.revdep-rebuild.2_ldpath)

Checking dynamic linking consistency...

 done.

  (/root/.revdep-rebuild.3_rebuild)

Assigning files to ebuilds... Nothing to rebuild

Evaluating package order... done.

  (/root/.revdep-rebuild.5_order)

Dynamic linking on your system is consistent... All done.

```

It did not appear to fix anything, but I re-ran the nmap command again and received the same results.

----------

## gerdesj

Have you recently updated your toolchain?  eg gcc from 3.x to 4.x?

Any other major changes recently to this system eg 1st time you've run "emerge --deep --newuse world" in ages.

Could you post the output of "emerge --info" please?

Cheers

Jon

----------

## jessler

No new changes, as a matter of fact I had just built the system.

I can't run "emerge --info" just yet. I needed to get nmap to work for a report due by the end of the week, so I used a Slax Live CD to do the Nmap part. My scans should be done by the morning and if Nessus works I will run the command then.

I don't want to spend a lot of time troubleshooting, it would be easier to just rebuild the system. But I would like to find out what is causing this. I would also like to know if I have done something wrong. This wasn't my first install of Gentoo, so it puzzles me why I'm having this issue.

Thanks Again

----------

## gerdesj

Could I also have the result of this:

#gcc-config -l    ('el')

... when you are ready as well as emerge --info

Cheers

Jon

----------

## jessler

Here is the output of emerge --info

```
 emerge --info

Portage 2.1.1-r1 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.4-r3, 2.6.18-gentoo-r2 i686)

=================================================================

System uname: 2.6.18-gentoo-r2 i686 Intel(R) Pentium(R) III CPU             1133MHz

Gentoo Base System version 1.12.1

Last Sync: Wed, 15 Nov 2006 22:30:01 +0000

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: [Not Present]

dev-lang/python:     2.4.3-r1

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.3.13-r3

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=pentium4 -pipe -O3"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/X11/xkb"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"

CXXFLAGS="-march=pentium4 -pipe -O3"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"

GENTOO_MIRRORS="ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 berkdb bitmap-fonts cli cracklib crypt cups dlloader dri elibc_glibc fortran gdbm gpm iconv input_devices_keyboard input_devices_mouse ipv6 isdnlog kernel_linux libg++ ncurses nls nptl nptlonly pam pcre perl ppds pppd python readline reflection session spl ssl tcpd truetype-fonts type1-fonts udev unicode userland_GNU video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i740 video_cards_i810 video_cards_imstt video_cards_mga video_cards_neomagic video_cards_nsc video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo xorg zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

Here is the output of gcc-config -l

```
[1] i686-pc-linux-gnu-4.1.1 *
```

----------

## jessler

I just noticed after I replied to your request for the output of emerge --info, that the processor is a Pentium 3. 

I compilied the kernel for a Pentium 4 and configured the make.conf for a Pentium 4. 

The machine has a stupid "intel inside" sticker that says it is a Pentium 4. I don't know if Dell put the wrong sticker on the box, unlikely, or if a PC tech here at work swapped out the motherboard and processor.

Well lesson learned. Always more /proc/cpuinfo and verify the processor.

Thanks for your help

----------

## gerdesj

 *jessler wrote:*   

> I just noticed after I replied to your request for the output of emerge --info, that the processor is a Pentium 3. 
> 
> I compilied the kernel for a Pentium 4 and configured the make.conf for a Pentium 4. 
> 
> The machine has a stupid "intel inside" sticker that says it is a Pentium 4. I don't know if Dell put the wrong sticker on the box, unlikely, or if a PC tech here at work swapped out the motherboard and processor.
> ...

 

Well spotted.  Now do you rebuild or emerge -e world a couple of times?!

Cheers

Jon

----------

