Nmap Development mailing list archives

Re: Problems building with ASAN


From: Jacek Wielemborek <d33tah () gmail com>
Date: Sat, 30 Jul 2016 02:59:48 +0200

W dniu 30.07.2016 o 02:43, Jacek Wielemborek pisze:
Hello,

Tested under Fedora 23.

g++ -c -I./liblinear -I./liblua -I/usr/include/lua
-I./libdnet-stripped/include  -I./nbase -I./nsock/include
-DHAVE_CONFIG_H -DNMAP_NAME=\"Nmap\" -DNMAP_URL=\"https://nmap.org\";
-DNMAP_PLATFORM=\"x86_64-unknown-linux-gnu\"
-DNMAPDATADIR=\"/usr/local/share/nmap\" -D_FORTIFY_SOURCE=2
-fsanitize=address -Wall -fno-strict-aliasing   nse_bit.cc -o nse_bit.o
In file included from /usr/include/ctype.h:25:0,
                 from nse_binlib.cc:42:
/usr/include/features.h:328:4: warning: #warning _FORTIFY_SOURCE
requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^
In file included from /usr/include/stdio.h:27:0,
                 from ./liblua/lauxlib.h:13,
                 from nse_bit.cc:12:
/usr/include/features.h:328:4: warning: #warning _FORTIFY_SOURCE
requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^
In file included from ./nbase/nbase.h:591:0,
                 from nse_binlib.cc:44:
./nbase/nbase_ipv6.h:246:8: error: redefinition of ‘struct addrinfo’
 struct addrinfo {
        ^
In file included from ./nbase/nbase.h:200:0,
                 from nse_binlib.cc:44:
/usr/include/netdb.h:567:8: error: previous definition of ‘struct addrinfo’
 struct addrinfo
        ^

Cheers,
d33tah


I managed to move on a bit with CFLAGS="-fsanitize=address
-DHAVE_GETADDRINFO=1" CXXFLAGS="-fsanitize=address -DHAVE_GETADDRINFO"
LDFLAGS="-fsanitize=address" ./configure

I had a couple other errors that I had to sort out, such as lack of -ldl
when linking Nmap (required by Lua). Also:

$ ./nmap scanme.nmap.org

Starting Nmap 7.12SVN ( https://nmap.org ) at 2016-07-30 02:58 CEST
Unknown address family 10

QUITTING!

--system-dns helped here.

Cheers,
d33tah

Attachment: signature.asc
Description: OpenPGP digital signature

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

Current thread: