I've been having a lot of problems with intermittent crashes while  
using RPy under a rather old Python 2.4.2 install, with no Numeric  
support whatsoever.  This is all under Linux.

Here's an example of the code which causes a crash.  I'm loading an R  
file and want to verify that it only contains a single object and  
that I haven't seen those object names before.

_already_loaded_names = {}
def load_clab_from_rdata_file(filename):
     from rpy import r
     name = r.load(filename)
     if isinstance(name, list):
         raise TypeError("R model %r defines more than one object: %r" %
                         (filename, name))
     if name in _already_loaded_names:
         raise TypeError("%s from %r already loaded from %r" %
                         (name, filename, _already_loaded_names[name]))
     _already_loaded_names[name] = filename
     return r[name]["clab"]

There's nothing complex here.  When I try it out (the TEST_r_simple2  
directory contains the file 'rmodel.RData', which has two objects) I  
get this sort of error.

% ./drone_properties.py --smiles c1ccccc1O TEST_R_simple2 TEST_R_simple
Error when computing 'TEST_R_simple2' of 'c1ccccc1O'
Traceback (most recent call last):
   File "Properties.py", line 211, in resolve_named_properties
     props[name]
   File "Properties.py", line 101, in __getitem__
     handler(key, self)
   File "/ModelBase.py", line 138, in make_single_prediction
     self.make_prediction([dict])
   File "RModel.py", line 98, in make_prediction
     self.predict(cmpd)
   File "RModel.py", line 121, in predict
     self._predict = load_clab_from_rdata_file(
   File "RModel.py", line 59, in load_clab_from_rdata_file
     raise TypeError("R model %r defines more than one object: %r" %
TypeError: R model 'TEST_R_simple2/rmodel.RData' defines more than  
one object: ['a', 'b']

  *** caught segfault ***
address 0x34b100, cause 'memory not mapped'

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 1
Exception thread.error: 'release unlocked lock' in <class  
thread.error at 0xb63083bc> ignored

I can generate a core dump but it's in some completely unrelated  
shared library that's never given problems before.  There are some  
several dozen shared libraries in the system.

I'm not able to create a minimal test case.

I tried running it under valgrind's memtest but found nothing out of  
the ordinary.  The exception did occur, but valgrind reported nothing.

What's interesting is if I force all malloc'ed data to 0 then the  
problem disappeared

% valgrind --malloc-fill=00 --leak-check=yes ./drone_properties.py -- 
smiles c1ccccc1O TEST_R_simple2 TEST_R_simple

It didn't reappear if I used FF or 23, so I don't know if this is  
coincidence.

Looking through the archives I've found no mention of this problem.   
Any ideas?  Is my version of Python too old, with a since resolved  
bug?  Or is it there some nasty interaction between the Rpy thread  
and all of the system/popen/etc. calls I do elsewhere in the software?

How do I turn off R's override of the signal handlers so I can get a  
more normal behavior that something like valgrind can help me out with?

If I can't get this working, I think I saw a popen-based interface to  
calling R, which I would like to try out.  Does anyone know where it is?

Best regards,


                                Andrew
                                [EMAIL PROTECTED]



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to