Skip to content

Segfaults with 64bit addresses #17

@MintPaw

Description

@MintPaw

I see that 64bit support was added pretty recently. I get a lot of nondeterministic segfaults when trying to use the backend.c by itself.

Randomly on these line:

self->placement[set_id*self->ways+i] = self->placement[set_id*self->ways+i-1];

if(self->placement[set_id*self->ways+i].invalid == 0 &&

In cases when it crashes set_id and cl_id are negative while the source addr is positive, I get the feeling that shouldn't be the case.

Cache__get_cacheline_id takes addr as a long long, shifts it to the right, then returns it as a long. This can result in a negative return value, is that ok?

inline static long Cache__get_cacheline_id(Cache* self, long long addr) {
return addr >> self->cl_bits;
}

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