Problem with String in x64 Release Mode


#1

Hi together

I have a problem with strings on Windows 7 x64, using Reaper as a Test host. Following line crashes the plugin and Reaper some times. Crashed only in release mode until now:

the preset class looks like this:

class TalPreset { public: String name; ...

Maybe its too late and its a dummy question… has anyone an idea what the problem could be. I’m shure that talPresets is initialied.

It works if i do this:

or


#2

I would investigate what your T macro is expanding to, and also see how String is represented based on your build settings (utf8 utf16 utf32, etc). Maybe instead of using T, make it a utf16 string yourself by putting the L at the end or something like that.

Check your build settings to see if Unicode is turned on or off.

Play with it till you shake some new information loose.


#3

Thanks a lot for the help. Will play with the compiler options and the string formats. Hope to find more information about the problem.

EDIT: Found the problem. Some sleep always helps :slight_smile: The string error was a side effect of an “array out of bounds” access (bad memory access). The bug was difficult to find, because it was only one wrong byte.


#4

Please do not use the T macro any more! It was a terrible idea that I should have removed years ago, and I’m going to deprecate it very soon. Just write your code without it, and you’ll end up with a faster and more compact result.