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

Increase memlimit when checking for cgroups #984

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

charmoniumQ
Copy link
Contributor

@charmoniumQ charmoniumQ commented Jan 16, 2024

On my system, this command takes around 1.4MiB (possibly due to large env, many $PATH entries, and statically compiled binaries). There's no reason to be stingy with this limit; the comment indicates it's just there to "force check for swapaccount".

This error manifests itself much later in the code as:

Traceback (most recent call last):
  File "/nix/store/8np01kr8qpm49m2gzjbwcjr68f162b9x-python3-3.10.13/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/nix/store/8np01kr8qpm49m2gzjbwcjr68f162b9x-python3-3.10.13/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/check_cgroups.py", line 153, in <module>
    main()
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/check_cgroups.py", line 149, in main
    check_cgroup_availability_in_thread(options)
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/check_cgroups.py", line 101, in check_cgroup_availability_in_thread
    raise thread.error
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/check_cgroups.py", line 113, in run
    check_cgroup_availability(self.options.wait)
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/check_cgroups.py", line 67, in check_cgroup_availability
    task_cgroups = Cgroups.from_system(cgroup_procinfo=lines)
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/cgroups.py", line 108, in from_system
    return CgroupsV2.from_system(cgroup_procinfo)
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/cgroupsv2.py", line 309, in from_system
    cgroup_path = _parse_proc_pid_cgroup(cgroup_procinfo)
  File "/nix/store/hk9vr7k1z9wz02q6sq04qkfdbv92sri2-python3-3.10.13-env/lib/python3.10/site-packages/benchexec/cgroupsv2.py", line 234, in _parse_proc_pid_cgroup
    return path
UnboundLocalError: local variable 'path' referenced before assignment

I also check the return code of the command. This is a good practice and would help debug similar issues in the future.

On my system, this command takes around 1.4MiB (possibly due to large env, many $PATH entries, and statically compiled binaries). There's no reason to be stingy with this limit; the comment indicates it's just there to "force check for swapaccount".
Copy link
Member

@PhilippWendler PhilippWendler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This makes sense. We must make sure to not attempt to use more memory than what is available, but of course 100 MB are still safe.

@PhilippWendler PhilippWendler merged commit c8350d6 into sosy-lab:main Jan 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants