C++: problem when assigning a value to a string (Summary unavailable…)

  android-ndk, c++, cmake, java-native-interface

I use C++ with NDK/JNI/CMake in my Android project.

I have a struct like this:

struct AppSettings
    std::string scenedir;
    std::string outmesh;
    std::string dmname = "depth-L0";
    std::string image = "undistorted";
    std::string mask;
    std::string aabb;

Now, I want to use my struct and change the value of the string ‘dmname’ like this:

 AppSettings conf; // Line 1
 conf.dmname = "depth-L3"; // Line 2

Strangely, on Line 1, I see with the variables inspector that only the variable ‘dmname’ of my struct is written ‘Summary unavailable’ as you can see here:

enter image description here

Then, on Line 2, when I try to change the string value, I get the following crash log:

enter image description here

Here are the details at the 3 last steps of the crash log:

enter image description here

enter image description here
Note that __s1 = "", __s2 = "", n = 77192… have values that do not correspond to the values of the previous step that can be seen on the screenshot below:

  • __p = NULL gives __s1 = ""
  • __s = "depth-L3" gives __s2 = ""
  • __n = 8 gives n = 77192…

enter image description here

I don’t understand the origin of all these weird things:

  1. ‘Summary unavailable’ for just one string of my struct
  2. Weird crash
  3. Crash with variables that change of value between two methods of the crash log

Any idea about the origin of these problems ?

Thanks a lot for your help.

Source: Windows Questions C++