[R-SIG-Mac] Problem with multicore/doMC/foreach combo on Leopard

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Jul 28 23:50:57 CEST 2009

Hi all,

I'm posting this here first because (i) this might be a problem  
specific to macs, and (ii) Simon is the maintainer of the multicore  

I'm using the doMC package to use the multicore library as a backend  
for the foreach library.

Every now and again  I'm getting mess-load of these errors when I run  
a new "multicore task" via:

foreach ( ... ) %dopar% {

That look like so:

=== Error ===

  *** caught segfault ***
address 0x1c86b7d80, cause 'memory not mapped'
The process has forked and you cannot use this CoreFoundation  
functionality safely. You MUST exec().
Break on  
() to debug.
The process has forked and you cannot use this CoreFoundation  
functionality safely. You MUST exec().
Break on  
() to debug.


I'm guessing it might be mac specific due to (i) reference to  
CoreFoundation, and (ii) this answer given by Scott Lahteine in this  

Which I'm pasting here:

This is caused by programs that use the fork() or daemon() function in  
combination with higher-level APIs. In Leopard you cannot use the  
CoreFoundation (CF...) APIs on the child side of a fork() without  
following it with an exec*() function. This has always been true, but  
Leopard is much more stingy about this kind of thing.

To solve this issue, uninstall all third-party drivers and system  
customizers, then reinstall them with the latest versions, and make  
sure those versions have been updated for Leopard. Any drivers and  
background software that use CF but haven't been updated for Leopard  
will continue to output these messages, even though they may function  

Does this suggest that the multicore package needs some updating for  
leapord, or am I barking up the wrong tree? I don't see (nor would  
have expected to see) any calls to CoreFoundation specific API's in  
the multicore::fork.c file, so I'm not sure what's up since neither  
doMC or foreach have any C code in them.

I'm running OS X.5.7 and 64-bit R 2.9.1. sessionInfo() is pasted below

I'll ask again in the main R-help if that's more appropriate.



 > sessionInfo()
R version 2.9.1 Patched (2009-06-28 r48863)


attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] doMC_1.1.1      multicore_0.1-3 foreach_1.2.1   codetools_0.2-2
[5] iterators_1.0.1

Steve Lianoglou
Graduate Student: Computational Systems Biology
   |  Memorial Sloan-Kettering Cancer Center
   |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

More information about the R-SIG-Mac mailing list