benfred / py-spy

Sampling profiler for Python programs
MIT License
12.14k stars 400 forks source link

When we will get support for python 3.10 and 3.11 #598

Open prathapbelli opened 1 year ago

prathapbelli commented 1 year ago

I can run py-spy record or top for sample python program with python version 3.8 but not with 3.10 or 11. I was getting error -Reason: Operation timed out (os error 60)

benfred commented 11 months ago

The latest version of py-spy has support for python 3.10 and 3.11 already.

I'm guessing that you're running into problems with SIP on OSX https://github.com/benfred/py-spy/issues/242 . .

Can you try disabling SIP and seeing if this resolves?

azmyrajab commented 10 months ago

hi, I have SIP disabled and running into the same issue w/ OSX (Operation timed out) Any ideas for work-arounds?

tashmore commented 5 months ago

Same problem (despite SIP disabled). Some logs:

(trad) z % csrutil status
System Integrity Protection status: disabled.
(trad) z % ps aux | grep 6027
tba               6027 100.1  9.5 417896144 6407216   ??  Rs   11:14AM  17:46.54 /Users/tba/mambaforge/envs/trad/bin/python -m ipykernel_launcher -f /Users/tba/Library/Jupyter/runtime/kernel-9a0d6a96-4e34-44ee-8674-0062e1fb871a.json
tba              10981   0.0  0.0 408626896   1408 s004  S+    7:09PM   0:00.00 grep 6027
(trad) z % /Users/tba/mambaforge/envs/trad/bin/python
Python 3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:37:07) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
(trad) z % sudo RUST_LOG=info py-spy dump --pid=6027
Password:
[2024-01-14T00:09:40.166728000Z INFO  py_spy::config] Command line args: ArgMatches { args: {}, subcommand: Some(SubCommand { id: [hash: B8461C91A07ADDC8], name: "dump", matches: ArgMatches { args: {[hash: CD5160AB4406C427]: MatchedArg { occurs: 1, source: Some(CommandLine), indices: [2], type_id: Some(TypeId { t: 12727883691234724757 }), vals: [[AnyValue { inner: TypeId { t: 12727883691234724757 } }]], raw_vals: [["6027"]], ignore_case: false }}, subcommand: None } }) }
[2024-01-14T00:09:40.200228000Z INFO  py_spy::python_spy] Got virtual memory maps from pid 6027:
Error: Operation timed out (os error 60)
(trad) z % sudo RUST_LOG=debug py-spy dump --pid=6027 2>&1 | tail
[2024-01-14T00:09:44.737458000Z DEBUG goblin::mach] 9 - LoadCommand { offset: 1696, command: Uuid(UuidCommand { cmd: 27, cmdsize: 24, uuid: [245, 205, 43, 255, 93, 224, 60, 79, 186, 217, 249, 55, 38, 123, 119, 131] }) }
[2024-01-14T00:09:44.737459000Z DEBUG goblin::mach] 10 - LoadCommand { offset: 1720, command: Unimplemented(LoadCommandHeader { cmd: 50, cmdsize: 32 }) }
[2024-01-14T00:09:44.737461000Z DEBUG goblin::mach] 11 - LoadCommand { offset: 1752, command: SourceVersion(SourceVersionCommand { cmd: 42, cmdsize: 16, version: 0 }) }
[2024-01-14T00:09:44.737462000Z DEBUG goblin::mach] 12 - LoadCommand { offset: 1768, command: Main(EntryPointCommand { cmd: 2147483688, cmdsize: 24, entryoff: 13808, stacksize: 16777216 }) }
[2024-01-14T00:09:44.737463000Z DEBUG goblin::mach] 13 - LoadCommand { offset: 1792, command: LoadDylib(DylibCommand { cmd: 12, cmdsize: 56, dylib: Dylib { name: 24, timestamp: 2, current_version: 84672512, compatibility_version: 65536 } }) }
[2024-01-14T00:09:44.737466000Z DEBUG goblin::mach] 14 - LoadCommand { offset: 1848, command: FunctionStarts(LinkeditDataCommand { cmd: 38, cmdsize: 16, dataoff: 5230408, datasize: 9096 }) }
[2024-01-14T00:09:44.737467000Z DEBUG goblin::mach] 15 - LoadCommand { offset: 1864, command: DataInCode(LinkeditDataCommand { cmd: 41, cmdsize: 16, dataoff: 5239504, datasize: 0 }) }
[2024-01-14T00:09:44.737468000Z DEBUG goblin::mach] 16 - LoadCommand { offset: 1880, command: CodeSignature(LinkeditDataCommand { cmd: 29, cmdsize: 16, dataoff: 5871952, datasize: 64176 }) }
[2024-01-14T00:09:44.737469000Z DEBUG goblin::mach] 17 - LoadCommand { offset: 1896, command: Rpath(RpathCommand { cmd: 2147483676, cmdsize: 40, path: 12 }) }
Error: Operation timed out (os error 60)
(trad) z %