PrimalScript crashes on long strings in PowerShell

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 10 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
atippetts
Posts: 9
Last visit: Thu Aug 01, 2019 12:09 am

PrimalScript crashes on long strings in PowerShell

Post by atippetts »

My editor is crashing every time I stick a quote on any line above a lengthy variable...

Here's how I'm recreating this:
Launch PrimalScript 2012 (6.5.153)
Create a new PowerShell script
Add a couple blank lines, then a long string variable:
$somevar="Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

Then go to any line ABOVE that line, and type a double quote (")

PrimalScript immediately crashes:
"Sapien PrimalScript 2012 has stopped working. A problem caused the program to stop working correctly. Please close the program."

I am running this on Windows 7, all the latest SPs and patches.

Also note, I have tried this with real-time syntax checking both enabled and disabled; same results both ways.


Thoughts?

Thank you,


Aaron
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript crashes on long strings in PowerShell

Post by Alexander Riedel »

Can you define how long "long" is? My guess is that a character limit in the parser is exceeded somewhere and to make this get fixed faster we'd like to know how long your variable is.

Best would be to attach the actual file or email it (zipped) to support@sapien.com.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
atippetts
Posts: 9
Last visit: Thu Aug 01, 2019 12:09 am

Re: PrimalScript crashes on long strings in PowerShell

Post by atippetts »

Alexander Riedel wrote:Can you define how long "long" is? My guess is that a character limit in the parser is exceeded somewhere and to make this get fixed faster we'd like to know how long your variable is.
If you use the exact variable I posted above (copy/paste?), and if the problem isn't for some reason local just to me, then you'll see it. The one above happens to be a string of 276 characters.
User avatar
atippetts
Posts: 9
Last visit: Thu Aug 01, 2019 12:09 am

Re: PrimalScript crashes on long strings in PowerShell

Post by atippetts »

Playing some more, I can also come up with this:
"long" appears to mean a string of >127 continuous characters on a single line.

I can create a variable with value of 127 continuous characters (no spaces) just fine. Add one character or more, still no spaces, and it breaks when I start typing a quote anywhere earlier in the script. My guess is that this happens as PrimalScript tries to go and contextually recolor everything.

Break the value with a line return, each line being less than 128 continuous characters, and it's fine (this won't meet my needs, unfortunately).

i.e.:
$myvar="<128 or more continuous characters>" #boom

$myvar="<60 continuous characters>
<100 continuous characters>
<75 continuous characters>
<anything less than 128 continuous characters>" #no boom

Or type something like (including the unclosed double quote):
---------------------------
"
$myvar="<75 continuous characters><space><75 more continuous characters>"
---------------------------
And then remove the space: boom

Interestingly enough, this even happens in a "here-string" - which I would think should be impervious to this behavior (though, in my opinion ((mean no offense here, just stating my experience)) PrimalScript has always had a problem of handling here-strings poorly when it comes to trying to figure out what text should be what color during and after the here-string.)

And finally, I just tried this at home (also Win7, latest & greatest) using a trial copy of the exact same version of PrimalScript, with the same results.

Hope this additional info helps.
User avatar
atippetts
Posts: 9
Last visit: Thu Aug 01, 2019 12:09 am

Re: PrimalScript crashes on long strings in PowerShell

Post by atippetts »

Dang it. One last post for the night. Promise, it's my last.

If I turn off "Display Syntax Coloring" the whole problem goes away. But then living in a black-and-white scripting world is... well... reminiscent of times long, long ago.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript crashes on long strings in PowerShell

Post by Alexander Riedel »

I'll see what I can find out. There is a service build scheduled for this weekend anyway, I will make sure this makes it in.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
atippetts
Posts: 9
Last visit: Thu Aug 01, 2019 12:09 am

Re: PrimalScript crashes on long strings in PowerShell

Post by atippetts »

Alexander Riedel wrote:I'll see what I can find out. There is a service build scheduled for this weekend anyway, I will make sure this makes it in.
Thank you. Looking forward to it.
User avatar
atippetts
Posts: 9
Last visit: Thu Aug 01, 2019 12:09 am

Re: PrimalScript crashes on long strings in PowerShell

Post by atippetts »

6.5.156 fixes this. My thanks for the quick response.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: PrimalScript crashes on long strings in PowerShell

Post by Alexander Riedel »

We aim to please :-)
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 10 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.