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

Blocks environment crashing just after Play button is hit: sun_prop in NULL pointer. #59

Open
MehmetCagriK opened this issue Aug 3, 2023 · 1 comment

Comments

@MehmetCagriK
Copy link

Bug report

  • AirSim Version/#commit: 112eb74
  • UE/Unity version: 5.2
  • autopilot version:
  • OS Version: Windows 11

What's the issue you encountered?

After clean build, Blocks environment crashing at the line of Colosseum\Unreal\Environments\Blocks\Plugins\AirSim\Source\SimMode\SimModeBase.cpp line 235;

#if ENGINE_MINOR_VERSION > 24
        FObjectProperty* sun_prop = CastFieldChecked<FObjectProperty>(p);
#else
        FObjectProperty* sun_prop = Cast<FObjectProperty>(p);
#endif

        UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_);

Settings

How can the issue be reproduced?

Clean build of Airsim and Blocks are enough on Windows 11 with Unreal Engine 5.2. Playing the simulation instantly crashes

Include full error message in text form

Exception thrown: read access violation.
sun_prop was nullptr.

What's better than filing an issue? Filing a pull request :).: I would like to create pull request but I am not well versed in Unreal Engine inner workings. My engineer instinct says code block should be modified as below though;

#if ENGINE_MINOR_VERSION > 24
        FObjectProperty* sun_prop = CastFieldChecked<FObjectProperty>(p);
#else
        FObjectProperty* sun_prop = Cast<FObjectProperty>(p);
#endif

        UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_);

to simply

        FObjectProperty* sun_prop = CastFieldChecked<FObjectProperty>(p);

        UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_);
@MehmetCagriK
Copy link
Author

#if ENGINE_MINOR_VERSION > 24
        FObjectProperty* sun_prop = CastFieldChecked<FObjectProperty>(p);
#else
        FObjectProperty* sun_prop = Cast<FObjectProperty>(p);
#endif

This conditional compilation seems to have remained after 4.25 change in Unreal Engine. If you decide to support Unreal Engine 4 versions, I would suggest checking major version in addition to minor version also, since 5.2 should be greater than 4.27 but just checking minor version seems to be what crashing the execution.

@MehmetCagriK MehmetCagriK changed the title Blocks environment crashing just after Play button is hit Blocks environment crashing just after Play button is hit: sun_prop in NULL pointer. Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant