[PATCH] Added getrandom() implementation

2018-08-14 Thread Waldemar Kozaczuk
Fixes #989 Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 + include/api/sys/random.h | 1 + include/api/x64/bits/syscall.h | 1 + libc/include/sys/random.h | 13 ++ libc/random.c | 44 ++ linux.cc

Build failed in Jenkins: osv-build-nightly #1562

2018-08-14 Thread jenkins
See Changes: [Nadav Har'El] update apps submodule [jwkozaczuk] Added libc __wcscpy_chk function [Nadav Har'El] Stub implementation of mkfifoat() --

Re: [RFC] Implemented more memory-efficient mmap for ROFS

2018-08-14 Thread Waldek Kozaczuk
I think I understand main gap in my implementation. This patch does not accommodate Copy-On-Write with MAP_PRIVATE which probably happens especially with elf resolution. To fix I need to make sure that any attempt to write to the ROFS cache segment triggers creating and copying to new page.

Re: [COMMIT osv master] Stub implementation of mkfifoat()

2018-08-14 Thread Waldek Kozaczuk
I think I understand why it all behaves like this. Once I read about -z now (BIND_NOW or disable lazy loading) it all makes sense. Does it mean that java and python that come with Fedora distribution are always compiled with BIND_NOW on? What is that? Is it because it speeds up execution of

Re: [COMMIT osv master] Stub implementation of mkfifoat()

2018-08-14 Thread Waldek Kozaczuk
Maybe it comes from the fact each distribution and version comes with different version of dependent libraries Python depends on. And some of of those libraries use getrandom() from libc some call system call 318 and some use other functions mentioned in

Re: [COMMIT osv master] Stub implementation of mkfifoat()

2018-08-14 Thread Waldek Kozaczuk
It is very interesting because I just managed to manually add Python 3.6 on my Ubuntu 16.04 VM, tweaked python3x/GET to use python3.6 to discover where python is installed and I got Python 3.6 running WITHOUT having to add getrandom call: OSv v0.51.0-18-g2138522 eth0: 192.168.122.15 syscall():

Re: [PATCH] Added Python 3 app

2018-08-14 Thread Waldek Kozaczuk
Are you saying that once you installed "python3-devel" library "-lpython${PYTHON_VERSION}m" works for you? In any case I will update the README to mention need to install python-devel/python3-devel and python-dev/python3-dev on Fedora and Ubuntu respectively. On Tuesday, August 14, 2018 at

Re: [PATCH] Improved python27

2018-08-14 Thread Asias He
Cheers! I was running jpython on osv for python applications in the past. Good to see this! On Tue, Aug 14, 2018 at 11:42 AM, Waldemar Kozaczuk wrote: > This patch renames python27 to python2x and improves it > by discovering Python home directory by reading sys.* variables. > > Signed-off-by:

Re: [PATCH] Added Python 3 app

2018-08-14 Thread Nadav Har'El
I committed this, but it doesn't compile on Fedora 28... On Fedora, you can't compile with -lpython3.6m, you need just "-lpython3". Can you please check the following patch on your setup? diff --git a/python3x/GET b/python3x/GET index af03cb2..f437a0f 100755 --- a/python3x/GET +++ b/python3x/GET

[COMMIT osv-apps master] Added Python 3 app

2018-08-14 Thread Commit Bot
From: Waldemar Kozaczuk Committer: Nadav Har'El Branch: master Added Python 3 app Signed-off-by: Waldemar Kozaczuk Message-Id: <20180814114702.22458-1-jwkozac...@gmail.com> --- diff --git a/python3x/GET b/python3x/GET --- a/python3x/GET +++ b/python3x/GET @@ -0,0 +1,60 @@ +#!/usr/bin/env

Re: [PATCH] Improved python27

2018-08-14 Thread Waldek Kozaczuk
It works. Thanks. On Tuesday, August 14, 2018 at 6:52:51 AM UTC-4, Nadav Har'El wrote: > > > On Tue, Aug 14, 2018 at 1:47 PM, Waldek Kozaczuk > wrote: > >> This seems to be distribution specific. The original python27 did not >> work on my Ubuntu 18.04 because of >>

Re: [PATCH] Improved python27

2018-08-14 Thread Nadav Har'El
On Tue, Aug 14, 2018 at 1:47 PM, Waldek Kozaczuk wrote: > This seems to be distribution specific. The original python27 did not work > on my Ubuntu 18.04 because of ‘/lib64/“-assumed-location-of-python-on-host > directory problem. Which I fixed by using os.* values from python itself. > > There

Re: [PATCH] Improved python27

2018-08-14 Thread Waldek Kozaczuk
This seems to be distribution specific. The original python27 did not work on my Ubuntu 18.04 because of ‘/lib64/“-assumed-location-of-python-on-host directory problem. Which I fixed by using os.* values from python itself. There are possibly other fedora vs ubuntu discrepancies which this

[COMMIT osv master] Added libc __wcscpy_chk function

2018-08-14 Thread Commit Bot
From: Waldemar Kozaczuk Committer: Nadav Har'El Branch: master Added libc __wcscpy_chk function This patch adds libc __wcscpy_chk needed by Python 3. Please see http://refspecs.linux-foundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc---wcscpy-chk-1.html for details.

Re: [PATCH 08/16] bsd: OSv API support for IPv6

2018-08-14 Thread Nadav Har'El
On Tue, Aug 14, 2018 at 5:03 AM, Myers, Charles wrote: > It was left as a FIXME because I wasn’t sure how to best address this > issue. > > > > AF_INET is just lucky because it is the same for Linux and FreeBSD (2). > > AF_INET6 is 28 in FreeBSD and 10 on Linux. > > > > AF_INET6 could be changed

[COMMIT osv master] update apps submodule

2018-08-14 Thread Commit Bot
From: Nadav Har'El Committer: Nadav Har'El Branch: master update apps submodule Signed-off-by: Nadav Har'El --- diff --git a/apps b/apps --- a/apps +++ b/apps @@ -1 +1 @@ -Subproject commit f092c50bab62d08ce9e7218d051e77134cd833e3 +Subproject commit 56f801407ccfd7cb43d173a548feeb7a555d0006

[COMMIT osv-apps master] python2x: also copy stuff from /usr/lib64

2018-08-14 Thread Commit Bot
From: Nadav Har'El Committer: Nadav Har'El Branch: master python2x: also copy stuff from /usr/lib64 On Fedora 28, there is both /usr/lib/python2.7 and /usr/lib64/python2.7, and stuff from both directories need to be copied to the image to work. So change the script to loop over

Re: [PATCH] Improved python27

2018-08-14 Thread Nadav Har'El
On Tue, Aug 14, 2018 at 6:42 AM, Waldemar Kozaczuk wrote: > This patch renames python27 to python2x and improves it > by discovering Python home directory by reading sys.* variables. > I committed this, but it doesn't seem to actually work for me, on Fedora 28: $ scripts/run.py -e /python OSv

Re: getrandom/sys_getrandom

2018-08-14 Thread Nadav Har'El
On Tue, Aug 14, 2018 at 7:16 AM, Waldek Kozaczuk wrote: > I managed to get Python 3.5 working on OSv but reporting missing 318 > syscall. With version 3.6 and above Python is trying to invoke getrandom > which obviously fails due to missing symbol. > Yes, both are getrandom() and it is indeed