Closed detrumi closed 9 years ago
The first uninitialized-warning in your valgrind-log seems to originate from this line not filling the status
variable. The next problem is that the loglen
is not initialized here.
Can you manually init these two variables to 0?
Maybe libepoxy
is failing hard because otherwise your glGetShaderiv
should either crash or set the variable, not just do nothing apparently.
Initializing status
and loglen
to 0 didn't change the crash, but changed the valgrind error:
==8136== Invalid read of size 1
==8136== at 0x4C2E0E2: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8136== by 0x7F0E7C8: std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==8136== by 0x5C00F9: openage::log::MessageBuilder& openage::log::MessageBuilder::operator<< <char*>(char* const&) (message.h:112)
==8136== by 0x61D841: openage::log::MessageBuilder& openage::log::MessageBuilder::operator<< <char []>(std::unique_ptr<char [], std::default_delete<char []> > const&) (message.h:134)
==8136== by 0x61D71F: openage::shader::Shader::Shader(unsigned int, char const*) (shader.cpp:55)
==8136== by 0x5C13C1: openage::GameMain::GameMain(openage::Engine*) (game_main.cpp:172)
==8136== by 0x5C0B5A: openage::run_game(openage::Arguments*) (game_main.cpp:97)
==8136== by 0x5BF2DA: main (main.cpp:61)
==8136== Address 0x10de8fc0 is 0 bytes after a block of size 0 alloc'd
==8136== at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8136== by 0x61D7F2: std::_MakeUniq<char []>::__array std::make_unique<char []>(unsigned long) (in /home/wilco/p/openage/.bin/clang-debug-O1/cpp/openage)
==8136== by 0x61D68C: openage::shader::Shader::Shader(unsigned int, char const*) (shader.cpp:51)
==8136== by 0x5C13C1: openage::GameMain::GameMain(openage::Engine*) (game_main.cpp:172)
==8136== by 0x5C0B5A: openage::run_game(openage::Arguments*) (game_main.cpp:97)
==8136== by 0x5BF2DA: main (main.cpp:61)
Now the log message seems to have length 0 (-> doesn't even contain a \0-byte) and the logger still wants to append the message i think. This is why it's an invalid read. Damnit why isn't the correct value returned by the gl functions?
I've updated my NVIDIA driver to version 346 (from 331), but this had no effect on the error.
The status
variable indeed isn't being assigned to. status
gets the value 32767 when I try to print it.
The documentation mentions that the params
argument of glGetShaderiv
(in this case status
) isn't changed when an error is generated. I'm not sure how to get such an error, though.
This is an issue I had using a nvidia driver, the workaround involved compiling the latest version of libepoxy from source and removing the older apt-get version.
When trying to run the game, I get the following error:
What's strange is that the infolog variable at this line is empty.
I'm running a normal nvidia GPU, so that shouldn't be a problem. The following valgrind error might be related, but I'm not sure. I pasted part of the valgrind output here.