eProsima / Fast-DDS-Gen

Fast-DDS IDL code generator tool. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
77 stars 58 forks source link

Fast DDS-Gen hangs when generating type definition files #176

Closed JLBuenoLopez closed 11 months ago

JLBuenoLopez commented 1 year ago

Discussed in https://github.com/eProsima/Fast-DDS-Gen/discussions/175

Originally posted by **rookybird** May 12, 2023 > [idl.zip](https://github.com/eProsima/Fast-DDS/files/11458648/idl.zip) > RNDFMap includes GlobalPath.idl which includes Waypoint.idl > When I do "fastddsgen RNDFMap.idl", my computer stucks there for a long time. I am wondering what triggered this problem. > I am using fastddsgen 2.4.0

I have tested the provided IDL files against Fast DDS-Gen v2.4.0 and current master and as the user reports, the code generation hangs. Fast DDS-Gen v2.3.0 correctly generates the code from the IDL. This seems to be a regression introduced by #127. @rookybird, we are looking into it and will try to fix it soon.

JLBuenoLopez commented 11 months ago

@rookybird

Can you test against the latest Fast DDS-Gen release, v3.0.1? We checked and it was not a proper bug. Your types are using a lot of unbounded collections. Fast CDR previously calculated the payload size needed so Fast DDS could reserve the payload. This logic was moved into Fast DDS-Gen to improve runtime performance. Thus, when generating the code, some logic has to be run to calculate the maximum serialized size. The last release has optimized the calculation for collection types. The issue you reported, if you wait enough time, the types are generated, but with your type definition takes a lot of time and it seems to hang. This has been fixed in the latest release.

Please, consider closing the issue.

rookybird commented 11 months ago

@rookybird

Can you test against the latest Fast DDS-Gen release, v3.0.1? We checked and it was not a proper bug. Your types are using a lot of unbounded collections. Fast CDR previously calculated the payload size needed so Fast DDS could reserve the payload. This logic was moved into Fast DDS-Gen to improve runtime performance. Thus, when generating the code, some logic has to be run to calculate the maximum serialized size. The last release has optimized the calculation for collection types. The issue you reported, if you wait enough time, the types are generated, but with your type definition takes a lot of time and it seems to hang. This has been fixed in the latest release.

Please, consider closing the issue.

Thanks for your effort and explanation. I have tested my case and it works. I have closed #175