Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

New state of 'nil' is invalid, when sending byte 0x90 followed by any other to stdio #695

Open
averri opened this issue Sep 29, 2017 · 7 comments

Comments

@averri
Copy link

averri commented Sep 29, 2017

Consider the following commands:

docker run centos printf '\x90\x00'
docker run centos echo ┐

Running any of that commands on Docker toolbox on Windows 7 (MINGW terminal) will print:

New state of 'nil' is invalid.

I have discovered that the byte 0x90 followed by any other will cause the problem.

If running just printf '\x90\x00' inside the container, the shell will exit and the same message will be printed. The problem does not occur when running on Docker on Linux.

The char correspond to the UTF-8 0xE2 0x94 0x90, so in the command echo ┐, the complete sequence is 0xE2 0x94 0x90 0x0A, again, the 0x90 followed by another byte.

@averri averri changed the title New state of 'nil' is invalid, when printing the char “Д on any Docker container on Windows 7 New state of 'nil' is invalid, when sending byte 0x90 followed by any other to stdio Sep 30, 2017
@duthng
Copy link

duthng commented Oct 30, 2017

@averri how would we fix this?

@geosava
Copy link

geosava commented Dec 6, 2017

Hello everyone

As I have wrote here : jhipster/generator-jhipster#5950
I am facing the same issue in windows 10 and the latest Docker for Windows CE.
As I understand it is a problem with docker's terminal emulation on windows.
Is there a know solution to overcome this problem on windows systems?
As I read here moby/moby#22480 a solution would be to install SSHd in the docker container to access it through ssh and not docker terminal.
Can anyone validate this is a working solution?

Thanks.

@DHager
Copy link

DHager commented Jan 9, 2018

Ran into the same issue on Windows 7 with Docker Quickstart Terminal, docker version 1.12.2. Thanks @averri for the super-easy repro step.

Off-topic: In my case it was from some PHP code in symfony/flex (which I'll open a separate issue for) that attempts to print out a message about adding a star on github, and uses the symbol:

U+2B50 | ⭐ | \xe2\xad\x90 | WHITE MEDIUM STAR

fabpot added a commit to symfony/flex that referenced this issue Jan 10, 2018
…cker (DHager)

This PR was merged into the 1.0-dev branch.

Discussion
----------

Workaround: Avoid emojis which cause terminal failures in Docker

Sending certain unicode values to STDOUT may cause Docker terminals to abruptly quit and disconnect for some users, as noted in docker-archive/toolbox#695  and moby/moby#22345. In this particular case the issue is triggered by the emoji star (U+2B50) which was added in #262 / 0a45ec9 .

While this is **not a bug in Flex**, I still recommend skipping the cosmetic emojis, since their appeal is probably outweighed by the impact and users and the potential that some users will incorrectly blame Flex when `composer update` disconnects their terminal halfway through the "thanks reminder."

Commits
-------

bc74172 Workaround: Avoid unicode characters in output which cause terminals to quit in some Docker installations.
This was referenced Jan 10, 2018
nicolas-grekas added a commit to symfony/thanks that referenced this issue Jan 10, 2018
This PR was merged into the 1.0-dev branch.

Discussion
----------

Replace ⭐ by ★

The ⭐ emoji contains the `\x90` byte that breaks Docker toolbox on Windows.
Let's use ★ instead.

See docker-archive/toolbox#695

Commits
-------

9b894cd Replace ⭐ by ★
fabpot added a commit to symfony/flex that referenced this issue Jan 10, 2018
This PR was squashed before being merged into the 1.0-dev branch (closes #283).

Discussion
----------

★

Same as symfony/thanks#34

Reverts #280 and replaces the breaking character by another one:

The ⭐ emoji contains the \x90 byte that breaks Docker toolbox on Windows (see docker-archive/toolbox#695).
Let's use ★ instead.

Commits
-------

558a091
@keegancsmith
Copy link

This is affecting Sourcegraph as well. We print a logo in the console on startup, but docker toolbox is crashing. https://github.com/sourcegraph/sourcegraph/issues/398

@boly38
Copy link

boly38 commented Jun 21, 2019

I was able to reproduce with non latin chars like this russian word французских.

If I workaround this by dropping \x90, then data is also corrupted (my example became -’)
BTW docker console doesn't crash.

My 2 cents

@rfaelens
Copy link

rfaelens commented Jan 8, 2020

This is affecting Docker build of R packages, as testthat uses unicode symbols by default to report progress.

@javagl
Copy link

javagl commented Jul 20, 2020

For those looking for the Wisdom of the Ancients here: In some cases, a workaround can be to route the output into the void and back, as in

yourCommandThatPrintsSomething | cat

so that some output appears at the console.

Doing a

yourCommandThatPrintsSomething >/dev/null

swallows the output completely, preventing the shutdown at least. With

yourCommandThatPrintsSomething > output.txt

you might also be able to keep output.txt open in a text editor and use this text editor as some sort of console. Ouch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants