You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, Cyclone DDS use ddsrt_getprocessname() to get the process name and then free it. But if using freertos + lwip (other architectures may have the same problem), ddsrt_getprocessname() will return the address of pxTCB->pcTaskName, which is managed by freertos and should not be free. In my project, this will lead to a heap management problem.
The text was updated successfully, but these errors were encountered:
It looks like both Windows and Unix need to dynamically allocate this in some circumstances, so in the interest of keeping the interface of ddsrt_getprocessname straightforward, it should also be allocated dynamically in FreeRTOS.
instead (which also requires a #include "dds/ddsrt/string.h").
Checking it is difficult for me. Would you be able to verify that this is the correct fix?
If it works, you're more than welcome to do a PR with the fix, the only obstacle would be that you need to sign the Eclipse Contributor Agreement. That saves me from having to go through the steps (and might reduce the round-trip time a bit) 🙂
Thank you for your help! I have applied your solution to my program, and now it works well. And I opened a PR with your fix at #1862 . So I think this issue can be closed.
cyclonedds/src/core/ddsi/src/ddsi_init.c
Lines 1384 to 1390 in 7cf3309
Here, Cyclone DDS use
ddsrt_getprocessname()
to get the process name and then free it. But if using freertos + lwip (other architectures may have the same problem),ddsrt_getprocessname()
will return the address ofpxTCB->pcTaskName
, which is managed by freertos and should not be free. In my project, this will lead to a heap management problem.The text was updated successfully, but these errors were encountered: