osrf / robocup3ds

Gazebo support for the RoboCup 3D simulation league.
11 stars 2 forks source link

Server crash after client disconnect #14

Closed osrf-migration closed 8 years ago

osrf-migration commented 8 years ago

Original report (archived issue) by Stefan Glaser (Bitbucket: umscht).


The server crashes after I disconnect my client from it with the following message:

RCPServer::Send() Socket not found.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

To reproduce the problem, simply take the magma-protocol-tester from issue 12 (http://chaosscripting.net/files/magma-protocol-tester.zip), then:

  1. start gazebo with robocup3ds plugin and run the magma-protocol-tester GUI
  2. connect an agent ("connect" button)
  3. initialize it ("Send init" button) (after that confirm that the agent shows up in the simulator)
  4. hit the "disconnect" button

It seems like the server still tries to send messages to closed sockets, or doesn't handle the exception when the other side disconnects during a send-call.

osrf-migration commented 8 years ago

Original comment by Stefan Glaser (Bitbucket: umscht).


osrf-migration commented 8 years ago

Original comment by jasonzliang NA (Bitbucket: jasonzliang).


osrf-migration commented 8 years ago

Original comment by jasonzliang NA (Bitbucket: jasonzliang).


I have added a fix here: https://osrf-migration.github.io/osrf-projects-gh-pages/#!/osrf/robocup3ds/pull-requests/43/fix-for-issue-14/diff

osrf-migration commented 8 years ago

Original comment by Stefan Glaser (Bitbucket: umscht).


Hi Jason,

I can confirm that your fix resolves this issue. I'm now able to disconnect properly without crashing the server.

Thanks for your effort!

osrf-migration commented 8 years ago

Original comment by jasonzliang NA (Bitbucket: jasonzliang).


osrf-migration commented 8 years ago

Original comment by jasonzliang NA (Bitbucket: jasonzliang).


Still need to merge pull request

osrf-migration commented 8 years ago

Original comment by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).


See pull request #43