Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulator crashes after arming (PX4 SITL) #1516

Closed
petergerten opened this issue Nov 4, 2018 · 8 comments
Closed

Simulator crashes after arming (PX4 SITL) #1516

petergerten opened this issue Nov 4, 2018 · 8 comments

Comments

@petergerten
Copy link

AirSim: master
PX4: master
OS: Ubuntu 16.04

I set up my AirSim project with PX4 SITL and I succesfully get MAVLink data in QGroundControl.
As soon as I issue the arm command (and I still get and "armed" back in QGC) - AirSim crashes.

Most of the time I get:

terminating with uncaught exception of type std::runtime_error: UdpClientPort socket send failed with error: 111

Signal 6 caught.
Malloc Size=131076 LargeMemoryPoolOffset=131092 
CommonLinuxCrashHandler: Signal=6
Malloc Size=65535 LargeMemoryPoolOffset=196655 
Malloc Size=41839 LargeMemoryPoolOffset=238511 
Engine crash handling finished; re-raising signal 6 for the default handler. Good bye.
Aborted (core dumped)

Sometimes I get:

terminating with uncaught exception of type std::runtime_error: Message length 32 doesn't match expected length33

Signal 6 caught.
Malloc Size=131076 LargeMemoryPoolOffset=131092 
CommonLinuxCrashHandler: Signal=6
Malloc Size=65535 LargeMemoryPoolOffset=196655 
Malloc Size=41624 LargeMemoryPoolOffset=238296 
Engine crash handling finished; re-raising signal 6 for the default handler. Good bye.
Aborted (core dumped)

But it reproducibly crashes every single time. Before I switched to the PX4 SITL I used the simple flight controller setup which runs stable with my current setup. If I don't arm the system but just let the simulation run and produce mavlink output - everything works and does not crash.

@petergerten
Copy link
Author

This is probably a very dirty hack but I just tried what would happen if I comment out

		if (hr == SOCKET_ERROR)
		{
			hr = WSAGetLastError();
			// perhaps the client is gone, and may want to come back on a different port, in which case let's reset our remote port to allow that.
			remoteaddr.sin_port = 0;
			throw std::runtime_error(Utils::stringf("UdpClientPort socket send failed with error: %d\n", hr));
}

from UdpClientPort.cpp

This seems to work for me. Of course it does not solve the underlying issue but it does not crash the application anymore.

@bimalkmehta bimalkmehta added the bug label Nov 5, 2018
@RVBldr
Copy link
Contributor

RVBldr commented Nov 21, 2018

Internal VSTF 7690

@petergerten
Copy link
Author

@RVBldr can you clarify what that means?

@RVBldr
Copy link
Contributor

RVBldr commented Nov 23, 2018

@petergerten We're tracking this issue on our internal Visual Studio bug database.

@madratman madratman added px4 and removed bug labels Dec 6, 2018
@clovett
Copy link
Contributor

clovett commented Dec 23, 2018

Pull request 1654 probably fixes this issue.

@petergerten
Copy link
Author

@clovett just pulled airsim master (without my quick&dirty patch mentioned above) and noticed that this issue still persists.

@lovettchris
Copy link
Member

This PR might also fix the issue:
#3757

@zimmy87 zimmy87 closed this as completed Jun 18, 2021
@zardosht
Copy link

Setting the parameter MAV_PROTO_VER to "Always use version 2.0" in PX4 fixes the problem with message length runtime error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants