[Vm-dev] last object overwritten
Frank Shearar
frank.shearar at gmail.com
Thu Feb 28 23:05:15 UTC 2013
On 28 February 2013 20:35, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
>
>
> On Wed, Feb 27, 2013 at 10:23 AM, Frank Shearar <frank.shearar at gmail.com> wrote:
>>
>>
>> On 27 February 2013 18:15, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> >
>> > Hi Frank,
>> >
>> > On Wed, Feb 27, 2013 at 6:51 AM, Frank Shearar <frank.shearar at gmail.com> wrote:
>> >>
>> >>
>> >> So I thought I'd be extra tricky with some partial continuation stuff
>> >> and, as sometimes happens, things went Badly Wrong and the VM crashed.
>> >> What was odd was that it said "last object overwritten", which I've
>> >> not seen before.
>> >
>> >
>> > this means what it says and is pointing to e.g. a bug in an FFI call. Cog fills the object eden zone with a bit pattern and checks on every allocation that the word pointed to by the allocation pointer contains the correct bit pattern. If the last object allocated is written-to past its end this will corrupt the bit pattern in the allocation zone and the next allocation will exit with an error. Such overwriting happens e.g. when one supplies a buffer that is too short to external code that writes to the buffer.
>> >
>> > So if you're making FFI calls perhaps you can debug this yourself.
>>
>> That just makes things stranger, because I'm not using FFI. Other than
>> the fact that I'm stack-hacking, there's nothing other than normal
>> Smalltalk stuff going on.
>
>
> Indeed. There's a bug in primitive shallowCopy of contexts that makes the copy a word too short. Do that a few times and ... bang. Should have a fix soon. Amazing this stuff ever works at all ;)
I'm perversely proud that my perverse code has now flushed out two
context bugs! I should make little ascii art tokens, and claim Ace
status for the Control package when I hit #5!
frank
More information about the Vm-dev
mailing list