The function
glsl_compile_entry_point(GSG *gsg, Shader::ShaderType type)
contains the line
const char* text = _shader->get_text(type).c_str();
which is bad since get_text() returns a temporary string so text will point to deallocated memory.
The solution is to do:
const std::string str = _shader->get_text(type);
const char* text = str.c_str();