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

Full support for /proc/sys/kernel/pid_max changing during a process changing at runtime #2

Open
richardstartin opened this issue Jul 19, 2023 · 0 comments

Comments

@richardstartin
Copy link
Contributor

Currently the profiler assumes that the value stored at /proc/sys/kernel/pid_max does not increase at runtime. The value is used for sizing various internal data structures, for example:

  • the number of perf event subscriptions (how many threads can be profiled)
  • the size of wallclock thread filter
  • the size of the trace context lookup

In some scenarios users may increase this value during a process's lifetime which violates this assumption. Currently there is a workaround to floor the value read from /proc/sys/kernel/pid_max at 131072, but profile sample labelling would be broken (but not crash) if this number of threads is ever exceeded.

r1viollet added a commit that referenced this issue Oct 23, 2024
Avoid shifting a negative value
This was raised by asan nightly runs

> Task :ddprof-test:testClasses
ddprof-lib/src/main/cpp/vmStructs.cpp:816:34: runtime error: left shift of negative value -1
    #0 0x7f6f6bd20631 in ScopeDesc::readInt()
    #1 0x7f6f6bce54a6 in ScopeDesc::decode(int)
    #2 0x7f6f6bce7fb0 in StackWalker::walkVM(void*, ASGCT_CallFrame*, int, void const*, void const*)
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

1 participant