grSim icon indicating copy to clipboard operation
grSim copied to clipboard

Segmentation after changing 'command Listen Port'

Open kianbehzad opened this issue 4 years ago • 1 comments

Describe the bug The initial state of the commandSocket works fine. However, after changing the command Listen Port grSim crashes after receiving new commands. (this issue happens most frequently in macOS )

To Reproduce Steps to reproduce the behavior: most frequently happens in macOS, rarely in ubuntu due to its memory management policy

  1. open both grSim and the client
  2. change command Listen Port from grSim
  3. connect to the new port from the client and send new commands.
  4. grSim will be terminated

Expected behavior receive the commands from the new port and apply them.

Desktop

  • OS: macOS
  • Version 10.15

My opinion to fix the issue add the following line in mainwindow.cpp -> reconnectCommandSocket function (before connecting signal and slot)

glwidget->ssl->commandSocket = commandSocket;

kianbehzad avatar Dec 22 '20 14:12 kianbehzad

I've run into the same or similar issue and fixed it here: https://github.com/RoboCup-SSL/grSim/pull/144/commits/06edd4f82aed8b7e6eba4af8a7158dd51ee43aa4

Can you verify if this solves your issue as well? You can test it on the feature/simulator-protocol branch.

g3force avatar Feb 05 '21 17:02 g3force