robocomp/dsr-graph

Error using DSR agents in Ubuntu 20.04

DarkGeekMS opened this issue ยท 7 comments

DSR agents unexpectedly shut down, when trying to run them on Ubuntu 20.04, with no error message.

Only Startup check is printed.

However, when I disable startup check :

this->startup_check_flag = 0;

Everything seems to be running fine :
Screenshot from 2020-08-28 11-48-11

Somehow, the startup check always times out.

Thank you @DarkGeekMS
Could you make some debug for us? This flag should be set to false in initialization and to true only if --startup-check option is given.
You can see this in the main.cpp file of the components. You can look for this // Search in argument list for --test argument (if exist) to find where it's set to true and bool startup_check_flag = false; to find where it's created and set. Could you make some debug of this in your Ubuntu 20.04?

Sure thing, I'm working on it.

@orensbruli
I have debugged the issue for a while and I think the problem is that startup_check_flag is not initialized.

Nothing changes startup_check_flag but class initialization, so when I print the value of startup_check_flag in the class constructor, I found that it's set to a random integer, which means true :

public:
    idserver (QString prfx) { prefix = prfx.toStdString(); std::cout << startup_check_flag << std::endl; }

An uninitialized boolean is supposed to be set to false though, which happens in Ubuntu 18.04, but not in Ubuntu 20.04.

So, I initialized startup_check_flag to false :

private:
    void initialize();
    std::string prefix;
    TuplePrx tprx;
    bool startup_check_flag = false;

Great! And with this change, the component starts as expected, right?
As far as these changes looks good for all the ubuntu versions I think you can make a Pull Request of this.

Yes, it works fine with all Ubuntu versions.
I will create a PR to change it in the components.
Also, I think it should be fixed in the code generator as well.

@DarkGeekMS I'm fixing this in robocompdsl, thx.

I updated and tested the components in this PR : #12