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

flow_graph: Assertion m_private_counter >= 0 failed #1595

Open
martinr0x opened this issue Jan 7, 2025 · 2 comments · May be fixed by #1596
Open

flow_graph: Assertion m_private_counter >= 0 failed #1595

martinr0x opened this issue Jan 7, 2025 · 2 comments · May be fixed by #1596
Assignees
Labels

Comments

@martinr0x
Copy link

martinr0x commented Jan 7, 2025

Summary

When running TBB flow_graph I sporadically encounter Assertion m_private_counter >= 0 failed (located in the destroy function, line in file: 141) on destruction.
This is a similiar to Issue-639, only that I encounter it in succeeding TBB versions.

One thing that I observed is that the failure does not occur when setting tbb::flow::node_priority_t{0}.
This is not required in this minimal example, but needed in our implementation as we have other nodes with tbb::flow::node_priority_t{0}.

Version

Able to reproduce with TBB 2022.0.0

Environment

  • OS Ubuntu 22.04.4 LTS
  • Compiler: gcc 11.4.0 | clang 17

Steps To Reproduce

#include <iostream>
#include <cassert>
#include <tbb/flow_graph.h>

int main() {
    struct Message {
        int idx;
        [[maybe_unused]] char pad[1] = {0};
    };
    using NODE = tbb::flow::function_node<Message, tbb::flow::continue_msg>;
    int num_iterations = 10000;
    int node_activations = 0;

    tbb::flow::graph graph;
    NODE node{graph, tbb::flow::serial, [&]([[maybe_unused]] const auto& msg){ node_activations++; },
              tbb::flow::queueing{}, tbb::flow::node_priority_t{1}};

    for (int i{0}; i < num_iterations; i++) {
        node.try_put(Message{i});
    }

    graph.wait_for_all();
    assert (num_iterations == node_activations);
    return 0;
}
@martinr0x martinr0x added the bug label Jan 7, 2025
@martinr0x martinr0x changed the title TBB::flow_graph: Assertion m_private_counter >= 0 failed flow_graph: Assertion m_private_counter >= 0 failed Jan 7, 2025
@kboyarinov kboyarinov self-assigned this Jan 8, 2025
@kboyarinov
Copy link
Contributor

@martinr0x, thanks for reporting the issue.
I was able to reproduce it on my side and will investigate this.

@martinr0x
Copy link
Author

Great, thank you.

@kboyarinov kboyarinov linked a pull request Jan 8, 2025 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants