-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
AirSim causes Heap Corruption exceptions with Unreal in HITL mode #2583
Comments
1.2.0 is way too old. Current airsim master and release (1.3.1) works with px4 1.10.1 |
How do I tell if the version that Unreal Editor plugin manager is telling me I have installed is actually correct? I cloned the AirSim repo earlier today and built master then dropped the built AirSim plugin bits into my own custom environment, and in both my environment and in Blocks I see 1.2.0 Beta. So I wonder if the plugin info for Unreal hasn't been updated (but the actual plugin bits are current) or if I'm doing something wrong when I copy the plugin into my environment. |
Looking at the AirSim.uplugin file in master, I see Version 1.2.0:
and cloning the repo again and doing all the build steps from scratch as described in the AirSim docs, I still see So now I'm confused. Is it just the case that the version info in the |
If you've cloned master, you should have the latest bits - it does look like the .uplugin needs to be updated. Regarding your actual issue, could you perhaps post the output log from VS? Bottom right in the debugger, Output tab. Upon first looks, it seems like the exception is happening in the joystick part of code. Also, I find this interesting:
So the code throws an unhandled exception and keeps going? And what exactly is the runtime error you get when you run this outside of the debugger? |
@saihv I attached a zipfile with logs from both the standard Blocks environment and my custom Oceans environment. Both environments behave the same way with respect to the crash at simulation startup. I wrote:
Yes when I press CONTINUE in VS2019 the second time, the simulation seems to run fine from that pint on. I have run it for a few hours without any issue that I could see,
Double-clicking on Blocks Unreal Engine project file: I get a popup that says: I press Yes, Unreal builds a bunch of stuff and then Unreal Editor 4.24 starts up with Blocks loaded. I press PLAY, I see the Windows blue circle spinning for a while and then the whole thing dies without any additional error messages (so perhaps it's hitting the unhanded exception that the debugger catches). Selecting Launch game on Blocks Unreal Engine project file: I get a popup that says: I press Yes, then after building, I get the Blocks banner and then the simulation starts. What happens at this point is what I think is a very important clue: If I have just plugged in the Pixhawk prior to doing the Launch game, I'll get a black screen for about 5 seconds and then the simulation will die. If I have used the Pixhawk with the simulator (even in the case above where the simulator dies in the previous attempt), the simulation will frequently run, sometimes correctly, sometimes with the drone just spinning end over end for a bit before I use my R/C controller to try to get it to fly correctly. To be clear about this - in all three cases (VS2019 DebugGame mode, UE Editor mode, Launch game mode), the behaviour of the simulator is pretty uch the same with respect to how it behaves if the Pixhwak has just been plugged in or if it has been used with the simulator in a previous session. So I am suspecting that perhaps the HITL code isn't properly initializing the Pixhawk in some way or that on the first communication with a just-booted Pixhawk there might be some MAVLINK messages that are causing the AirSim code to corrupt the heap. The Contents of my Blocks Unreal Engine project file:
|
I went back to an older version of Blocks and Unreal 4.22 and confirmed that the crash does not happen in that configuration (still HITL with Pixhawk 4 and PX4 1.10.1). I hope this is helpful and I'll also compare the AirSim sources in what might be likely areas to see what's changed between then and now.
|
Can you try this PR and see if that fixes the heap corruption? |
I'll try this on Friday. Thanks! |
My initial testing (Pixhawk.PX4 HITL, AirSim latest master version, Unreal 4.24.3, VS2019 used for everything) shows that the heap corruption issue isn't occurring anymore - thanks! I'll be doing more testing over the weekend and update this issue on Monday. |
Great, thanks for trying it. |
When I try to run an Unreal environment with AirSim in HITL mode, the VS2019 debugger throws two exceptions:
Source Not Available
followed byHeap Corruption
. Sometimes I don't get theSource Not Available
exception and I see the actual source of where the exception occurred. I have included screenshots for both cases here. Caveat: I am not a Windows developer, I am an embedded and Linux developer, so VS2019 is like black magic to me and my expertise with it is relegated to pushing buttons following online build instructions.Environment:
Steps to reproduce:
sln
file in VS2019, select the environment as the startup project, selectDebugGameEditor
andWin64
mode.Source Not Found
followed byUnhandled Exception: Heap Corruption
after I press Continue or I will seeException Thrown: Breakpoint
followed byUnhandled Exception: Heap Corruption
. I suspect these two are identical, one is just that VS2019 can't find the source for some reason. It's troubling to me that my toolchain is producing inconsistent results on something as simple as finding the source code when debugging.Pressing Continue allows the simulation to continue and then it seems to run well. However, this bug causes me to be unable to run the simulation outside of the VS2019 debugger.
If I do not plug in the Pixhawk and start the simulation, I do not get these exceptions. If I then plug in the Pixhawk while the simulation is running, I will see a message that AirSim has connected to the Pixhawk but HITL doesn't work since the Pixhawk doesn't get GPS data from AirSim (that's OK since I don't expect that AirSim would support hot plugging a flight controller while the simulation is running). If I then stop the simulation and restart it, I will get the same set of exceptions as above.
The text was updated successfully, but these errors were encountered: