Closed danhealy closed 12 years ago
I think I figured this one out. If I wrap the call to .fetch around a mutex, it works fine. Is this obvious and I just missed it, or should it be documented?
Sorry for the delay. A mutex shouldn't be needed, supposing rrd_fetch function from librrd is thread safe. I will check librrd for a thread safe function, I know some functions have both thread-safe ad non thread-safe versions. You said it was not happening in one specific step, but can you check if it has something to do with get_array_of_string or from_string methods? Also, which version of ffi are you using?
It breaks on the same line every time without the mutex, wrapper.rb line 121. Using ffi 1.0.7. Thanks for looking into it.
I was referring to the order of RRDs accessed when I mentioned it didn't happen at any specific step. The segfault is in the same place.
I'm encountering the same segfault in get_array_of_string. Did you find a resolution for this issue?
Looks like there haven't been any code changes since I opened this issue. My code works by wrapping the call to .fetch with a mutex: http://www.ruby-doc.org/core/classes/Mutex.html
Sorry guys, I didn't have enough time to look into this issue
As I could see. There seems to be a thread safe version of the function. I will code based on it. The function is the following: int rrd_fetch_r ( const char _filename, const char cf, time_t start, time_t end, unsigned long step, unsigned long ds_cnt, char __ds_namv, rrd_value_t *_data);
Hi Guys, I just implemented the fetch using rrd_fetch_r. Could you checkout from the master and test if the issue continues?
Well, I will close this issue. If needed please open a new one.
I am getting this segfault pretty often, mac os x running rrdtool 1.4.4, rvm'd ruby 1.9.2-p136. The code that is executing is a series of consecutive rrd.fetch instructions. It is fairly reproducible (it happens almost every time I try a few things), but I haven't found a specific sequence that causes it. In particular, none of the steps on their own cause the segfault, it just happens.