Inconsistency with '+' operator to concatenate strings

Has anyone seen issues with the ‘+’ operator used to concatenate strings? We found that we are getting inconsistent results after approximately 65,000 calls to the plus operator in a single program.

i.e. s = "hello "+“world”. generally results in the string “hello world” being stored in s, but if you try to do this enough times, it gets something else entirely. (we first saw this issue running our program in regular operation for extended periods, not just in test code)

here is the test program.

and the output if you run it in a loop.

(the actual string is blocked out because it leaked some adjacent data, but you can see the length)

we’ve replicated this on both CB3 and e-Series robot

there appears to be a workaround… using str_cat() instead of ‘+’ to concatenate strings works perfectly and the program seems to runs indefinitel, but it seems like this is a major bug in the script interpreter.

Hi Avi,
Im working to report this bug to the right people, just need to know a few more things about your system.
First being the software versions you were running on both the E-series and the CB-series robots, the second being any URCaps you had installed while running this test

Hi. Sorry for the delay didn’t realize there was a response here. We saw this on multiple versions of polyscope but I updated to latest available at the time to make sure that wasn’t the issue.

Also completely clean systems I uninstalled all of the URCaps.


Does URScript support the “&” operator?

Decades ago when I started learning to code I was told that “+” is sketchy for concatenating strings. That while it does work, it causes problems down the line.

I was encouraged to use “&” instead and only use “+” for mathing.