I'm not sure if this is the proper place to report this, anyhow:

Using Pogo 9.7.2 and Tango 9.3.4 on debian buster, I have the following issues:

I contrast to the add_<name>_dynamic_attribute() functions generated by Pogo, the add_<name>_dynamic_command() functions are missing a PROTECTED REGION. I wanted a dynamic command to be visible in expert mode only and so copied the generated function to a _mod() version and called this instead. Sadly there is also no PROTECTED REGION foreseen for functions like this in the DynAttrUtils.cpp file. It would be great if this could be changed in future versions.

While testing the device server I got aware, that the DynamicCommandClass objects are not freed properly when deleting the device. First I though it might have to do with my _mod, but further investigations lead me to the conclusion, that it is a bug in Tango itself. Even if you try to free the memory manually inside delete_device, they are not in the command_list any more.

Running the server with valgrind gives me this:
==21837== 2,800 (2,688 direct, 112 indirect) bytes in 16 blocks are definitely lost in loss record 175 of 175
==21837== at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
==21837== by 0x153B49: Simplon_ns::Simplon::add_GenericCommand_dynamic_command_mod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool) (SimplonDynAttrUtils.cpp:2009)
==21837== by 0x13BBAB: Simplon_ns::Simplon::add_dynamic_commands() (Simplon.cpp:2286)
==21837== by 0x14B275: Simplon_ns::SimplonClass::device_factory(Tango::DevVarStringArray const*) (SimplonClass.cpp:432)
==21837== by 0x4EE7DDD: Tango::DServer::init_device() (in /usr/lib/x86_64-linux-gnu/libtango.so.9.3.4)
==21837== by 0x4EE8DAE: Tango::DServer::DServer(Tango::DeviceClass*, char const*, char const*, Tango::DevState, char const*) (in /usr/lib/x86_64-linux-gnu/libtango.so.9.3.4)
==21837== by 0x4EECBCB: Tango::DServerClass::device_factory(Tango::DevVarStringArray const*) (in /usr/lib/x86_64-linux-gnu/libtango.so.9.3.4)
==21837== by 0x4EEE66E: Tango::DServerClass::DServerClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (in /usr/lib/x86_64-linux-gnu/libtango.so.9.3.4)
==21837== by 0x4EEE8E6: Tango::DServerClass::init() (in /usr/lib/x86_64-linux-gnu/libtango.so.9.3.4)
==21837== by 0x50157B4: Tango::Util::server_init(bool) (in /usr/lib/x86_64-linux-gnu/libtango.so.9.3.4)
==21837== by 0x15D5D3: main (main.cpp:60)

Am I right? Is this a bug or am I missing something?


Btw: valgrind returns quite some irregularities when you run it on a Tango device server.