Coder Social home page Coder Social logo

Comments (6)

sunyab avatar sunyab commented on July 17, 2024

One obstacle to the shared library builds could be the need to explicitly export public API on Windows.

from materialx.

jstone-lucasfilm avatar jstone-lucasfilm commented on July 17, 2024

@sunyab Thanks for this detailed report! The first question that comes to my mind is: which global variable in the MaterialX library has external linkage? As a rule, we've aimed to declare all global variables as static or within anonymous namespaces (which should have the effect of giving them internal linkage in C++11). Do you happen to have access to the name of the global variable that is being destructed twice in your example?

from materialx.

jstone-lucasfilm avatar jstone-lucasfilm commented on July 17, 2024

One possibility is that it's one of the two CreatorMap objects, which are declared as private static members of the Element and Value classes. If that's the case, then we could move these two variables to anonymous namespaces within Element.cpp and Value.cpp, which would give them internal linkage. Let us know, though, what variables seem to be triggering the crash in your example, and we'll proceed from there.

from materialx.

sunyab avatar sunyab commented on July 17, 2024

In the repro case I posted I was unfortunately not able to figure out which string(s) were triggering this, but valgrind did report invalid accesses to MaterialX::ElementRegistry and MaterialX::ValueRegistry, which sounds like they could be the private static variables you mentioned. In addition, valgrind reported errors in the static destructor for Traversal.cpp and XmlIo.cpp. Here's the full valgrind report in case its useful: valgrind.txt

I also ran valgrind on an internal test case and it appeared MaterialX::UnitDef::UNITTYPE_ATTRIBUTE was one of the strings that valgrind flagged with an invalid free.

from materialx.

jstone-lucasfilm avatar jstone-lucasfilm commented on July 17, 2024

Initial support for shared libraries on Linux and MacOS has been added in #487. Let us know if this addresses the issue you're running into.

from materialx.

jstone-lucasfilm avatar jstone-lucasfilm commented on July 17, 2024

@sunyab I'll close this issue out for now, and let us know if additional shared library functionality is needed in the future.

from materialx.

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.