Skip to content

Valgrind warnings in GL::Implementation::State #505

Description

@xqms

Hey, I just saw that a very simple application involving a single Texture2D gives warnings under valgrind during exit:

==973387== Conditional jump or move depends on uninitialised value(s)
==973387==    at 0x11FFA6: ~AbstractTexture (AbstractTexture.cpp:238)
==973387==    by 0x11FFA6: Magnum::GL::AbstractTexture::~AbstractTexture() (AbstractTexture.cpp:229)
==973387==    by 0x113F46: ~Texture (Texture.h:102)
==973387==    by 0x113F46: ~App (display_time.cpp:13)
==973387==    by 0x113F46: main (display_time.cpp:40)
==973387==  Uninitialised value was created by a heap allocation
==973387==    at 0x483C583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==973387==    by 0x170D7F: operator() (ArrayTuple.cpp:158)
==973387==    by 0x170D7F: Corrade::Containers::ArrayTuple::ArrayTuple<Corrade::Containers::ArrayTuple::ArrayTuple(Corrade::Containers::ArrayView<Corrade::Containers::ArrayTuple::Item const> const&)::{lambda(unsigned long, unsigned long)#1}>(Corrade::Containers::ArrayView<Corrade::Containers::ArrayTuple::Item const> const&, Corrade::Containers::ArrayTuple::ArrayTuple(Corrade::Containers::ArrayView<Corrade::Containers::ArrayTuple::Item const> const&)::{lambda(unsigned long, unsigned long)#1}) [clone .isra.0] (ArrayTuple.h:424)
==973387==    by 0x170DC8: ArrayTuple (ArrayTuple.cpp:159)
==973387==    by 0x170DC8: Corrade::Containers::ArrayTuple::ArrayTuple(std::initializer_list<Corrade::Containers::ArrayTuple::Item>) (ArrayTuple.cpp:163)
==973387==    by 0x13BB60: Magnum::GL::Implementation::State::allocate(Magnum::GL::Context&, std::ostream*) (State.cpp:115)
==973387==    by 0x135184: Magnum::GL::Context::tryCreate(Magnum::GL::Context::Configuration const&) (Context.cpp:974)
==973387==    by 0x11649A: tryCreate (GLContext.h:157)
==973387==    by 0x11649A: Magnum::Platform::GlfwApplication::tryCreate(Magnum::Platform::GlfwApplication::Configuration const&, Magnum::Platform::GlfwApplication::GLConfiguration const&) (GlfwApplication.cpp:574)
==973387==    by 0x116BC5: Magnum::Platform::GlfwApplication::tryCreate(Magnum::Platform::GlfwApplication::Configuration const&) (GlfwApplication.cpp:318)
==973387==    by 0x116C9C: Magnum::Platform::GlfwApplication::create(Magnum::Platform::GlfwApplication::Configuration const&) (GlfwApplication.cpp:127)
==973387==    by 0x117350: Magnum::Platform::GlfwApplication::GlfwApplication(Magnum::Platform::GlfwApplication::Arguments const&, Magnum::Platform::GlfwApplication::Configuration const&) (GlfwApplication.cpp:69)
==973387==    by 0x1173EF: Magnum::Platform::GlfwApplication::GlfwApplication(Magnum::Platform::GlfwApplication::Arguments const&) (GlfwApplication.cpp:66)
==973387==    by 0x1140F6: App::App(Magnum::Platform::GlfwApplication::Arguments const&) (display_time.cpp:24)
==973387==    by 0x113F25: main (display_time.cpp:40)

Source: https://gist.github.com/xqms/184ffe67e4ac28674183c6ce563c09d9

I tried digging into the GL::Implementation::State myself, but there's scary ArrayTuple stuff there :D But I guess something is going wrong with the ValueInit tag on the textureBinding array?

Maybe I'll have time to investigate further this evening ;)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions