Project

General

Profile

Bug #1438

ABORT for unterminated string literal

Added by John Abbott about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
bug
Target version:
Start date:
05 Mar 2020
Due date:
% Done:

100%

Estimated time:
1.66 h
Spent time:

Description

Sending just a single " double quote char will crash CoCoA-5.

I hope to fix later... must dash now.


Related issues

Related to CoCoA-5 - Feature #1399: CoCoA-5 interpreter: idle/busy indicatorClosed2020-01-21

History

#1 Updated by John Abbott about 4 years ago

May be a consequence of allowing a NUL inside a string?
Surely my fault, anyway :-(
Something to do tonight... sigh!

#2 Updated by John Abbott about 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

The function fo reading a string literal (which I hacked), correctly throws an "unclosed literal" exception when the newline is encountered.
This exception is caught in Interpreter.C at line 2917, and printed in line 2918.

It seems that ewsp.needsRecovery is not set, so it does not try to recover (whatever that means).
It then calls continue (still inside the exception handler).

Maybe this is where I broke something, because I added a do...while loop.

I'll continue tomorrow...

#3 Updated by John Abbott about 4 years ago

  • % Done changed from 10 to 50

Indeed, my suspicion last night was correct.
Now I am considering how best to fix the code. The fix should be ready by lunchtime :-)

#4 Updated by John Abbott about 4 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 50 to 90
  • Estimated time set to 1.66 h

The fix seems reasonable, and some testing suggests that it is working OK.

Now I wonder whether it was even worth it...

n := factorial(10^7);

Logs R and then W2.5; so the GUI would indicate that it took about 2.5s to compute.

n := factorial(10^7);  m := 1;

Logs R and W2.5 as before, but then immediately afterwards it logs R and W0; so the GUI would indicate 2.5s just for an instant, and then overwrite it with 0s.

If the line were sent via SourceRegion then a single log message would be produced (indicating the total time for all commands in the region).

#5 Updated by John Abbott about 4 years ago

  • Related to Feature #1399: CoCoA-5 interpreter: idle/busy indicator added

#6 Updated by John Abbott about 4 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

Closing

Also available in: Atom PDF