enki-community / enki

A fast 2-D robot simulator. To contact us, please open an issue.
Other
36 stars 34 forks source link

Programming project, Integration dashel #38

Closed sebpouteau closed 7 years ago

sebpouteau commented 7 years ago

hello,

As part of the programming project which consists in distributing the enki display, we use dashel. We encounter a problem with the Windows platform.

Client::Client(const string& ip, const int port) :
        init(true),
        inputStream(0)
    {
        string remoteTarget = "tcp:" + ip + ";port=" + to_string(port);
        inputStream = connect("stdin:");    <———————  ERREUR sous windows
        remoteStream = connect(remoteTarget);
        sendString(remoteStream, "I want to connect!\n");
    }

It fails during the connect(stdin).

Error:

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. terminate called without an active exception

As the client code is similar to the example "chat.c" contained in dashel, I try to make it run it turns out that it does not either:

ci@INRIACI-OT9HJCJ MINGW32 /c/msys32/home/ci/src/dashel/build $ ./chat.exe & [1] 3844

ci@INRIACI-OT9HJCJ MINGW32 /c/msys32/home/ci/src/dashel/build $ ./chat.exe tcp:localhost toto Cannot change standard input mode to immediate.

I'm open to any idea about how I could fix this.

Thanks.

stephanemagnenat commented 7 years ago

When we created Dashel in the first place, we checked that the chat worked on Windows. Maybe we made a change at some point that broke stdin:. I do not have Windows right now, but the best to debug would be to run a simple test program in a debugger and see where the error happens.

From your test with chat, it seems that there is a standard input feature, "immediate", that cannot be set. The best would be to ask a win32 export, if none is available, a search on the net would certainly help.

stephanemagnenat commented 7 years ago

It seems that the error happens in dashel-win32.cpp line 407. I do not know why on your computer Windows cannot set these console options.

davidjsherman commented 7 years ago

Chat has never worked for me on the Windows instances hosted by the CI platform. I had always assumed that I was using the wrong command-line arguments. Is there an example of proper usage somewhere?

stephanemagnenat commented 7 years ago

When Dashel was created, in 2007, chat worked on Windows. Maybe recent Windows version dropped support for some console-related syscalls?

stephanemagnenat commented 7 years ago

I've added the display of the system error message in Dashel, and it returns error code 6. A search in Google shows this post. I confirm that with using the Windows command line instead of a msys/cygwin terminal it works. I close the issue.

stephanemagnenat commented 7 years ago

I've added an issue in Dashel to keep track of this limitation.

davidjsherman commented 7 years ago

Yes, from the Command Shell it works on our Windows instances.