IPerf may fail to run on certain versions of Solaris exiting with 'pthread_create failed' errors

Article: 100001891
Last Published: 2022-02-16
Ratings: 0 0
Product(s): InfoScale & Storage Foundation

Problem

IPerf may fail to run on certain versions of Solaris exiting with 'pthread_create failed' errors

Solution

Issue:

Veritas often recommends use of the IPerf network testing tool when troubleshooting network related issues with our products. It has been found, however, that certain versions of IPerf can fail to run after installation complaining of 'pthread_create failed' errors. For example:

root@pnd1# /usr/local/bin/iperf -s
pthread_create failed
pthread_create failed


The reason for this is due to IPerf being compiled without the '-lpthread' stanza meaning that it does not correctly link to the libpthread library and as such can suffer problems when creating POSIX threads.

Workaround:

To fix this issue theIPerf binary should be recompiled with the libpthread library correctly linked after which the binary will operate as expected. This commonly requires modification of Makefile files to include the '-lpthread' stanza where required.

For example, when using the IPerf source code downloaded from oracle site,we need to add the -lpthread and -lrt stanzas to allow compilation to complete normally (-lrt is required for symbol resolution in the real time libraries).This involves modification to the following file:

~/src/Makefile:

  195  iperf_LDFLAGS=  -O2  -D_REENTRANT-pthread  -DHAVE_CONFIG_H

to:

 195  iperf_LDFLAGS =  -O2  -D_REENTRANT -lpthread -lrt-DHAVE_CONFIG_H

Once done compilation completes as normal and the resulting IPerf binary does not display issues with thread creation:

root@pnd1# make 2>&1 >/dev/null
root@pnd1# ./src/iperf-s

------------------------------------------------------------
Serverlistening on TCP port 5001
TCP window size: 48.0 KByte(default)
------------------------------------------------------------

 
 

 

Was this content helpful?