[Vm-dev] Another off-by-one error causing a crash

Frank Shearar frank.shearar at gmail.com
Thu Mar 14 22:47:21 UTC 2013


Hi Eliot, Igor,

I think there's at least one more off-by-one error lurking in how
block contexts are handled. I've put an image demonstrating the
problem here: http://dl.dropbox.com/u/938599/compose-crash.tgz

The image has an inspector. If you evaluate the highlighted "self
parseNull" and wait a bit, after about 20s or so the image will quit
with "(last object overwritten)".

I'm still not using FFI. You'll see in the resulting stack trace an
enormous number of calls to #compose:. This isn't an infinite
recursion. It's several thousand nested blocks, but the workspace
shows that this in itself isn't a problem:

inc := [:x | x + 1].
add := inc.
1 to: 100000 do: [:unused | add := add compose: inc].
add value: 0

#compose: is just

compose: aUnaryBlock
	^ [:x | self value: (aUnaryBlock value: x)].

If there's anything I can do to help stomp this bug, please let me know!

frank


More information about the Vm-dev mailing list