On Wed, 15 Apr 2009 23:32:45 +0200
Daniel Roethlisberger <daniel () roe ch> wrote:
Are you sure this isn't actually a segmentation fault in zlib's
adler32(), and gdb is messing up the namespace, using the debug
information and/or source code for adler32() in nbase?
It isn't GDB, it seems the linker resolved the symbol wrong (your
hypothesis below is correct).
Nbase adler32() is not called from anywhere at the moment in
trunk, and I'd be rather surprised if your rtld would somehow
cause deflate() in libz.so.1 to call nbase adler32() instead of
zlib's internal adler32().
Looks like that is what is happening.
ssl3_do_uncompress () from /usr/lib/libssl.so.0.9.8 #5
0x00007f230b158470 in ssl3_read_bytes ()
The len field looks like the high dword of a 64 bit pointer,
probably pointing to the heap. This could equally be either gdb
misinterpreting things based on the wrong source code, or code
compiled against the signature of zlib adler32() actually calling
Yeah, it is calling the nbase adler32 which I'm sure has a different
set of parameters/API than yours.
Unless someone can reproduce these segfaults, I don't think I can
fix this without some debugging / verification help from you.
Can you add an assert(0) on the first line of nbase adler32() to
make sure that our adler32() is not called when your segfaults
$ sudo ./nmap -A -v -p 465 -T5 -PN -n -d <target>
Starting Nmap 4.85BETA7 ( http://nmap.org ) at 2009-04-15 21:47 UTC
--------------- Timing report ---------------
hostgroups: min 1, max 100000
rtt-timeouts: init 250, min 50, max 300
max-scan-delay: TCP 5, UDP 1000
parallelism: min 0, max 0
max-retries: 2, host-timeout: 900000
min-rate: 0, max-rate: 0
NSE: Loaded 27 scripts for scanning.
Initiating SYN Stealth Scan at 21:47
Completed SYN Stealth Scan at 21:47, 0.01s elapsed (1 total ports)
Overall sending rates: 190.73 packets / s, 8392.14 bytes / s.
Initiating Service scan at 21:47
Scanning 1 service on 184.108.40.206
nmap: nbase_misc.c:469: adler32: Assertion `0' failed.
Aborted (core dumped)
So the question is, why did the linker resolve to your adler32()
routine rather than zlib? Is there a way we can fix this across all
compilers/platforms or should we just rename your adler32() routine to