3.0
Errors with line numbers
It would be very helpful if all the errors while interpreting were represented with line numbers.
For example, consider a simple script with a "MessageNotUnderstood" error:
| foo | foo := 5, 'bar'
The virtual machine gives an error like this:
Object: 2 error: did not understand #, MessageNotUnderstood(Exception)>>signal SmallInteger(Object)>>doesNotUnderstand: #, UndefinedObject>>executeStatements
Exceptions using Delay
The following code produces exceptions as below in bursts after a few seconds. More generally, it seems Delay starts failing in situations where the system is somewhat loaded (such as during the event- and render-loops in our SDL/cairo bindings-in-progress).
Code:
Object subclass: DelayExperiment [
run [
[ (Delay forMilliseconds: 1) wait ] repeat.
]
].
DelayExperiment new run.
Expected output: nothing, forever.
Actual output:
<pre>$ gst delay-bug.st
"Global garbage collection... done"
Object: nil error: did not understand #goodness:
Processes created by the VM cannot be cleanly #terminate-d
When you run TerminationExperiment's #run, it can sometimes reach several tens of thousands of iterations of busyLoop before faulting, but will often fault before 20,000 iterations have completed on my machine.
When you run #run2, things behave as I would have expected them to behave. No faulting occurs, and the process is sensibly terminated.
Here's a selection of some of the faults I see from #run after several seconds. Each comes at the end of a single run of the script, as attached.
Object: '' error: Invalid argument : must be a SmallInteger
ObjectMemory class >> snapshot: should return an indicator
ObjectMemory class >> snapshot: does not provide any way to determine whether, at the return from #snapshot:, we are running in
1. the parent, just after the save, or
2. the saved image, just after the load
A good solution to this would be to return some indicator of which image-instance we're running in from #snapshot:.
Given such an indicator, we could build a #snapshot:andQuit: message, a la Squeak, which would provide a convenient way of saving a snapshot and quitting, without having to jump through hoops on resume to determine which actions to take next.
