|
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. |
@@ -265,6 +265,31 @@ opal_err2str(int errnum, const char **errmsg) |
265 | 265 | } |
266 | 266 |
|
267 | 267 |
|
| 268 | +int opal_init_psm(void) |
| 269 | +{ |
| 270 | + /* Very early in the init sequence -- before *ANY* MCA components |
| 271 | + are opened -- we need to disable bad behavior from the PSM and |
| 272 | + PSM2 libraries: at least some old versions of these libraries |
| 273 | + hijack signal handlers during their library constructors and |
| 274 | + then do not un-hijack them when the libraries are unloaded. |
| 275 | +
|
| 276 | + It is a bit of an abstraction break that we have to put |
| 277 | + vendor/transport-specific code in the OPAL core, but we're |
| 278 | + out of options, unfortunately. |
| 279 | +
|
| 280 | + NOTE: We only disable this behavior if the corresponding |
| 281 | + environment variables are not already set (i.e., if the |
| 282 | + user/environment has indicated a preference for this behavior, |
| 283 | + we won't override it). */ |
| 284 | + if (NULL == getenv("IPATH_NO_BACKTRACE")) { |
| 285 | + opal_setenv("IPATH_NO_BACKTRACE", "1", true, &environ); |
| 286 | + } |
| 287 | + if (NULL == getenv("HFI_NO_BACKTRACE")) { |
| 288 | + opal_setenv("HFI_NO_BACKTRACE", "1", true, &environ); |
| 289 | + } |
| 290 | +} |
| 291 | + |
| 292 | + |
268 | 293 | int |
269 | 294 | opal_init_util(int* pargc, char*** pargv) |
270 | 295 | { |
@@ -328,6 +353,10 @@ opal_init_util(int* pargc, char*** pargv) |
328 | 353 | goto return_error; |
329 | 354 | } |
330 | 355 |
|
| 356 | + // Disable PSM signal hijacking (see comment in function for more |
| 357 | + // details) |
| 358 | + opal_init_psm(); |
| 359 | + |
331 | 360 | /* Setup the parameter system */ |
332 | 361 | if (OPAL_SUCCESS != (ret = mca_base_var_init())) { |
333 | 362 | error = "mca_base_var_init"; |
|
0 commit comments