Skip to content

par_for_each and par_for_each_mut app freeze with 100% CPU usage if an invalid batch_size is passed #6640

Closed

Description

@Carbonhell

Bevy version

0.9.0

What you did

While running a parallel query, I accidentally passed an invalid value of 0 as batch_size.

What went wrong

This caused my application to freeze forever and apparently consume a lot of resources (I even got a blue screen of death, but I'm not sure if it was just a coincidence since it happened only once. While my application was frozen, the application was reported as using 100% CPU on the task manager.
I was expecting a panic on a clearly wrong batch_size passed as input.

Additional information

You can easily reproduce this with this application:

use bevy::prelude::{App, Transform};

fn main() {
    let mut app = App::new();

    app.world.spawn(Transform::default());
    app.update();

    let mut query = app.world.query::<(&Transform,)>();

    query.par_for_each(&app.world, 0, |t| {
    })
}

Activity

  1. added
    C-BugAn unexpected or incorrect behavior
    S-Needs-TriageThis issue needs to be labelled
    on Nov 15, 2022
  2. added
    A-ECSEntities, components, systems, and events
    and removed
    S-Needs-TriageThis issue needs to be labelled
    on Nov 15, 2022
  3. added this to the 0.10 milestone on Nov 16, 2022
  4. added a commit that references this issue on Jan 20, 2023
    dfea88c
  5. added a commit that references this issue on Jan 22, 2023
    b423f9a
  6. added a commit that references this issue on Feb 1, 2023
    9fa40d0
  7. added a commit that references this issue on Mar 4, 2023
    76b8829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions