Closed beerman58 closed 1 month ago
@beerman58 thanks for all the details. I suspect this might have something to do with the default shell used to run terminal commands. I think in my tests I've always used the command prompt. I'll try to test this hypothesis ASAP and see if I can reproduce the issue.
@P403n1x87 thank you for checking that! I believe I did previously change the default shell from PowerShell to Command Prompt to better allow Conda environment activation as described in the note section here.
@berrman58 describes the same problem I have in a system with the following configuration:
OS: -- Ubuntu 22.04.5 LTS
VS Code: -- Version: 1.94.2 -- Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427 -- Date: 2024-10-09T16:08:44.566Z -- Electron: 30.5.1 -- Electron Build ID: 10262041 -- Chromium: 124.0.6367.243 -- Node.js: 20.16.0 -- V8: 12.4.254.20-electron.0 -- OS: Linux x64 5.15.0-124-generic
Austin: -- Version: 3.7.0 -- Installation: via sudo snap install austin --classic -- Austin VS Code extension: v0.17.2
No virtual environment
I believe the problem may be connected to whitespaces in the path of the script being profiled.
For me, the issue occurs when the path to the script is "/home/myself/tes t/script.py" but does not occur when the path is "/home/myself/test/script.py"
In the video that @berrman58 uploaded, I confirmed that the path of his script also contained a whitespace.
This should be fixed in 0.17.3 🤞
@P403n1x87 Confirmed fixed in my previously denoted Windows configuration with Austin VS Code extension v0.17.3 - Thanks!
@P403n1x87 , it is fixed. Thank you for the super fast reply!
When I run Austin in VS Code via the built-in 'Profile with Austin' command (or [shift]+[F5]), the Python script aborts early and no useful data is recorded for the flame graph. However, when I take the exact same command line parameters and run them manually in the VS Code terminal window (piping to file output instead), then the underlying Austin install runs perfectly, profiles the full script, and writes the file nominally. After this, the Austin VS Code extension can then read the output file nominally, including the flame graph and highlighted lines.
So, for my instance of the built-in 'Profile with Austin' command, something in the extension itself is causing the program to abort early, messing up script execution, and therefore messing up script profiling via the built-in command.
(Another possibility I was exploring is that the profiler is not being attached to the correct thread. But this simple mis-attachment cannot explain why the script itself would abort early; in this case, the script would still run, albeit in the background without being profiled. But with longer-running scripts, it's obvious from monitoring my system resources and blocking time that the script itself is aborting very early, without my code even having been ran.)
Attached screen recording video demonstrates 'Profile with Austin' command failure and manual workaround success via terminal window. https://github.com/P403n1x87/austin-vscode/assets/53286846/fc6dfd98-970f-433a-ae05-953d3a8cf9fc
System/Environment Parameters: