-
Notifications
You must be signed in to change notification settings - Fork 689
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
Extract VNC changes from Tor Browser functional test branch #4288
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4288 +/- ##
===========================================
- Coverage 84.7% 84.63% -0.08%
===========================================
Files 43 43
Lines 2785 2785
Branches 304 304
===========================================
- Hits 2359 2357 -2
- Misses 358 359 +1
- Partials 68 69 +1
Continue to review full report at Codecov.
|
Works on Debian 9. Letting others confirm on other OSes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would wait before merging this PR. Nothing looks wrong, but, while testing, I got the following buffer-overflow error.
*** buffer overflow detected ***: vncpasswd terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f82480fa7e5]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f824819c15c]
/lib/x86_64-linux-gnu/libc.so.6(+0x117160)[0x7f824819a160]
vncpasswd[0x40112d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f82480a3830]
vncpasswd[0x401379]
======= Memory map: ========
00400000-00404000 r-xp 00000000 fd:01 28520571 /usr/bin/tightvncpasswd
00603000-00604000 r--p 00003000 fd:01 28520571 /usr/bin/tightvncpasswd
00604000-00605000 rw-p 00004000 fd:01 28520571 /usr/bin/tightvncpasswd
00baa000-00bcc000 rw-p 00000000 00:00 0 [heap]
7f8247e6d000-7f8247e83000 r-xp 00000000 fd:01 28341163 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8247e83000-7f8248082000 ---p 00016000 fd:01 28341163 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8248082000-7f8248083000 rw-p 00015000 fd:01 28341163 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8248083000-7f8248243000 r-xp 00000000 fd:01 28767136 /lib/x86_64-linux-gnu/libc-2.23.so
7f8248243000-7f8248443000 ---p 001c0000 fd:01 28767136 /lib/x86_64-linux-gnu/libc-2.23.so
7f8248443000-7f8248447000 r--p 001c0000 fd:01 28767136 /lib/x86_64-linux-gnu/libc-2.23.so
7f8248447000-7f8248449000 rw-p 001c4000 fd:01 28767136 /lib/x86_64-linux-gnu/libc-2.23.so
7f8248449000-7f824844d000 rw-p 00000000 00:00 0
7f824844d000-7f8248473000 r-xp 00000000 fd:01 28767125 /lib/x86_64-linux-gnu/ld-2.23.so
7f8248665000-7f8248668000 rw-p 00000000 00:00 0
7f8248671000-7f8248672000 rw-p 00000000 00:00 0
7f8248672000-7f8248673000 r--p 00025000 fd:01 28767125 /lib/x86_64-linux-gnu/ld-2.23.so
7f8248673000-7f8248674000 rw-p 00026000 fd:01 28767125 /lib/x86_64-linux-gnu/ld-2.23.so
7f8248674000-7f8248675000 rw-p 00000000 00:00 0
7fffa8f69000-7fffa8f8a000 rw-p 00000000 00:00 0 [stack]
7fffa8fa6000-7fffa8fa9000 r--p 00000000 00:00 0 [vvar]
7fffa8fa9000-7fffa8fab000 r-xp 00000000 00:00 0 [vdso]
./bin/dev-deps: line 13: 7 Done echo "freedom"
8 Aborted (core dumped) | vncpasswd -f > /tmp/vncpasswd
Retrying write of VNC credentials
write static/css/journalist.css
write static/css/journalist.css.map
write static/css/source.css
write static/css/source.css.map
@kushaldas Yes, |
Only segfault is different, and a |
In this case, I don't think it's that scary, as
Open to suggestions. I'd probably pick the first option. |
I've reverted to x11vnc from tightvncserver. The reasons for the switch have been lost to time, the tests work and are visible with x11vnc, and it does support the passwords required on Macs, so I'd rather switch back than have to maintain workarounds for tightvncserver bugs. Works for me, @kushaldas and @heartsucker, please check again when you have time, and I'll find a Mac user to test there as well. |
Basically installed this because it can be used with pyvirtualdisplay as a backend AND because it brings in the Xvnc tooling which will start an X11 server as well as a VNC server. (cherry picked from commit af16906)
Had to remove x11 display logic inside test scaffolding (initially tried to integrate it there but it kept building and destroying the VNC server per test). Made a VNC helper command with support for GNOME desktop and macOS (havent tested it on mac yet). Updated the docs (cherry picked from commit 0a9567b)
(cherry picked from commit b53b657)
(cherry picked from commit f7aad63)
In dev-deps, work around random vncpasswd seg faults by retrying. In vnc-docker-connect.sh, suggest the installation of virt-viewer if it's missing. Add the continuation backslash I missed in dev-shell.
The vncpasswd utility of tightvncserver contains buffer overflows, and the reasons for switching to it have been lost, so rather than add workarounds for it, I'm just switching back to x11vnc. While updating the Dockerfiles, update the base Ubuntu images.
@rmol pushed updated changes as requested
Failing for me on Qubes in a debian-9-based standaloneVM - docker output includes the following:
|
@zenmonkeykstop Yeah, I started running into this in the big all-tbb merge too. I think the problem is that Xvfb sometimes hasn't fully started by the time we start x11vnc. Reordering things in run-test seems to have fixed it, but I'm planning on doing something more reliable. |
@rmol fair enough, like maybe a test for xvfb's availability with a couple of sleep/retries? FWIW, same issue under OS X |
Added a |
I've added a wait for Xvfb to be fully available. |
Confirmed that VNC working with no issues on both Qubes(debian-9) and OS X with this fix. LGTM! |
Real lint failure for a change:
|
VNC still working fine on Qubes(debian-9) and OS X with the shellcheck fix above. 👍 from me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rmol this looks great. Went through the test plan and all 21 tests have passed under Debian 9. Some tests fail under a grsec kernel, due to missing PaX flags. I suspect those were there before, and I don't think we should block merge on that.
|
||
if [ ! "$(which remote-viewer)" ] | ||
then | ||
printf "\nError: We use the remote-viewer utility to reach Docker via VNC,\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a very helpful message :)
@@ -40,12 +40,14 @@ function docker_run() { | |||
|
|||
find . \( -name '*.pyc' -o -name __pycache__ \) -delete | |||
docker run \ | |||
--rm \ | |||
-p 127.0.0.1:5901:5901 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5901 is only exposed only to localhost 👍
# ubuntu:14.04 as of 2019-01-22 | ||
FROM ubuntu@sha256:cac55e5d97fad634d954d00a5c2a56d80576a08dcc01036011f26b88263f1578 | ||
# ubuntu 14.04 image from 2019-03-12 | ||
FROM ubuntu@sha256:6612de24437f6f01d6a2988ed9a36b3603df06e8d2c0493678f3ee696bc4bb2d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# ubuntu 16.04 image - 2019-01-22 | ||
FROM ubuntu@sha256:e4a134999bea4abb4a27bc437e6118fdddfb172e1b9d683129b74d254af51675 | ||
# ubuntu 16.04 image from 2019-03-12 | ||
FROM ubuntu@sha256:58d0da8bc2f434983c6ca4713b08be00ff5586eb5cdff47bcde4b2e88fd40f88 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
fi | ||
|
||
rv_config="${TMPDIR:-/tmp}/func-vnc.ini" | ||
echo -e "[virt-viewer]\ntype=vnc\nhost=${SD_DOCKER_IP}\nport=5901\npassword=freedom" > "${rv_config}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given VNC is exposed only to localhost and it's a dev container/test data, I think this is fine. We should follow up with a better way (maybe automatically generate a password?) in the future.
Status
Ready for review
Description of Changes
These changes were cherry-picked from the tbb-0.12.0 branch. The VNC server used in the functional test container is switched to tightvncserver, and scripts are changed to ensure that it can be reached on both Mac and Linux developer machines.
Fixes #4287.
Testing
Run the functional tests with
securedrop/bin/dev-shell bin/run-test -v tests/functional
. In another local shell, runmake -C securedrop func-vnc
to verify that you can connect to the test container with VNC and watch the functional tests run.Checklist
If you made non-trivial code changes: