Coder Social home page Coder Social logo

Comments (5)

pohly avatar pohly commented on September 26, 2024

m_wildcardValue was just the tip of the iceberg. Several other global instances had similar issues. Some of that code is also used in cynarad, so this issue might go beyond just testing.

For the fixes that were good enough for me at the moment, see:
https://github.com/pohly/meta-intel-iot-security/blob/cynara-tests/meta-security-framework/recipes-security/cynara/cynara/PolicyKeyFeature-avoid-complex-global-constants.patch
https://github.com/pohly/meta-intel-iot-security/blob/cynara-tests/meta-security-framework/recipes-security/cynara/cynara/globals-avoid-copying-other-globals.patch

However, you might want to do a more thorough code review and avoid this kind of issue completely. I only fixed the cases that really caused segfaults.

from cynara.

JacquesBurac avatar JacquesBurac commented on September 26, 2024

Thanks for finding these issues and for the patches. Yes, we need to get rid of direct std::string -> std::string dependencies. First patch looks good to me.
The second patch if I understand static variable initialization correctly makes it less likely to fail, because there are less variables that we depend on. However, we still rely on variable being referenced to be initialized first (references can point to variable that have not yet been initialized).
I think that all std::string constants should depend on:
a) C string literals/variables
or
b) wrapper functions like in the first patch

from cynara.

pohly avatar pohly commented on September 26, 2024

The second patch if I understand static variable initialization correctly makes it less likely to fail,
because there are less variables that we depend on. However, we still rely on variable being
referenced to be initialized first (references can point to variable that have not yet been initialized).

Correct. It's just mitigating the problem without solving it properly.

I agree with the proposed solution, but won't have time to implement it, I'm afraid.

from cynara.

JacquesBurac avatar JacquesBurac commented on September 26, 2024

Ok, I understand. Right now I'm working on some urgent task, but I should finish soon and I'll be able to take care of it.

from cynara.

JacquesBurac avatar JacquesBurac commented on September 26, 2024

I've pushed your first patch to gerrit:
https://review.tizen.org/gerrit/#/c/41353

And also made some more changes:
https://review.tizen.org/gerrit/#/c/41354

from cynara.

Related Issues (7)

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.