We narrowed down issue due to stale OpenSSH handles..
basically we create subprocess' inside our modules in different threads and each sub-process in turn creates a new ssh connection... so there could be multiple ssh handles to the same hosts..we were not properly cleaning up the ssh handles.. so when we exit we see SEGV..
cleaning up ssh handles seems to be resolve these to some extent.
is this expected with OpenSSH module?