Skip to content

Free too soon in mark_roots() (suspected bug) #18

@clinuxrulz

Description

@clinuxrulz

I do not have a failing test case for this. However I believe this is not a safe place to free a node:

free(s);

I believe the free-ing should be defered to the end of collect_roots, just like collect_white does.

The reason is that the early drop() it could be potentially be changing the shape of the memory graph that has already been traversed by mark_grey(). Potentially causing scan_black() not to restore the reference counts properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions