From: Sean Hefty Date: Fri, 25 May 2012 19:42:12 +0000 (-0700) Subject: rs-preload: Handle recursive socket() calls X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=60652438ace67e0537f4936a6e5142e1907e11ec;p=~shefty%2Flibrdmacm.git rs-preload: Handle recursive socket() calls When ACM support is enabled in the librdmacm, it will attempt to establish a socket connection to the ACM daemon. When the rsocket preload library is in use, this can result in a recursive call to socket() that results in the library hanging. The resulting call stack is: socket() -> rsocket() -> rdma_create_id() -> ucma_init() -> socket() -> rsocket() -> rdma_create_id() -> ucma_init() The second call to ucma_init() hangs because initialization is still pending. Fix this by checking for recursive calls to socket() in the preload library. When detected, call the real socket() call instead of directing the call back into rsockets(). Since rsockets is a part of the librdmacm, it can call rsockets directly if it wants to use rsockets instead of standard sockets. This problem and the cause was reported by Chet Murthy Signed-off-by: Sean Hefty ---