At 07:57 PM 3/29/2002 +0200, you wrote: >"Michel J Lambert" <[EMAIL PROTECTED]> wrote: > > > Attached is a .pasm file which causes some string data to be written into > > the middle of the string_pool->pool_buffer list of entries, such that when > > it tries to dereference foo in new_pmc_header, it's pointing to garbage > > memory. 0x20202020 for me, which is four spaces. Changing the save/restore > > of spaces in the pasm file to use periods causes the pointer to be > > 0x2e2e2e2e. I tried for a bit on this, but couldn't really track it down > > any more than that. Hopefully someone else can figure it out. > >Two problems found so far: >1) mem_realloc passes the incorrect size to Parrot_allocate (this causes the >specific error mentioned above)
Clearly a bug. Applied, thanks. >2) add_header_to_free calls mem_realloc calls Parrot_allocate calls >go_collect which moves the free header pool > >The first is a simple fix; the second needs either suppression of collection >during the procedure, or not using mem_realloc. The patch below puts the >reallocation code into add_header_to_free and add_pmc_to_free, this means >that, in the scenario described, the free pool will be moved by the garbage >collector, and then immediately moved again. Since the free pools are not >compressed by go_collect, perhaps they should be allocated independently and >not copied around all the time?? > >After fixing the above, the test program still abends, this time with >"subend somehow is less than substart" - I have not yet followed up on this. I left the second part concering realloc() out, pending further discussion. Not saying this is wrong, just that is sounds as if you may suspect a more elegant fix that may warrant comments from the list. -Melvin