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

self.running_procs becomes negative, leading to AssertionError #736

Open
BolunThompson opened this issue Nov 23, 2024 · 2 comments
Open
Labels
bug Something isn't working good first issue! Good for newcomers

Comments

@BolunThompson
Copy link
Contributor

BolunThompson commented Nov 23, 2024

Possibly low priority since I only found the problem while fixing another bug. Minimal test case:

echo "abc" > /tmp/data.txt
cat /tmp/data.txt
echo
echo
echo

Exception:

Traceback (most recent call last):
  File "/home/bolun/pash/compiler/pash_compilation_server.py", line 535, in <module>
    main()
  File "/home/bolun/pash/compiler/pash_compilation_server.py", line 531, in main
    scheduler.run()
  File "/home/bolun/pash/compiler/pash_compilation_server.py", line 510, in run
    self.parse_and_run_cmd(input_cmd)
  File "/home/bolun/pash/compiler/pash_compilation_server.py", line 444, in parse_and_run_cmd
    response = self.compile_and_add(
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/bolun/pash/compiler/pash_compilation_server.py", line 289, in compile_and_add
    self.wait_unsafe()
  File "/home/bolun/pash/compiler/pash_compilation_server.py", line 433, in wait_unsafe
    assert self.running_procs == 1
           ^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Checking if self.running_procs already equals zero before decrementing it in remove_process does solve the immediate issue, but ideally the number should already match up.

@angelhof
Copy link
Member

Interesting, it seems to have to do with the receiving of exit messages from the runtime. The daemon somehow does not handle some of them correctly so it might decrement running processes more than once? It is not priority bug, but should be good if someone wants to take a stab.

@angelhof angelhof added bug Something isn't working good first issue! Good for newcomers labels Nov 25, 2024
@BolunThompson
Copy link
Contributor Author

BolunThompson commented Dec 22, 2024

This works on the ubuntu 20.04 container (vs the 24.04 system I develop on).

Looking at this further, I believe this is the same issue as #738, since, similarly, echo $(./test.sh) works while ./test.sh leads to the exception above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue! Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants