Weird behavior with std::stringstream on iPhone XS

Sorry for confusing. I mean, They use str(), not c_str(). The most cases are copying string that is created from std::stringstream, I didn’t see any c_str() code. As you know, Copying a string from std::stringstream is a common practice, and It doesn’t seem harmful to me.

The problem always happens when std::stringstream::str() is deallocated. even when I use std::copy() and std::move() with std::stringstream::str(). so I think any code will make the problem. I already removed auto keyword to make sure there’s no problem on the left side.

I heard iPhone XS is very sensitive at managing memory than other devices. Not sure whether it is true.

I’m going to update my post with call stack and some other things that might be useful, but You can reproduce it with the above code.