Skip to content

iseq recycled while still in use #49

@wks

Description

@wks

The Ruby binding tests failed in mmtk/mmtk-core#1073. The error doesn't seem to be related to that PR.

It is reproducible locally. The segmentation fault happens in ImmixSpace::mark_line because it attempted to access unmapped address. It is because the object size encoded in the hidden field added by the mmtk-ruby binding is overwritten to a very large number. This means it is a dangling reference bug.

This happens in the very early stage of execution. It can be reproduced by executing an empty script (or a "hello world" program of course). One way to reproduce it is:

MMTK_STRESS_FACTOR=1048576 MMTK_THREADS=1 ./miniruby --mmtk -e ""

It is easier to reproduce when there are fewer GC threads. 2 is the best. 1 is still able to reproduce it.

Assertion fails because a traced object is already dead. The current evidence shows it is an iseq created during builtin_iseq_load, but is dead (but still referenced) in rb_iseq_eval.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions