Xojo 2020 R1 first run of my project in Windows this morning I run into this error:

Framework failed assertion at REALString.cpp:130
Condition: usageCount

What’s worse is that it happens so early in the process it simply hard crashes the app. It wasn’t until I put in a breakpoint or two that it actually gave me an error message.

I did submit this bug in the beta program in mid August but it was obviously not fixed.

Sadly REALString.cpp:130 just tells you the reference counting for a string is broken.
You have to know which string it is, which functions handled it and then maybe you can find the plugin or framework function not doing the proper retain call.

IIRC that fix is slated for R2.

ug. That really stinks for us. We really needed R1 to clear up several long-standing bugs.

1 Like

If you know which string it is, just put it in a global variable to increase reference count.
Or add to global array a few times to make sure it is not released.

I do NOT know what string it is.

You could run the app via lldb (on macOS) and put a break point at functions with DisplayFailedAssertion in the name. Then print back trace and maybe print the parameter to the function and look in the structure for the string to find the pointer to the string and look what’s inside. Not easy, but I remember doing something like this in past years to investigate a bug.

This only happens in Windows.

What happens if you convert all strings to UTF8 before you add them to the object which causes the issue?

This is a huge project with multiple threads. I can’t tell you exactly where it’s happening.

would be nice if Xojo instead if just crashing in REALString could give some indication via a usable stack trace etc

To bad. I am asking this because of the discoveries we made in this Thread:

I’d refer you to a prior post in this thread


there seem to be many other reports & reasons this exception can come up
I founf at least 3 others with that exect description in feedback and others that seem to also mention it

1 Like

We asked long ago for having more assertions changed to raise exceptions instead.
Like this could raise an exception telling string reference counting is broken for a string.