Nmap Development mailing list archives

Re: 3.90 Segmentation Fault ;-(


From: Fyodor <fyodor () insecure org>
Date: Mon, 12 Sep 2005 00:20:07 -0700

On Mon, Sep 12, 2005 at 10:32:08AM +1200, Craig Humphrey wrote:

Just confirming (now with 3.91) that nmap is compiling with
-fno-strict-aliasing.
And I still get the segfault :(

Put the -fno-strict-aliasing in the Makefile for libpcap, now it works
like a treat!

OK, thanks for the data.  I've added that to the libpcap configure
script for gcc4+ and will release a new version shortly.  Has anyone
found any reason to believe that this is necessary for pcre, nbase, or
nsock?  I don't want to add it where it doesn't help, so I have left
those alone for now.  The patch is below.

Which leaves the question, is it a core libpcap issue, or just your
modded version? (You're still modding it right? Or am I confusing this
with another project...)

I'm guessing that it is a core libpcap issue, as my modifications are
pretty small (they are described in the libpcap/NMAP_MODIFICATIONS
file).

Cheers,
-F

--- configure.ac        (revision 2864)
+++ configure.ac        (working copy)
@@ -741,6 +741,39 @@
 
 AC_LBL_UNALIGNED_ACCESS
 
+pcap_gcc_major_version=0
+AC_MSG_CHECKING([whether the compiler is gcc 4 or greater])
+if test x"$GCC" = xno; then
+  AC_MSG_RESULT([no])
+else
+  # new major versions must be added here
+  case `$CC --version | sed -e 's,\..*,.,' -e q` in
+    *4.)
+      pcap_gcc_major_version=4
+      ;;
+    *3.)
+      pcap_gcc_major_version=3
+      ;;
+    *2.)
+      pcap_gcc_major_version=2
+      ;;
+    *1.)
+      pcap_gcc_major_version=1
+      ;;
+  esac
+  if test "$pcap_gcc_major_version" -ge 4; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_RESULT([no - $pcap_gcc_major_version ; $CC ; $GCC])
+  fi
+fi
+
+# Remember that all following tests will run with this CXXFLAGS by default
+if test "$pcap_gcc_major_version" -ge 4; then
+  V_CCOPT="$V_CCOPT -fno-strict-aliasing"
+fi
+
+
 #
 # Makefile.in includes rules to generate version.h, so we assume
 # that it will be generated if autoconf is used.


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


Current thread: