From karl.forner at gmail.com  Mon Dec 31 19:08:17 2012
From: karl.forner at gmail.com (Karl Forner)
Date: Mon, 31 Dec 2012 19:08:17 +0100
Subject: [Rd] weird bug with parallel, RSQlite and tcltk
Message-ID: <CAMd4_Ac0+CgORVFfhFAXTttAza1iG1aagZ08j_E-U-rYZspLXg@mail.gmail.com>

Hello,

I spent a lot of a time on a weird bug, and I just managed to narrow it down.

In parallel code (here with parallel::mclappy, but I got it
doMC/multicore too), if the library(tcltk) is loaded, R hangs when
trying to open a DB connection.
I got the same behaviour on two different computers, one dual-core,
and one 2 xeon quad-core.

Here's the code:

library(parallel)
library(RSQLite)
library(tcltk)
#unloadNamespace("tcltk")

res <- mclapply(1:2, function(x) {
	db <- DBI::dbConnect("SQLite", ":memory:")
}, mc.cores=2)
print("Done")	

When I execute it (R --vanilla  < test_parallel_db.R), it hangs
forever, and I have to type several times CTRL+C to interrupt it. I
then get this message:

Warning messages:
1: In selectChildren(ac, 1) : error 'Interrupted system call' in select
2: In selectChildren(ac, 1) : error 'Interrupted system call' in select

Then, just remove library(tcltk), or uncomment
unloadNamespace("tcltk"), and it works fine again.

I guess there's a bug somewhere, but where exactly ?

Best,

Karl Forner

Further info:


R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)

ubuntu 12.04 and 12.10

ubuntu package tk8.5



[Rd] weird bug with parallel, RSQlite and tcltk
Karl Forner