RcppParallel icon indicating copy to clipboard operation
RcppParallel copied to clipboard

Intel segfault when detecting number of threads

Open asardaes opened this issue 1 year ago • 2 comments

Hello, I noticed that my package currently has additional issues on CRAN for the Intel checks. There's a segfault when calling defaultNumThreads:

 *** caught segfault ***
address 0x7d41257b2144, cause 'memory not mapped'

Traceback:
 1: RcppParallel::defaultNumThreads()
 2: Sys.getenv("RCPP_PARALLEL_NUM_THREADS", RcppParallel::defaultNumThreads())
 3: get_nthreads()
 4: DBA(CharTraj[5:1], CharTraj[[1]], trace = TRUE)
An irrecoverable exception occurred. R is aborting now ...

Is this a known issue?

asardaes avatar Jun 23 '24 11:06 asardaes

Thanks for the bug report -- I wonder if there are any other CRAN packages affected; that is, I wonder if the issue is somehow unique to your package, or if any package trying to use defaultNumThreads() is affected.

kevinushey avatar Jul 02 '24 04:07 kevinushey

The only other example I found is detrendr, but that package is letting tests run in parallel, so it seems the main traces get lost, so I'm not 100% sure where it's crashing.

asardaes avatar Jul 02 '24 23:07 asardaes

I should have looked more closely at the parent directory of the server with the results. These 2 packages show the same problem:

  • https://www.stats.ox.ac.uk/pub/bdr/Intel/DatabionicSwarm.out
  • https://www.stats.ox.ac.uk/pub/bdr/Intel/rubias.out

asardaes avatar Jul 11 '24 21:07 asardaes

Thanks -- I think we can conclude the issue needs to be fixed in RcppParallel (or in Intel's compiler). I'll try to investigate further; let me know if CRAN is giving you a hard time on these issues and I can try to prioritize.

kevinushey avatar Jul 15 '24 03:07 kevinushey

Thanks, I haven't received anything from CRAN so far, in fact I'm not sure if their Intel checks are mostly testing the waters to see what's broken (the installation log even has warnings about deprecations in std code). I do plan to submit an update soon, so I can let you know if they already consider that a blocker or not.

asardaes avatar Jul 15 '24 08:07 asardaes

My update was allowed to go through, but CRAN did ask me to check that this issue is not forgotten, so I imagine they will eventually support the Intel compiler more officially.

asardaes avatar Jul 29 '24 21:07 asardaes

I don't know if CRAN changed something or the latest RcppParallel release fixed something related to this, but the issue appears to be gone.

asardaes avatar Sep 09 '24 21:09 asardaes