Page 1 of 1

Crashing on std::string concatenation

Posted: Fri Jun 20, 2025 2:11 pm
by Dinglebyte

Hello, I recently updated my devkitpro libraries with the windows installer, and now when I run my project, I get a consistent crash in places where I either convert a const char* to an std::string, or I append an std::string to another std::string.

For instance:

Code: Select all

void Foo(const std::string& str)
{
    //...
}

// ...
    static const char* myStr = "Test string 1234567890";
    Foo(myStr);

or like this

Code: Select all

std::string str1 = "SomewhatLongString";
str1 += "Extra";

It seems to happen only when the string length exceeds a certain size (like maybe around 16 characters?).

I was wondering if anyone else has had issues with std::string after the June updates. I tried to make sure to clear all of my intermediate build files after upgrading versions. When I built fresh on another computer I also ran into the same crashes though, so I don't think it's an issue of stale files.

I ran similar string tests inside the wii examples, but they did not crash. Unfortunately I can't provide a minimal test case. Just trying to brainstorm what might be happening or ways I can debug my program.


Re: Crashing on std::string concatenation

Posted: Mon Jun 30, 2025 8:33 pm
by WinterMute

Are you using libraries other than libogc?

If you can provide a project that exhibits this problem we can take a look. It might be difficult without a minimal testcase but we'll certainly take a look.