This is looking like a case of the code being miscompiled under optimisation. To reproduce, build mediascanner2 using the "RelWithDebInfo" build type and then run:
./test/test_dbus --gtest_filter=*filter_codec
The test program segfaults when calling Variant::as<std::string>() on a variant that should have been initialised by reading out of a Message::Reader.
When compiling with the "Debug" build type, the test program completes without error.
I can probably solve the immediate problem in mediascanner2 by disabling optimisation for the affected file.
This is looking like a case of the code being miscompiled under optimisation. To reproduce, build mediascanner2 using the "RelWithDebInfo" build type and then run:
./test/ test_dbus --gtest_ filter= *filter_ codec
The test program segfaults when calling Variant: :as<std: :string> () on a variant that should have been initialised by reading out of a Message::Reader.
When compiling with the "Debug" build type, the test program completes without error.
I can probably solve the immediate problem in mediascanner2 by disabling optimisation for the affected file.