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

coroutine in thread XYZ has overflowed its stack while running loom unit test #363

Open
UditDey opened this issue Sep 12, 2024 · 2 comments

Comments

@UditDey
Copy link

UditDey commented Sep 12, 2024

Hi, I'm using loom to verify a lock-free data structure that I've written (I should add this is the first time I'm using loom).

I set up 3 unit tests, each one has my structure in different configurations, and then I'm using loom to verify correctness when multiple threads are interacting with the structure. My 3rd unit test is the most intensive one. It spawns the same number of threads as the others but will involve significantly more atomic ops.

I expected the 3rd case to take a lot of time, however it fails to execute entirely:

running 1 test
test mem::page_alloc::tests::test_tree_height_3_loom ... FAILED

failures:

---- mem::page_alloc::tests::test_tree_height_3_loom stdout ----

coroutine in thread 'mem::page_alloc::tests::test_tree_height_3_loom' has overflowed its stack



failures:
    mem::page_alloc::tests::test_tree_height_3_loom

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

I can see this is a stack overflow but it specifies that a coroutine has had a stack overflow

Does loom use stackful coroutines? Or does cargo test use stackful coroutines internally? Has anyone else faced this before while running an intensive loom test?

And I'll just clarify that none of my code uses stackful coroutines. In fact loom is its only dependency so this is definitely not originating in my code. Google'ing resulted in nothing and this is the first time I've seen a stack overflow error that mentions a coroutine, so I have no clue where its originating

@UditDey UditDey changed the title coroutine on thread XYZ overflowed its stack while running loom unit test coroutine in thread XYZ has overflowed its stack while running loom unit test Sep 12, 2024
@mox692
Copy link
Member

mox692 commented Sep 12, 2024

Did you build the test with debug build? If so, could you also try release build and check if the problem has been resolved?

@UditDey
Copy link
Author

UditDey commented Sep 12, 2024

I only ran the tests in release mode, I'll give it a shot in debug mode just to try

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

2 participants