Skip to content

Allocation sites sized by definite-length array types should be recorded another way #185

@stephenrkell

Description

@stephenrkell

This problem was witnessed in the libuv codebase (thanks @mbyzhang).

If we size an allocation like this (in libuv's test suite, specifically test-fs.c):

static char test_buf[] = "test-buffer\n";
...
buffer = malloc(sizeof(test_buf) * iovcount);

then the allocation type will be recorded as "array of 13 chars". I think it should just be "char" and we are not stripping arrays in dumpallocs.ml.

This is going wrong in allocsites because the tool is searching for the exact DWARF type signed char [13] which is not directly embodied... specifically it is not in the types_by_codeless_name relation that we built. I am not sure why it is not, however. Presumably it should be there? If the debug info for test_buf is intact, then presumably it is in the info section. So I'd like to understand this one a little better before jumping to a fix.

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