Giter Club home page Giter Club logo

Comments (10)

danhealy avatar danhealy commented on August 30, 2024

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?

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

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?

from rrd-ffi.

danhealy avatar danhealy commented on August 30, 2024

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.

from rrd-ffi.

danhealy avatar danhealy commented on August 30, 2024

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.

from rrd-ffi.

neilljordan avatar neilljordan commented on August 30, 2024

I'm encountering the same segfault in get_array_of_string. Did you find a resolution for this issue?

from rrd-ffi.

danhealy avatar danhealy commented on August 30, 2024

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

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

Sorry guys, I didn't have enough time to look into this issue

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

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);

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

Hi Guys, I just implemented the fetch using rrd_fetch_r. Could you checkout from the master and test if the issue continues?

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

Well, I will close this issue. If needed please open a new one.

from rrd-ffi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.