problems with connections when applied in tryCatch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problems with connections when applied in tryCatch

Joris FA Meys
Recently on stackoverflow following problem came up :

http://stackoverflow.com/questions/7103429/all-the-connections-are-in-use-execution-halted/7108799#7108799

A reproducible example: When trying

replicate(200,tryCatch(read.table("this.is.no.file"),
          warning=function(w){print(showConnections());print("warning")}))

No connections are shown, but after a number of calls, suddenly the message

Error in file(file, "rt") : all connections are in use

pops up. Trying to get them deleted with closeAllConnections() causes
R to crash on Windows 7. Another user reported a segfault. (see the
link to stackoverflow)

Although I initially thought on.exit() was somehow skipped, that's not
the case. In fact, the connection couldn't be opened, so it can't be
closed either. I have no clue as to why this goes wrong, but it shows
there's something odd happening with the connections. For the record,
I am aware that the use of the warning handler in that call is rather
peculiar. But even then, R shouldn't crash.

Cheers
Joris


--
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

tel : +32 9 264 59 87
[hidden email]
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with connections when applied in tryCatch

Uwe Ligges-3


On 18.08.2011 17:53, Joris Meys wrote:

> Recently on stackoverflow following problem came up :
>
> http://stackoverflow.com/questions/7103429/all-the-connections-are-in-use-execution-halted/7108799#7108799
>
> A reproducible example: When trying
>
> replicate(200,tryCatch(read.table("this.is.no.file"),
>            warning=function(w){print(showConnections());print("warning")}))
>
> No connections are shown, but after a number of calls, suddenly the message
>
> Error in file(file, "rt") : all connections are in use
>
> pops up. Trying to get them deleted with closeAllConnections() causes
> R to crash on Windows 7. Another user reported a segfault. (see the
> link to stackoverflow)
>
> Although I initially thought on.exit() was somehow skipped, that's not
> the case. In fact, the connection couldn't be opened, so it can't be
> closed either. I have no clue as to why this goes wrong, but it shows
> there's something odd happening with the connections. For the record,
> I am aware that the use of the warning handler in that call is rather
> peculiar. But even then, R shouldn't crash.

Right, and not trivial to track down! At least I can reproduce it with
R-devel under Windows Server 2008. Can you please file a bug report so
it won't be forgotten.

Thanks,
Uwe Ligges



> Cheers
> Joris
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with connections when applied in tryCatch

Joris FA Meys
Bug committed with number 14660
Cheers
Joris

2011/8/22 Uwe Ligges <[hidden email]>:

>
>
> On 18.08.2011 17:53, Joris Meys wrote:
>>
>> Recently on stackoverflow following problem came up :
>>
>>
>> http://stackoverflow.com/questions/7103429/all-the-connections-are-in-use-execution-halted/7108799#7108799
>>
>> A reproducible example: When trying
>>
>> replicate(200,tryCatch(read.table("this.is.no.file"),
>>           warning=function(w){print(showConnections());print("warning")}))
>>
>> No connections are shown, but after a number of calls, suddenly the
>> message
>>
>> Error in file(file, "rt") : all connections are in use
>>
>> pops up. Trying to get them deleted with closeAllConnections() causes
>> R to crash on Windows 7. Another user reported a segfault. (see the
>> link to stackoverflow)
>>
>> Although I initially thought on.exit() was somehow skipped, that's not
>> the case. In fact, the connection couldn't be opened, so it can't be
>> closed either. I have no clue as to why this goes wrong, but it shows
>> there's something odd happening with the connections. For the record,
>> I am aware that the use of the warning handler in that call is rather
>> peculiar. But even then, R shouldn't crash.
>
> Right, and not trivial to track down! At least I can reproduce it with
> R-devel under Windows Server 2008. Can you please file a bug report so it
> won't be forgotten.
>
> Thanks,
> Uwe Ligges
>
>
>
>> Cheers
>> Joris
>>
>>
>



--
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

tel : +32 9 264 59 87
[hidden email]
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel