2008/7/17 laurent oget <[EMAIL PROTECTED]>:
>
>
> 2008/7/17 Laurent Gautier <[EMAIL PROTECTED]>:
>>
>> I am a bit confused.
>>
>> Do you have data frames created and bound to the same Python variable
>> names ?
>>
>> Or do you have a set of vectors, and subsets put together in different
>> data frame ?
>> (if you are iterating and building a lot of linear model, you might be
>> trying to do some
>> sort of variable/model selection).
>
> More precisely:
>
> I build  a set of vector and a dictionary with string as keys and those
> vectors as values. I build an R dataframe object from this dictionary and
> run a series of regression using this dataframe.  I do this repeatedly and
> some variable names are shared between dataframes, someting like
>
> -create dataframe with d=r.as_data_frame(dict(x1=...,x2=..,x3=,x4=..,x5...)
>                                call r.lm('x1~x2+x3',d) and a whole lot of
> other
>
> -create new dataframe          d==r.as_data_frame(dict(x3=..,....))    where
> some of the variable names were in the previous dataframe
>
> i do not really understand either why this occurs randomly. I suspect a race
> condition between the garbage collector and the computing process ( do you
> know how the R gc is  triggered?).

It might not really be a race condition, but more an overzealous
garbage collection.
R does not have reference counting, and objects without an associated
symbol/name
in the R space can be flagged as "protected" from garbage collection.
The removal of
the protection is recursive, I think, and this might be causing
trouble in a situation where
- your data.frame 'd' above is built from R-anonymous objects (e.g 'x1
= r.rnorm(10)')
- 'd' is scheduled for garbage collection in Python (end of code block,
re-assignment, explicit call to "del")
- the R-anonymous objects used for 'd' are used again (since the
recursive release will
have them exposed for garbage collection).

I start being able to trigger reproducibly crashes this way with rpy2.

> Most crashes seem to occur during the
> construction of the dataframe.
>
> I will try to get a reproducible scenario which triggers the crash.
>
> Thanks,
>
> Laurent
>
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to