trufflesqueak icon indicating copy to clipboard operation
trufflesqueak copied to clipboard

primitiveContextAt[put] (210/211) fail for stackp >= 16 in some situations

Open LinqLover opened this issue 2 years ago • 3 comments

Practical example to reproduce:

  • Debug it: Object newSubclass
  • Step Through
  • Error: subscript is out of bounds: 16 from Context>>at:put: (ClassBuilder>>superclass:subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: @ 93)

Minimal example to debug:

Object subclass: #TestObject
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'as yet unclassified'.
TestObject compile: 'a: a b: b c: c d: d e: e f: f g: g h: h i: i j: j k: k l: l m: m n: n o: o ^ a'
Process forBlock: [TestObject basicNew a: 1 b: 2 c: 3 d: 4 e: 5 f: 6 g: 7 h: 8 i: 9 j: 10 k: 11 l: 12 m: 13 n: 14 o: 15] runUntil: [:ctx | self haltIf: ctx stackPtr = 15. false]

Interestingly, primitiveAt[Put] (60/61) still work in the situation.

LinqLover avatar May 25 '22 16:05 LinqLover

I'm not sure I want to know how you found this but thanks for raising the issue! :)

So it seems that your dummy method forces a large frame and then primitiveContextAt[Put] fail, interesting. Is this blocking you on anything?

fniephaus avatar May 25 '22 17:05 fniephaus

I'm not sure I want to know how you found this but thanks for raising the issue! :)

I stumbled upon this during #163. :)

Is this blocking you on anything?

Not really, I was just playing around with TruffleSqueak a bit ... Looks like #163 is a larger issue anyway that will hinder me from working with SimulationStudioin TruffleSqueak. But I was not having any concrete plans other than fuzz-testing. :)

LinqLover avatar May 25 '22 17:05 LinqLover

But I was not having any concrete plans other than fuzz-testing.

Right, there are still some critical SUnit tests that don't pass such as: https://github.com/hpi-swa/trufflesqueak/blob/a068eca13ca09ac1de50bc4572dd53333fab8718/src/de.hpi.swa.trufflesqueak.test/src/de/hpi/swa/trufflesqueak/test/tests.properties#L1259

So I am not surprised you can easily run into crashes and other problems. Anyway, please keep reporting so we know what's broken!

fniephaus avatar May 25 '22 17:05 fniephaus