|
10 | 10 | * University of Stuttgart. All rights reserved. |
11 | 11 | * Copyright (c) 2004-2005 The Regents of the University of California. |
12 | 12 | * All rights reserved. |
13 | | - * Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved. |
| 13 | + * Copyright (c) 2007-2016 Cisco Systems, Inc. All rights reserved. |
14 | 14 | * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. |
15 | 15 | * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. |
16 | 16 | * Copyright (c) 2010-2013 Los Alamos National Security, LLC. |
@@ -246,6 +246,34 @@ opal_err2str(int errnum, const char **errmsg) |
246 | 246 | } |
247 | 247 |
|
248 | 248 |
|
| 249 | +int opal_init_psm(void) |
| 250 | +{ |
| 251 | + /* Very early in the init sequence -- before *ANY* MCA components |
| 252 | + are opened -- we need to disable some behavior from the PSM and |
| 253 | + PSM2 libraries (by default): at least some old versions of |
| 254 | + these libraries hijack signal handlers during their library |
| 255 | + constructors and then do not un-hijack them when the libraries |
| 256 | + are unloaded. |
| 257 | +
|
| 258 | + It is a bit of an abstraction break that we have to put |
| 259 | + vendor/transport-specific code in the OPAL core, but we're |
| 260 | + out of options, unfortunately. |
| 261 | +
|
| 262 | + NOTE: We only disable this behavior if the corresponding |
| 263 | + environment variables are not already set (i.e., if the |
| 264 | + user/environment has indicated a preference for this behavior, |
| 265 | + we won't override it). */ |
| 266 | + if (NULL == getenv("IPATH_NO_BACKTRACE")) { |
| 267 | + opal_setenv("IPATH_NO_BACKTRACE", "1", true, &environ); |
| 268 | + } |
| 269 | + if (NULL == getenv("HFI_NO_BACKTRACE")) { |
| 270 | + opal_setenv("HFI_NO_BACKTRACE", "1", true, &environ); |
| 271 | + } |
| 272 | + |
| 273 | + return OPAL_SUCCESS; |
| 274 | +} |
| 275 | + |
| 276 | + |
249 | 277 | int |
250 | 278 | opal_init_util(int* pargc, char*** pargv) |
251 | 279 | { |
@@ -301,6 +329,10 @@ opal_init_util(int* pargc, char*** pargv) |
301 | 329 | goto return_error; |
302 | 330 | } |
303 | 331 |
|
| 332 | + // Disable PSM signal hijacking (see comment in function for more |
| 333 | + // details) |
| 334 | + opal_init_psm(); |
| 335 | + |
304 | 336 | /* Setup the parameter system */ |
305 | 337 | if (OPAL_SUCCESS != (ret = mca_base_param_init())) { |
306 | 338 | error = "mca_base_param_init"; |
|
0 commit comments