ENGINE CRASHES sometimes with my actor class: "ACCESS VIOLATION"

Hello.

When the Engine crashes I get this error:

In my Projectile.cpp I have this:

90943-2.jpg

What could the reason be? It says “Access violation”, but why?

Also, keep in mind this crash happens RARELY and not everytime a Missile that I shoot explodes.

Hey -

The access violation is likely caused because MovementComp is null when you are trying to access it. Can you explain what you were doing when the crash occurred? Were you working inside a blueprint, playing in the editor, etc. Any information you can provide about the circumstances when the crash occurred will be helpful in determining the cause.

Yes, I knew that was something related to the MovementComp pointer

The worst thing here is that the crash is not consistent

I’m firing a lot of Missiles and it’s not crashing right now, but it has already crashed 2-3 times until now.

All I’m doing, by the way, is simply spawning the Missiles.

It appears the crash is happening in your DestroyProjectile() function so it may be tied to when the projectile is removed from the level. If you face a wall and fire (so you are shooting into the wall mesh) can you let me know if a crash occurs then? Also, if you could provide the log files the next time the crash occurs it will help determine the cause of the crash.

The messages about FTimer are just showing which functions were called prior to when the crash occurred. Without knowing more about the circumstances when the crash occurs, the best solution I can think of would be to put line 196 inside an if(MovementComp != NULL) check. If you do continue to see this crash with this change to the code, please provide a copy of the project for me to test directly. If you can zip the project you can then attach it to a post. The post can be marked as private so that only moderators and yourself can see it.

I’m firing the projectile everywhere. It crashes randomly after a random ammount of time. It’s completely unpredictable!

Also, please notice in the screenshot the error message related to FTimer, FTimerManager and such… because I’m actually using timers.

I attached the crash log!

link text

This is what I tried

The if statement checks whether the MovementComp is valid or not. If not, it prints an error.

I tried that out and it crashes the same; it doesn’t even show me the error message!

It’s like the MovementComp is actually a valid pointer… but for some reason it crashes.

Anyway, tell me how to make a post private so I will upload my project. It will take while, since my upload speed is very low.

When adding a comment, there is a drop down arrow just below the blue “comment” button. Here you can specify who is able to see the comment or attachments to that comment

I don’t see any arrow below the “comment” button.

P.S: I’m uploading the project to Google Drive.

If you are uploading it to google drive, you can send me a PM on the forums with a download link to the project instead.

Ok, I sent you the link on the forums. I forgot to remove the password of the .rar, it’s hi0

Hey -

I received the project you sent and attempted to test on my end. When I press the left mouse button to fire, it shoots out a line trace. Holding the button continues to shoot multiple line traces. After testing this multiple times for about 5 minutes per test I did not receive a crash. Can you explain what exactly you mean by “spawning the missiles”? If you’re doing something other than just holding the left mouse button, can you indicate what else needs to be done?

I apologize for not having explained the issue steps before.

In order to fire the missiles, you need to Pickup the MissileLauncher which is a pickup in the level with a very basic 3d mesh of a cylinder.

Once you pick it up, press Q to Equip it.

Now you can shoot with it. I recommend to pickup the Missile Launcher many times, as you need a lots of ammunitions to shoot for the Engine to crash.

It’s weird, really weird.

Look: - YouTube

I can’t think of any reason why you’re facing that. Updates?

How exactly do I pick up the missile launcher? Walking over it doesn’t seem to do anything.

The crash is difficult to achieve, I told you.

For the crash to occur, you need to fire a bunch of rockets, many many. It really depends.

The first time it crashed, it was the first shot. The second time it was after like
40 shots.

If you haven’t tried enough, please retry. The crash will be about to come up.

ALSO you want to shoot at your feet

I was able to pickup the rockets after a small edit to the OnPickup delegate however I did not experience a crash when firing the rockets. If you are still encountering the crash, can you try commenting out the MovementComp->StopMovementImmediately() line and let me know if the crash continues to occur?

I had tested multiple times, firing dozens of shots per test with no crash. I tried again while aiming at the floor and again fired ~50 times without getting a crash. Please let me know if commenting out the StopMovementImmediately() line has any affect on your project.

I think 50 rockets are still not enough. Please, see: - YouTube

By the way I commented that line as you suggested, but the crash still occurs!

Crash found on line 210… ?_?

I think there’s a mismatch between client and server. Like, the rocket gets destroyed first on one of the two, and then it tries to destroy it again, but since it’s already destroyed it crashes