Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Set Particle Component's TickEvenWhenPaused to true, then run the game, then SetGamePaused to true, then crash

The actor's setup is like this:

alt text

Then you can call SetTickableWhenPaused(true) for the particle component:

alt text

Then call this some where some time:

alt text

Then crash.

We've examined the call stack and suspecting it's a bug. The TickTaskManager clears the TickFunction->TaskPointer first then calls ExecuteTick(), however when during ExecuteTick(), tick function uses TaskPointer so it crashes.

Code samples are below:

TickTaskManager.cpp // the calling site, call ExecuteTick() then goes to particle component.

 for (TSet<FTickFunction*>::TIterator It(AllEnabledTickFunctions); It; ++It)
     TickFunction = *It;
     TickFunction->TaskPointer = nullptr; // this is stale, clear it out now
     if (TickFunction->bTickEvenWhenPaused && TickFunction->TickState == FTickFunction::ETickState::Enabled)
                 TickFunction->TickVisitedGFrameCounter = GFrameCounter;
                 TickFunction->TickQueuedGFrameCounter = GFrameCounter;
                 TickFunction->ExecuteTick(InContext.DeltaSeconds, InContext.TickType, ENamedThreads::GameThread, FGraphEventRef());

ParticleComponent.cpp // crash is here, GetCompletionHandle() failes inside.

     AsyncWork = TGraphTask<FParticleAsyncTask>::CreateTask(nullptr, ENamedThreads::GameThread).ConstructAndDispatchWhenReady(this);
 #if !WITH_EDITOR  // we need to not complete until this is done because the game thread finalize task has not beed queued yet

Product Version: UE 4.12
more ▼

asked Jul 21 '16 at 12:37 PM in Bug Reports

avatar image

225 8 17 25

avatar image Doug E ♦♦ STAFF Jul 21 '16 at 05:31 PM

Hey marsonmao-

When I added a ParticleSystemComponent (MyPSC) to my actor class and set MyPSC->SetTickableWhenPaused(true); I did not receive a crash when I tried to play in the editor. Can you provide the setup where you're setting bTickableWhenPaused as well as the callstack and log files from the crash for additional information?

avatar image marsonmao Jul 22 '16 at 08:32 AM

Ah, sorry that I didn't mention you can't test this in PIE, since PIE would lead to the non-async part of particle component's Tick so it would never crash. As you can see the posted code snippets are specific to "#if !WITH_EDITOR".

avatar image Doug E ♦♦ STAFF Jul 22 '16 at 02:10 PM

I took the sample project I had and tried to test it in a Standalone window as well as a packaged game and did not get a crash. Can you add the callstack and log files from the crash as well as the steps for your setup to help me test on my end?

avatar image marsonmao Jul 28 '16 at 10:19 AM

The setup is fairly simple, like this:

alt text

avatar image marsonmao Jul 28 '16 at 10:23 AM

And actually we're having this issue in PS4 packaged game, but I'm not sure if this problem is only for PS4.

avatar image Doug E ♦♦ STAFF Jul 27 '16 at 01:52 PM

Hey marsonmao-

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.


Doug Wilson

avatar image marsonmao Jul 28 '16 at 10:25 AM

Hi, please check the comment above, thanks!

avatar image marsonmao Aug 10 '16 at 09:08 AM

Hi, please check the new comment and edited post, thanks T.T

avatar image marsonmao Jul 28 '16 at 10:17 AM

Ok, the call stack is below

 Assertion failed: TaskPointer [File:C:\dev\VR\Game\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp] [Line: 1702]
 [Callstack] 0x02c5ba67 - UParticleSystemComponent::TickComponent(float, ELevelTick, FActorComponentTickFunction*)
 [Callstack] 0x026a812a - FActorComponentTickFunction::ExecuteTick(float, ELevelTick, ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&)
 [Callstack] 0x031d6495 - FTickTaskLevel::RunPauseFrame(FTickContext const&)
 [Callstack] 0x031cfd5c - FTickTaskManager::RunPauseFrame(UWorld*, float, ELevelTick)
 [Callstack] 0x02ab772f - UWorld::Tick(ELevelTick, float)
 [Callstack] 0x028ef36a - UGameEngine::Tick(float, bool)
 [Callstack] 0x00418827 - FEngineLoop::Tick()
 [Callstack] 0x0042aba4 - tchar_main(int, wchar_t**)
 [Callstack] 0x0042a431 - main
 [Callstack] 0x03bdc82b - _start

avatar image Doug E ♦♦ STAFF Jul 29 '16 at 04:11 PM

Just to recap to confirm if my setup is correct, please let me know if you are doing the following (or what you are doing differently)

  • Create new class based on Actor

  • Add UPROPERTY (EditAnywhere, BlueprintReadWrite, Category = Test) UParticleSystemComponent* MyPSC; to header

  • Add MyPSC = CreateDefaultSubobject < UParticleSystemComponent>(TEXT("MyPSC")); and MyPSC->SetTickableWhenPaused(true); to the constructor

  • After compiling the code, in the editor you add a particle system to the component in blueprints and place an instance in the level

  • Package and run the packaged game

From my understanding, it is here that you are getting a crash? If this is accurate, can you let me know if you get a crash in a new sample project while running the packaged game on Windows. If so, please add the sample project to help identify the issue. If you do not crash with these steps on Windows, can you confirm if you do get a crash on PS4? If you are doing something different or I've missed something in my steps, please let me know exactly what your setup looks like and exactly what you are doing that leads to the crash.

avatar image marsonmao Aug 10 '16 at 08:53 AM

Hi Doug:

The only difference of my setup is that I made my whole actor in Blueprint, otherwise I think mine is the same as yours. And after reading my own post again, I found that I made a critical mistake. You have to pause the game to trigger the crash, I don't know why I missed describing this in my post...I'm truly sorry for that! I'll edit the post title and content.

So the steps are, make this actor with particle component, run the packaged game, then pause the game (you can make a keyboard event to execute "SetGamePaused(true)", of course) and wait the assertion comes up.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey marsonmao-

I was able to reproduce the crash after pausing the game and have entered the bug UE-34486 for further investigation. You can view the public tracker for this issue here: https://issues.unrealengine.com/issue/UE-34486


Doug Wilson

more ▼

answered Aug 10 '16 at 02:34 PM

avatar image marsonmao Aug 11 '16 at 03:29 AM

Great, thanks!

avatar image MArgudo_Panache Sep 29 '16 at 08:21 PM

This issue is blocking me. Once you find a fix, could you please post it here so I can modify the code without waiting for 4.14 ? Thanks

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question