Git Product home page Git Product logo

Comments (2)

RGerzaguet avatar RGerzaguet commented on August 23, 2024

Thanks for the feedback,
This is true than unsafe_load can lead to un-protected memory but AFAIK it is prevented by the use of the Ref{} in the structure as it stores the result of the unsafe_load. So It should not lead to seg fault that way (even the approach here is unsafe :)).
Did you encounter any problem of GC-ed variables with UHDBindings ?

from uhdbindings.jl.

mgw93 avatar mgw93 commented on August 23, 2024

I have not experienced any actual issues.
However, the nature of memory safety issues is that they often only manifest themselves in rare circumstances.
Most of the time (or possibly always until someone changes the implementation) the garbage collector does not get in the way.
But unless it’s guaranteed that it won’t happen, it’s still an issue.

I’m still new to Julia and may therefore be misunderstanding the guarantees that are provided by the language,
but the way I see it, if the garbage collector was triggered on line 126 of Rx.jl, it would be allowed to collect cpu_format, otw_format, args, and channels, all of which need to still be alive for the call to uhd_usrp_get_rx_stream on line 130.
The fact that the variables are still in scope does not help, as the compiler can determine that they are not used (directly) anymore.

from uhdbindings.jl.

Related Issues (6)

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.