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

Meson Build crash on unit test on TimeoutError #10752

Closed
CLanguagePurist opened this issue Aug 28, 2022 · 4 comments
Closed

Meson Build crash on unit test on TimeoutError #10752

CLanguagePurist opened this issue Aug 28, 2022 · 4 comments
Milestone

Comments

@CLanguagePurist
Copy link
Contributor

CLanguagePurist commented Aug 28, 2022

Describe the bug
Meson build crashes when running unit test for my project resulting in a Timeout Error crashing Python that runs Meson Build.

To Reproduce
Check out git repo at: https://codeberg.org/TylerLinuxDev/STL-For-C/src/branch/reproducebug under "reproducebug" branch and simply do the followings:

git checkout https://codeberg.org/TylerLinuxDev/STL-For-C.git
cd STL-For-C
git checkout reproducebug
git submodule update --init --recursive
meson setup build
meson test -C build

and Meson will simply crash after one of the unit test reach 30 seconds time out.

Expected behavior
Not to crash meson and simply say test case was timed out and to continue on to the next test case.

system parameters

  • Plain native build on Arch Linux
  • Arch Linux, updated yesterday.
  • Python Version: 3.10.6
  • Meson Version: 0.63.1
  • Ninja build Version: 1.11.0

Error Output:

24/26 stlc:queue / Generic Queue Test - Test Circular Buffer                             OK             17.96s
Exception in callback TestHarness._run_tests.<locals>.test_done(<Task finishe...imeoutError()>) at /usr/lib/python3.10/site-packages/mesonbuild/mtest.py:1882
handle: <Handle TestHarness._run_tests.<locals>.test_done(<Task finishe...imeoutError()>) at /usr/lib/python3.10/site-packages/mesonbuild/mtest.py:1882>
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/subprocess.py", line 134, in wait
    return await self._transport._wait()
  File "/usr/lib/python3.10/asyncio/base_subprocess.py", line 235, in _wait
    return await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1884, in test_done
    f.result()
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1879, in run_test
    res = await test.run(self)
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1416, in run
    await self._run_cmd(harness, cmd)
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1483, in _run_cmd
    await p.wait(self.runobj)
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1305, in wait
    test.additional_error += await self._kill() or ''
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1266, in _kill
    await asyncio.wait_for(p.wait(), timeout=0.5)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

Ok:                 24  
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/tyler/Repos/STL-For-C/build/meson-logs/testlog.txt
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/subprocess.py", line 134, in wait
    return await self._transport._wait()
  File "/usr/lib/python3.10/asyncio/base_subprocess.py", line 235, in _wait
    return await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/mesonbuild/mesonmain.py", line 153, in run
    return options.run_func(options)
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 2040, in run
    return th.doit()
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1717, in doit
    self.run_tests(runners)
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1856, in run_tests
    loop.run_until_complete(self._run_tests(runners))
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1949, in _run_tests
    await complete(future)
  File "/usr/lib/python3.10/site-packages/mesonbuild/mtest.py", line 1170, in complete
    await future
asyncio.exceptions.TimeoutError

ERROR: Unhandled python exception

    This is a Meson bug and should be reported!
@CLanguagePurist
Copy link
Contributor Author

ReproduceBug.mp4

@CLanguagePurist
Copy link
Contributor Author

It seems to occur on high contention test case where all of the threads on PC is occupied or in use.

@annacrombie
Copy link
Contributor

Here is a somewhat minimal reproducer.

@eli-schwartz
Copy link
Member

Gentoo discovered this in https://bugs.gentoo.org/880863

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

4 participants