Skip to content

Segmentation fault when using cyrillic in remote session from Linux to Windows #9882

Closed

Description

@MVKozlov

Tried to remote from Linux (Ubuntu 18.04) to windows (server 2016) and use Cyrillic letters
Get coredump

Steps to reproduce

PS /home> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.1
PSEdition                      Core
GitCommitId                    6.2.1
OS                             Linux 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS /home> $s='фыва'
PS /home> Enter-PSSession  -ComputerName remote-windows.local -Credential $c -Authentication Negotiate

[remote-windows.local]: PS C:\Users> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.1944
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1944
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


[remote-windows.local]: PS C:\Users> $s='фыва'
Failed to convert string with iconv, 7
Segmentation fault (core dumped)

Expected behavior

no fault

Actual behavior

Failed to convert string with iconv, 7
Segmentation fault (core dumped)

Environment data

packages installed for remoting:
  - krb5-multidev
  - libkrb5-dev
  - gss-ntlmssp

Activity

  1. added
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    on Jun 13, 2019
  2. iSazonov commented on Jun 13, 2019

    @iSazonov
    Collaborator

    Could you repo without PSReadline?

  3. MVKozlov commented on Jun 13, 2019

    @MVKozlov
    Author

    Yes, I disable PSReadline on both sides and it still reproduced

    btw

    ubuntu:/home# locale
    LANG=en_US.UTF-8
    LANGUAGE=en_US:en
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE=ru_RU.UTF-8
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    

    collate can be disabled - still repro
    and it reproduced even when I use
    Invoke-Command -File 'utf8_filewith_cyrillic.ps1'

  4. iSazonov commented on Jun 13, 2019

    @iSazonov
    Collaborator

    Why do you connect to 5.1, not PowerShell Core?

  5. MVKozlov commented on Jun 13, 2019

    @MVKozlov
    Author

    Our Win16 servers does not have PSCore installed and installing additional software on these servers prohibited by our policy. Now I workaround this issue by Copy-Item -ToSession and running command remotely from these files instead of direct Invoke-Command -File

  6. iSazonov commented on Jun 13, 2019

    @iSazonov
    Collaborator

    Max Kozlov (@MVKozlov) Thanks! Could you please use a test Win2016 server with PowerShell Core? If it possible please share the test script and full repo steps, and maybe crash dump.

    /cc Paul Higinbotham (@PaulHigin) Could you please look the issue?

  7. MVKozlov commented on Jun 14, 2019

    @MVKozlov
    Author

    I will try to do this on the next week.... and, please, exuse my dumb, where I can find dump ? :)

  8. MVKozlov commented on Jun 18, 2019

    @MVKozlov
    Author

    Tried with PS core with WinSrv16:
    steps:

    PS /home> $session = New-PSSession -ComputerName 192.168.101.82 -Credential $c -Authentication Negotiate -ConfigurationName 'PowerShell.6.2.1'
    PS /home> Invoke-Command -Session $session { $PSVersionTable }
    
    Name                           Value
    ----                           -----
    GitCommitId                    6.2.1
    PSVersion                      6.2.1
    OS                             Microsoft Windows 10.0.14393
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    PSEdition                      Core
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    Platform                       Win32NT
    
    PS /home> Invoke-Command -Session $session { 'абв' }
    Failed to convert string with iconv, 7
    Segmentation fault (core dumped)
  9. iSazonov commented on Jun 18, 2019

    @iSazonov
    Collaborator

    where I can find dump ?

    From https://stackoverflow.com/questions/17965/how-to-generate-a-core-dump-in-linux-on-a-segmentation-fault
    sysctl kernel.core_pattern
    or:
    cat /proc/sys/kernel/core_pattern

  10. MVKozlov commented on Jun 18, 2019

    @MVKozlov
    Author

    Yes, I found a dump(from ubuntu/apport), but how can I send it privately ?

  11. iSazonov commented on Jun 18, 2019

    @iSazonov
    Collaborator
  12. MVKozlov commented on Sep 12, 2019

    @MVKozlov
    Author

    I want to revive the topic a little

    # apport-retrace --stdout /var/crash/_opt_microsoft_powershell_6_pwsh.0.crash
    --- stack trace ---
    #0  0x00007fe6ccc0e455 in WSManRunShellCommandEx (shell=0x7fe6c001bfb8, flags=0, commandId=0x7fe6f6421e24, commandLine=0x7fe6f62a5e6c, args=0x7fe6c8026250, options=0x0, async=0x7fe6c8027300, command=0x7fe6f6402f18) at /home/dantra/git/psl-omi-provider/src/Client.c:1357
            miResult = MI_RESULT_SERVER_LIMITS_EXCEEDED
            errorMessage = 0x7fe6ccc28fb6 "Alloc failed"
            batch = 0x7fe6c802fa80
            value = {boolean = 88 'X', uint8 = 88 'X', sint8 = 88 'X', uint16 = 64344, sint16 = -1192, uint32 = 3355638616, sint32 = -939328680, uint64 = 140629174844248, sint64 = 140629174844248, real32 = -134125.375, real64 = 6.948004409354497e-310, char16 = 64344, datetime = {isTimestamp = 3355638616, u = {timestamp = {year = 32742, month = 299415264, day = 32743, hour = 3221340088, minute = 32742, second = 2307324028, microseconds = 32743, utc = -456846640}, interval = {days = 32742, hours = 299415264, minutes = 32743, seconds = 3221340088, microseconds = 32742, __padding1 = 2307324028, __padding2 = 32743, __padding3 = 3838120656}}}, string = 0x7fe6c802fb58 "78B13140-2115-4FF0-A3B0-47E09D8BB320", instance = 0x7fe6c802fb58, reference = 0x7fe6c802fb58, booleana = {data = 0x7fe6c802fb58 "78B13140-2115-4FF0-A3B0-47E09D8BB320", size = 299415264}, uint8a = {data = 0x7fe6c802fb58 "78B13140-2115-4FF0-A3B0-47E09D8BB320", size = 299415264}, sint8a = {data = 0x7fe6c802fb58 "78B13140-2115-4FF0-A3B0-47E09D8BB320", size = 299415264}, uint16a = {data = 0x7fe6c802fb58, size = 299415264}, sint16a = {data = 0x7fe6c802fb58, size = 299415264}, uint32a = {data = 0x7fe6c802fb58, size = 299415264}, sint32a = {data = 0x7fe6c802fb58, size = 299415264}, uint64a = {data = 0x7fe6c802fb58, size = 299415264}, sint64a = {data = 0x7fe6c802fb58, size = 299415264}, real32a = {data = 0x7fe6c802fb58, size = 299415264}, real64a = {data = 0x7fe6c802fb58, size = 299415264}, char16a = {data = 0x7fe6c802fb58, size = 299415264}, datetimea = {data = 0x7fe6c802fb58, size = 299415264}, stringa = {data = 0x7fe6c802fb58, size = 299415264}, referencea = {data = 0x7fe6c802fb58, size = 299415264}, instancea = {data = 0x7fe6c802fb58, size = 299415264}, array = {data = 0x7fe6c802fb58, size = 299415264}}
            tmpStr = 0x7fe6c802fb80 " 'абвA"
    #1  0x00007fe713dc67b0 in ?? ()
    No symbol table info available.
    #2  0x00007fe6c8027300 in ?? ()
    No symbol table info available.
    #3  0x00007fe6f6402f18 in ?? ()
    No symbol table info available.
    #4  0x0000000000000000 in ?? ()
    No symbol table info available.
  13. PaulHigin commented on Sep 12, 2019

    @PaulHigin
    Contributor

    Unfortunately, cyrillic characters are not supported in this implementation.

  14. iSazonov commented on Sep 13, 2019

    @iSazonov
    Collaborator

    Oh, I very amazing that Unicode is not supported in the scenario.

  15. MVKozlov commented on Sep 14, 2019

    @MVKozlov
    Author

    I overlooked the psl-omi-provider code slightly.
    Seems it support Unicode (as utf8/utf16 conversion).
    So may be overflow error somewhere or double conversion (i'm not C cpecialist :)

  16. iSazonov commented on Sep 16, 2019

    @iSazonov
    Collaborator

    Maybe there is somewhere ASCII P/Invoke.

  17. added
    Issue-BugIssue has been identified as a bug in the product
    and removed
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    on Jan 30, 2020
  18. MVKozlov commented on Oct 19, 2023

    @MVKozlov
    Author

    btw, it not happen with remote connections thru ssh channel

  19. microsoft-github-policy-service commented on Apr 16, 2024

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if there is no further activity in 7 days, the issue will be closed automatically.

    Activity in this case refers only to comments on the issue. If the issue is closed and you are the author, you can re-open the issue using the button below. Please add more information to be considered during retriage. If you are not the author but the issue is impacting you after it has been closed, please submit a new issue with updated details and a link to this issue and the original.

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

    Issue-BugIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreWG-RemotingPSRP issues with any transport layer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions