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

Running 'Profile with Austin' command fails without error message, causes script to abort at start #62

Closed
beerman58 opened this issue Jun 19, 2024 · 6 comments

Comments

@beerman58
Copy link

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:

  • OS:
    - Windows 10 Pro, Version 22H2, Build 19045.4529
  • VS Code:
    - Version: 1.91.0-insider (user setup)
    - Commit: 0da59bdde2339d6ba632524dc8f3fb6f4b8a2bcb
    - Date: 2024-06-14T10:07:53.538Z
    - Electron: 29.4.0
    - ElectronBuildId: 9593362
    - Chromium: 122.0.6261.156
    - Node.js: 20.9.0
    - V8: 12.2.281.27-electron.0
    - OS: Windows_NT x64 10.0.19045
  • Austin:
    - Version: 3.6.0
    - Installation: via austin-3.6.0-win64.msi
  • Austin VS Code extension v0.17.2
  • Conda Virtual Environment
    - Installation: Mambaforge 23.1.0-1
    - Usage: unnamed virtual environment, as created via VS Code’s built-in “Conda” command
@P403n1x87
Copy link
Owner

@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.

@beerman58
Copy link
Author

@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.

@thomasoliveira
Copy link

@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.

@P403n1x87
Copy link
Owner

This should be fixed in 0.17.3 🤞

This was referenced Oct 20, 2024
@beerman58
Copy link
Author

@P403n1x87 Confirmed fixed in my previously denoted Windows configuration with Austin VS Code extension v0.17.3 - Thanks!

@thomasoliveira
Copy link

@P403n1x87 , it is fixed. Thank you for the super fast reply!

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

3 participants