Skip to content

Stack overflow error when starting pwsh with -Command #24461

Closed

Description

Prerequisites

Steps to reproduce

Run running pwsh on a .ps1 script or with the --comand failes from a zsh or bash shell.

Expected behavior

PS> pwsh  -Command "Write-Host 'Test'"`
Test

Actual behavior

PS> pwsh  -Command "Write-Host 'Test'"`
Stack overflow.
[1]    22758 abort      pwsh -Command "Write-Host 'Test'"

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.5
PSEdition                      Core
GitCommitId                    7.4.5
OS                             Darwin 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:36 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
---
shell: zsh
os: Macos Sequoia 15.0.1
Chip: Apple M2 Pro

Visuals

CleanShot 2024-10-17 at 09 52 44@2x

Activity

  1. added
    Needs-Triage
    on Oct 17, 2024
  2. 237dmitry commented on Oct 17, 2024

    @237dmitry

    It works in this environment:

    ss

  3. vexx32 commented on Oct 17, 2024

    @vexx32
    Collaborator

    Also working here on MacOS Ventura 🤔

  4. mklement0 commented on Oct 17, 2024

    @mklement0
    Contributor

    Ditto for me on the same macOS as yours, Sindre J. I. Sivertsen (@sjsivert) (15.0.1); the only obvious difference that my machine has an M1 Pro chip, but I wouldn't expect that to make a difference.

    Did you perhaps install the x86-64 version of PowerShell?
    [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture should report Arm64 for you, not X64.

  5. sjsivert commented on Oct 18, 2024

    @sjsivert
    Author

    Ditto for me on the same macOS as yours, Sindre J. I. Sivertsen (@sjsivert) (15.0.1); the only obvious difference that my machine has an M1 Pro chip, but I wouldn't expect that to make a difference.

    Did you perhaps install the x86-64 version of PowerShell? [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture should report Arm64 for you, not X64.
    CleanShot 2024-10-18 at 16 28 36@2x

    Running ARM64.

    One weird thing I forgot to mention is that this broke out of the blue—not after any OS or PowerShell update. I was literally iterating on a PowerShell script when it just stopped working.

    I have tried reinstalling PowerShell with Homebrew. Maybe Homebrew leaves some state even after an uninstallation?

  6. sjsivert commented on Oct 24, 2024

    @sjsivert
    Author

    This is no longer an issue in Poweshell version 7.4.6!

  7. microsoft-github-policy-service commented on Oct 24, 2024

    @microsoft-github-policy-service
    Contributor

    📣 Hey Sindre J. I. Sivertsen (@sjsivert), how did we do? We would love to hear your feedback with the link below! 🗣️

    🔗 https://aka.ms/PSRepoFeedback

  8. removed
    Needs-Triage
    on Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions