[ewg] dapltest segfault after calling inet_ntoa

Allen Hubbe ahubbe at iol.unh.edu
Wed Jan 16 12:54:10 PST 2008


Here is a typical command I use to run dapltest:
  dapltest -T T -s 10.1.1.202 -D OpenIB-cma \
     -i 100 -t 1 -w 1 -R BE client SR 256

Starting with some of the OFED-1.3 releases, this gives me a segmentation 
fault.  I do not get a segmentation fault on OFED 1.2.5.5.

The offending lines of code seem to be at cmd/dapl_netaddr.c:136

DT_Mdep_printf ("Server Net Address: %s\n",
 	inet_ntoa(((struct sockaddr_in *)target->ai_addr)->sin_addr));

That section of code in OFED 1.2.5.5 is

DT_Mdep_printf ("Server Net Address: %d.%d.%d.%d\n",
 	(rval >>  0) & 0xff,
 	(rval >>  8) & 0xff,
 	(rval >> 16) & 0xff,
 	(rval >> 24) & 0xff);

The newer code seems to be written correctly.  But, the address returned 
by inet_ntoa is out of bounds of the running program.  Since that address 
should point to a static buffer, is it possible that a library isn't 
loading properly at run time?

This issue is present on several machines I am using.  There are two or 
three versions of OFED 1.3 in use, including rc2.  Can anyone else confirm 
this?  Should I submit a bug report?

----
Allen Hubbe <ahubbe at iol.unh.edu>
Technician - UNH-IOL iWARP Consortium



More information about the ewg mailing list