cyclonedds icon indicating copy to clipboard operation
cyclonedds copied to clipboard

dyndub core dumped when the publisher's idl definition contains array types

Open binbowang1987 opened this issue 1 year ago • 1 comments

I want some array support, so make some changes to the HelloWorldData.idl. And, when run dynsub HelloWorldData_Msg, the dynsub app failed with core dumped.

module HelloWorldData
{
    struct Msg
    {
        @key
        long userID;
        string message;
        long array[5];
    };
};

图片

binbowang1987 avatar May 06 '23 14:05 binbowang1987

Yes, well, it does contain a comment "Beware that a lot of cases are missing!" ...

That said, I had another problem to analyze the other day and did that by extending dynsub. It is still not complete, and it doesn't print arrays either, but it does handle array types for gathering all the information and calculating sizes. So adding the printing of an array should be trivial.

I didn't need to print an array value and I didn't have the time to complete it, clean it up and package it as a PR, but I do intend to do that one day.

That extended version is at https://github.com/eboasson/cyclonedds/blob/dynsub-typeobj-printer/examples/dynsub/dynsub.c ... Adding support for an array in there should be really straightforward, so if you need it soon, do feel free to be adventurous! I'd be happy to merge that into the code as well.

eboasson avatar May 08 '23 14:05 eboasson