Closed osrf-migration closed 8 years ago
Original comment by Stefan Glaser (Bitbucket: umscht).
Hi all, the magma protocol tester has two "send" buttons. The "send init"-button sends the scene-string, the init-effector and a beam-effector at once. The other "send" button sends the text that is contained in the text-field next to it, which is initially "(syn)". So, in order to reproduce the problem I usually do the following:
Alternatively you can send different messages, e.g. an action message for one of the neck joints: "(he1 1.0)"
The status bar lists the number of sent and received messages. This helps to verify that the server still sends perception messages.
The "verbose" checkbox enables or disables the output of perception-messages via std-out.
Original comment by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).
Actually, it was not a deadlock. This was the problem:
DispatchRequestOnClientSocket()
.Parse()
.Parse()
was trying to read 4 bytes containing the length of the following s-expression:#!c++
int endianSize = recv(_socket, this->buffer, 4, 0);
Here's the problem because we don't have any guarantee that we're going to read the entire 4 bytes here. We could read 2
for example. The code assumed that we were reading 4 bytes.
See pull request #42 for a solution.
@umscht , @jasonzliang Could you give it a shot to confirm that the patch fixes the problem? You would have to compile robocup3d
from sources.
Original comment by Stefan Glaser (Bitbucket: umscht).
Hi Carlos, this definitely looks like an error source. Especially since we turned off buffering in the TCP/IP stack and send the length information byte by byte.
I tested your fix in pull request #42 and it solves this issue for our agent and the protocol-tester tool I provided. We can connect, initialize, beam and send commands without crashing.
But, I also noticed that when I disconnect my agent, the server still crashes with the following output:
RCPServer::Send() Socket not found.
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Should I open another issue for that?
Thank you very much for your effort!
Original comment by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).
Merged in issue_12 (pull request #42)
Fix issue #12
→ \<\<cset 2564cd30a8090452824d77fe412716118c1bf930>>
Original report (archived issue) by jasonzliang NA (Bitbucket: jasonzliang).
A deadlock condition sometimes occurs with the lock guard in the Send() method in RCPServer:
To reproduce:
Start gazebo with robocup3ds plugin and connect with the magma agent (download here: http://chaosscripting.net/files/magma-protocol-tester.zip )
enter the following strings (clicking send after each one)
(scene NaoSimsparkBT)
(init (unum 5)(teamname magmaOffenburg))
Confirm that agent is loaded on field. After this send as many "(syn)" messages until the timer stops advancing.