|
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-2015 Los Alamos National Security, LLC. |
@@ -252,6 +252,34 @@ opal_err2str(int errnum, const char **errmsg) |
252 | 252 | } |
253 | 253 |
|
254 | 254 |
|
| 255 | +int opal_init_psm(void) |
| 256 | +{ |
| 257 | + /* Very early in the init sequence -- before *ANY* MCA components |
| 258 | + are opened -- we need to disable some behavior from the PSM and |
| 259 | + PSM2 libraries (by default): at least some old versions of |
| 260 | + these libraries hijack signal handlers during their library |
| 261 | + constructors and then do not un-hijack them when the libraries |
| 262 | + are unloaded. |
| 263 | +
|
| 264 | + It is a bit of an abstraction break that we have to put |
| 265 | + vendor/transport-specific code in the OPAL core, but we're |
| 266 | + out of options, unfortunately. |
| 267 | +
|
| 268 | + NOTE: We only disable this behavior if the corresponding |
| 269 | + environment variables are not already set (i.e., if the |
| 270 | + user/environment has indicated a preference for this behavior, |
| 271 | + we won't override it). */ |
| 272 | + if (NULL == getenv("IPATH_NO_BACKTRACE")) { |
| 273 | + opal_setenv("IPATH_NO_BACKTRACE", "1", true, &environ); |
| 274 | + } |
| 275 | + if (NULL == getenv("HFI_NO_BACKTRACE")) { |
| 276 | + opal_setenv("HFI_NO_BACKTRACE", "1", true, &environ); |
| 277 | + } |
| 278 | + |
| 279 | + return OPAL_SUCCESS; |
| 280 | +} |
| 281 | + |
| 282 | + |
255 | 283 | int |
256 | 284 | opal_init_util(int* pargc, char*** pargv) |
257 | 285 | { |
@@ -315,6 +343,10 @@ opal_init_util(int* pargc, char*** pargv) |
315 | 343 | goto return_error; |
316 | 344 | } |
317 | 345 |
|
| 346 | + // Disable PSM signal hijacking (see comment in function for more |
| 347 | + // details) |
| 348 | + opal_init_psm(); |
| 349 | + |
318 | 350 | /* Setup the parameter system */ |
319 | 351 | if (OPAL_SUCCESS != (ret = mca_base_var_init())) { |
320 | 352 | error = "mca_base_var_init"; |
|
0 commit comments