Skip to content

Checkpoint code allocates too little space for new registry entries #82

@mayianm

Description

@mayianm

This was discovered on the hybridVPIC branch, but should apply to the main branch as well.

The functions register_object and restore_objects each only allocate one byte for new registry entries. This leads to intermittent crashes of the checkpoint code, and to the error "cannot checkpoint a pointer to an unregistered object".

This can be fixed by changing lines 191 and 304 in src/util/checkpt/checkpt.c from:
MALLOC( node, 1 );
to:
MALLOC( node, sizeof(*node) );

As with many memory related bugs, this one can be a little hard to reproduce. This seems to be triggered in particular with GCC compilers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions