Skip to content
Prev 44782 / 63424 Next

weird bug with parallel, RSQlite and tcltk

Happy new year.
On Mon, Dec 31, 2012 at 12:08 PM, Karl Forner <karl.forner at gmail.com> wrote:
I believe this is the same problem discussed here:

https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15040

I am interested to know the long term implications of the discussion
going on here, but can I interject to ask the short term question:

With R-2.15.2, is there something I can do to defend myself before
calling mclapply? Suppose I don't intentionally use tcltk, but some
package I use has loaded it. Or somebody ran install.packages(). What
to do?

I thought this would work:

detach(package:tcltk, unload=TRUE)

I ran one test case where it seemed to work, but then started a
several new sessions and got a big crashes.

Example 1. detach(package:tcltk) without unload=TRUE hangs
Loading Tcl/Tk interface ... done
mclppl> ## No test:
mclppl> simplify2array(mclapply(rep(4, 5), rnorm))
           [,1]       [,2]       [,3]       [,4]        [,5]
[1,] -0.1499368 -0.7511576  0.7675234 -0.1324973 -0.01118655
[2,] -0.5989764  0.6605780 -0.9417879  0.2295157 -0.16750436
[3,]  1.4585402  0.2513995  1.6857897 -0.1200986  1.19094290
[4,] -0.1459071 -1.7570450  0.2968794  1.1964827  1.87066283

mclppl> # use the same random numbers for all values
mclppl> set.seed(1)

mclppl> simplify2array(mclapply(rep(4, 5), rnorm, mc.preschedule = FALSE,
mclppl+                 mc.set.seed = FALSE))

Example 2. detach with unload=TRUE dies
Loading Tcl/Tk interface ... done
called Tcl_FindHashEntry on deleted table
Aborted

Ouch. Back to the shell, completely unceremonious. Does it matter in
which order they are loaded?
Loading Tcl/Tk interface ... done
called Tcl_FindHashEntry on deleted table
Aborted

In the short term, It would really help if we just had a foolproof way
to close, kill, remove, delete, detach and otherwise block tcltk, its
functions, its anything!

pj

  
    
Message-ID: <CAErODj__FyUtTk8drY8TVdKGVuYqZ_WgF=7_p8cRbSnk6U5Taw@mail.gmail.com>
In-Reply-To: <CAMd4_Ac0+CgORVFfhFAXTttAza1iG1aagZ08j_E-U-rYZspLXg@mail.gmail.com>