New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 898111 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

garcon - OpenTerminal - passing arguments not working

Reported by jfgio...@gmail.com, Oct 23

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 11151.4.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.8 Safari/537.36
Platform: 11151.4.0 (Official Build) dev-channel eve

Steps to reproduce the problem:
from cmd line or .desktop entry:

1. "x-terminal-emulator" works ok
2. "x-terminal-emulator python" works ok
3. "x-terminal-emulator /path/to/something" doesn't work
4. "x-terminal-emulator python /path/to/something.py" doesn't works ok

What is the expected behavior?

What went wrong?
something wrong in parsing arguments ?

Did this work before? N/A 

Chrome version: 71.0.3578.8  Channel: dev
OS Version: 11151.4.0
Flash Version:
 
also check journalctl for releated vshd.elf errors.
Components: OS>Systems>Containers
Owner: sidereal@google.com
Seems to work as expected on tip of tree.

Running "x-terminal-emulator" produces a new terminal window.

Running "x-terminal-emulator <some command>" creates a new terminal window
that executes that command and then closes. This is somewhat unhelpful if the
command fails, but still normal behavior for a terminal emulator.

Note that "python" isn't available by default in the container, you should use "python3" instead. Because of this "x-terminal-emulator python" will cause
a terminal window to briefly appear before closing instead of the expected
python command prompt.
Status: Closed (was: Unconfirmed)
Feel free to re-open this with more information if you think the above is incorrect.
pyton was just an example, the problem is when <some command> isn't just a word:

try:
x-terminal-emulator xterm
should work

then
x-terminal-emulator /usr/bin/xterm
doesn't work

then check logs:
sudo journalctl -b -t vshd.elf -e
Cc: jkardatzke@chromium.org smbar...@chromium.org
Labels: Proj-Containers
Status: Available (was: Closed)
I can confirm this doesn't work on 11242.0.0.  You end up with an error in journalctl of the nature:

vshd.elf: Failed to exec '???????????term': No such file or directory

And the bad chars in it change each time you exec it.
Cc: nverne@chromium.org
It looks like this is an issue in the character escaping that occurs between the original command and being received by the crostini terminal.
Owner: nverne@google.com
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f02661f81d53c8b3f24a455839dfcf1c356b271a

commit f02661f81d53c8b3f24a455839dfcf1c356b271a
Author: Nicholas Verne <nverne@chromium.org>
Date: Tue Nov 20 00:57:42 2018

Fix up terminal args passed to crosh in its args array.

When Crostini users invoke x-terminal-emulator $CMD, the contents of CMD
are eventually passed by CrostiniManager in an args[] array to crosh as part
of its URL.

Fixed in this CL: incorrect usage of vector<StringPiece>.
We were adding more pieces in line 1065 which were derived from temporaries
(return values of net::Escape...). The temporaries were thrown away but the
pieces still pointed to the same memory and we sent nonsense to
base::JoinString().

Bug:  898111 
Change-Id: If5d3ffcb6ab28d01698ee48cd7fd3d2230381f95
Reviewed-on: https://chromium-review.googlesource.com/c/1341282
Commit-Queue: Nicholas Verne <nverne@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609539}
[modify] https://crrev.com/f02661f81d53c8b3f24a455839dfcf1c356b271a/chrome/browser/chromeos/crostini/crostini_manager.cc

Status: Fixed (was: Available)

Sign in to add a comment