Re: [osv-dev] Booting Bare Metal

2019-12-03 Thread Geraldo Netto
Hello!


I might be saying some non sense
But maybe we don't have all the bare minimum drivers to boot it up from
bare metal
Maybe one strategy would be to DD the image to a disk and try to boot from
it before trying grub configuration?


Keep Rocking,
Geraldo Netto

Em ter, 3 de dez de 2019 13:25, Matthew Weekley 
escreveu:

> After further experimentation I still haven’t had any luck. When trying to
> boot it via USB, it appears I’m going into a kernel panic...
>
> I can not tell if I am missing parameters in my grub.cfg or not... Does
> anyone have any thoughts about what could be causing that?
>
> What I am doing is making the iso, putting it on the usb (kind of cheating
> as I just say the usb is another partition, sdb) and then boot that
> partition from grub menu.
>
> Any help is much appreciated!
>
> On Nov 26, 2019, at 1:56 PM, Matthew Weekley 
> wrote:
>
> 
> My current grub.cfg:
>
> menuentry “OSv”{
> linux /boot/service/release.x64/vmlinuz.bin
> boot
> }
>
> When I go to boot from within grub, I get a critical error :(
>
> Any thoughts why??
>
> On Nov 26, 2019, at 10:06 AM, Matthew Weekley 
> wrote:
>
> 
> Corrected that but that lead to a critical error when trying to boot it.
>
> Do I need to specify any further files below the vmlinuz file?
>
> On Nov 26, 2019, at 9:56 AM, Pekka Enberg  wrote:
>
> 
> On Tue, Nov 26, 2019 at 4:50 PM Matthew Weekley 
> wrote:
>
>> My current grub is
>>
>> menuentry “OSv” {
>> multiboot /boots/service/release.x64/vmlinuz.bin
>>
>
>^^^ this needs to "linux", instead of "multiboot".
>
>
>> boot
>> }
>>
>> This returns “no multiboot header found. You need to load the kernel
>> first”
>>
>
> Yes, because there's no Multiboot support in OSv anymore. The "vmlinuz"
> file follows the Linux boot protocol described here:
>
> https://www.kernel.org/doc/Documentation/x86/boot.txt
>
> - Pekka
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "OSv Development" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/osv-dev/jEMfRZ0GtSc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> osv-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osv-dev/209F20AC-D16A-4BC3-9960-7BE14BA0CB03%40comcast.net
> <https://groups.google.com/d/msgid/osv-dev/209F20AC-D16A-4BC3-9960-7BE14BA0CB03%40comcast.net?utm_medium=email_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osv-dev/88E15BA6-68EB-4108-9BFD-18262350E918%40comcast.net
> <https://groups.google.com/d/msgid/osv-dev/88E15BA6-68EB-4108-9BFD-18262350E918%40comcast.net?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CACepeQ8pPanD%2B6KPkVm-%3DZvNWzmmL4HqFffRAJPQ4kmW2ReKSw%40mail.gmail.com.


Re: [osv-dev] Re: Python 3 Scikitlearn

2019-11-02 Thread Geraldo Netto
Dear Henrique/Friends,

Maybe we could "reshape" freebsd[1]/musl libc implementation [2]
Of course, it might take a while but it's doable

[1] https://github.com/freebsd/freebsd/search?q=sem_open_q=sem_open
[2] https://git.musl-libc.org/cgit/musl/tree/src/thread


Keep Rocking,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
site: http://exdev.sf.net/
github: https://github.com/geraldo-netto
linkedin: https://www.linkedin.com/in/geraldonetto/
facebook: https://web.facebook.com/geraldo.netto.161

On Sat, 2 Nov 2019 at 10:13, Henrique Fingler  wrote:
>
>  Welp, spoke too soon. I was able to make it run by recompiling sklearn 
> without openmp using the SKLEARN_NO_OPENMP flag.   
> (https://scikit-learn.org/dev/developers/advanced_installation.html)
>  If I knew c++ better I'd implement a real sem_open, although I'm almost sure 
> stubbing it is enough for sklearn.
>
> On Saturday, November 2, 2019 at 2:49:18 AM UTC-5, Henrique Fingler wrote:
>>
>>  Hi Waldek,
>>
>>  Any update on this issue? I implemented a extremely horrible sem_open and 
>> stubbed close and unlink, but I'm getting a mmap fault somewhere in 
>> LogisticRegression fit 
>> (https://github.com/scikit-learn/scikit-learn/blob/1495f6924/sklearn/linear_model/logistic.py#L1466).
>>
>> 0x4046537b 
>> 0x404653ea > exception_frame*)+26>
>> 0x4032f509 
>> 0x40393a36 
>> 0x40392876 
>> 0x10c11e5f 
>>
>>
>> On Wednesday, August 28, 2019 at 10:24:42 AM UTC-5, Waldek Kozaczuk wrote:
>>>
>>> Hi,
>>>
>>> Given you are the second person asking about it, I started implementing it 
>>> last night given it is not that difficult. But it would still take a bit of 
>>> time to make it correct and covered with unit tests.
>>>
>>> However, I peeked more at the details of 
>>> https://github.com/cloudius-systems/osv/issues/1025 and realized 
>>> scikit-learn uses the multiprocessing module 
>>> (https://docs.python.org/3.4/library/multiprocessing.html?highlight=process)
>>>  which allows multiprocessing based on forking new processes vs 
>>> multithreading. OSv supports pthreads very well even on multiple cores 
>>> (SMP) but being unikernel it does NOT and never intended to support 
>>> fork()/spawn(). That being said I suspect that even if implemented name 
>>> semaphores you will hit the fork() obstacle down the road.
>>>
>>> Based on this doc - 
>>> https://scipy.github.io/old-wiki/pages/ParallelProgramming, and 
>>> https://scipy.github.io/old-wiki/pages/Cookbook/Multithreading.html you can 
>>> use SciPy with multithreading which should work on OSv.
>>>
>>> There is also GraalVM Python which is supposed to run python much faster 
>>> and is focused on SciPy but it is still experimental - 
>>> https://www.graalvm.org/docs/reference-manual/languages/python/. I have had 
>>> a lot of luck running native images (JVM code AOT-compiled to machine code) 
>>> on OSv.
>>>
>>> Regards,
>>> Waldek
>>>
>>> On Tuesday, August 27, 2019 at 10:21:22 PM UTC-4, Michael De Lucia wrote:
>>>>
>>>> Waldek,
>>>>
>>>>
>>>>
>>>> I finally got sklearn installed and got to the same issue you pointed out 
>>>> described here - https://github.com/cloudius-systems/osv/issues/1025
>>>>
>>>>
>>>>
>>>> Has this been implemented yet?
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>>
>>>>
>>>> Mike
>>>>
>>>>
>>>>
>>>> From: osv...@googlegroups.com  On Behalf Of 
>>>> Waldek Kozaczuk
>>>> Sent: Tuesday, August 27, 2019 11:40 AM
>>>> To: OSv Development 
>>>> Subject: Re: [osv-dev] Re: Python 3 Scikitlearn
>>>>
>>>>
>>>>
>>>> It looks like you have one of the libraries, 
>>>> libopenblasp-r0-2ecf47d5.3.7.dev.so depends on, missing.
>>>>
>>>>
>>>>
>>>> You can use:
>>>>
>>>>
>>>>
>>>> ./scripts/manifest_from_host.sh -l 
>>>> /lib/python3.7/numpy/.libs/libopenblasp-r0-2ecf47d5.3.7.dev.so
>>>>
>>>>
>>>>
>>>> to see which libraries have to be added.
>>>>
>>>>
>>>> On Tuesday, August 27, 2019 at 11:15:51 AM UTC-4, Michael De Lucia wrote:
>>>>
>>>> Hi 

Re: [osv-dev] Resurrecting ARM support

2019-06-27 Thread Geraldo Netto
Hey Waldek/Friends!

First of all great work in the last few weeks :)
While I also wish to see OSv on Raspberry Pi (especially now that we have
rasppi4)
But I would suggest deprecating ARM port due to the lack of manpower to
contribute :(
(and even limit the number of VMs OSv can run for the same reason)

I know it's a radical approach,
but considering that in practise only You and Nadav work on OSv
It seems the best strategy for the moment


Keep Rocking/Semper Fidelis,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
site: http://exdev.sf.net/
github: https://github.com/geraldo-netto
linkedin: https://www.linkedin.com/in/geraldonetto/
facebook: https://web.facebook.com/geraldo.netto.161


On Thu, 27 Jun 2019 at 14:25, Waldek Kozaczuk  wrote:

> Hi,
>
> Hopefully, soon I will be cutting new release of OSv. But thinking about
> what next, I was wondering if anyone is interested in collaborating on
> getting OSv to run on ARM.
>
> It is my understanding that OSv at least builds for aarch64 but does not
> really boot per this email exchange from March -
> https://groups.google.com/d/msg/osv-dev/Z-1sBWv6yxc/s4bKbSTQBAAJ. It is
> also my understanding that 2 teams used to work on OSv support for ARM
> (xen?). But I do not know how far they got - were they able to make OSv
> boot with network and block devices?
>
> Is my impression correct that OSv is not that far (at least fundamentally)
> from being able to run on arm on both XEN and KVM (I personally care about
> KVM) ? Is it mostly tying loose ends and backporting all the enhancements
> (syscall stack for golang, etc) from x64 to aarch64? Can somebody list
> areas of code/functionality where the gaps are?
>
> A week or two ago firecracker team announced beta support for ARM . It
> would be nice to get OSv to run on firecracker on arm :-)
>
> Waldek
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osv-dev/ae380981-78d2-4a75-8ad3-3f6a73110c43%40googlegroups.com
> <https://groups.google.com/d/msgid/osv-dev/ae380981-78d2-4a75-8ad3-3f6a73110c43%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CACepeQ-NbUAPkod5wpcgHpo6gsvGMSMmqf-sEG6FtXHskNzw9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [osv-dev] Modernizing and cleaning build system

2019-03-31 Thread Geraldo Netto
Hi!

I might be saying some nonsense, but...

On Sun, 31 Mar 2019 at 17:25, Nadav Har'El  wrote:

> n Sun, Mar 31, 2019 at 5:58 PM Waldek Kozaczuk 
> wrote:
>
>> Here is a list of things we should try to do:
>>
>
> I think there are two very different issues involved here, that don't
> really need the same solution:
> The OSv kernel's makefile, and the "apps" build system.
>
>
>>- Propose and define model app layout (Makefile, GET, ...) under
>>osv-apps
>>   - Typically each app has GET shell script, Makefile and module.py:
>>  - GET typically downloads ad puts source files into upstream
>>  directory (sometimes using latest script)
>>  - Makefile typically does what needs to be done (sometime
>>  compiles) and puts source files into install subdirectory (sometimes
>>  usr.manifest is generated, sometime usr.manifest is pre-defined).
>>  - module.py is called to execute extra logic - sometimes to
>>  generate usr.manifest, define cmdline and possibly multiple flavors
>>   - This is somewhat documented in the README.md of osv-apps project
>>   but is not clear enough and the apps are all over the place following 
>> this
>>   loose convention and I am myself guilty of not following it (see
>>   python2x/3x apps that do too much in GET). I doubt it is worth fixing
>>   existing apps but I think we could improve the documentation in this 
>> area
>>   and and possibly point to a good model app.
>>
>> I agree. Also, note that both the "GET" and "makefile" there are rather
> arbitrary conventions -
> all we need from the Makefile is to have the "make" and "make clean"
> target. That's it. Because people
> were too lazy to write a proper makefile around this requirement, "make"
> just calls "GET" which is a
> shell script that just does everything.
> We could easily have any other convention to build and clean a package.
>

In the past, I did start writing a python script to handle OSv apps in a
uniform way the code is lost somewhere here

But the idea was to have a JSON file with 2 sections, one for
configuration, another for stages
and based on some reserved names, we do operations like downloading files,
checksum, etc
pretty much like and dependency/build manager like
maven/gradle/pip/conan/...
Of course, any suggestion is welcomed :)

Also, because we are limited in terms of developers, I would suggest
leaving documentation until the new app builder is ready, otherwise, we
will take a lot of time to write documentation for current build that will
be lost and people will certainly ask for help if they are really
interested anyway


> I think the more difficult part is understand what the heck is module.py
> and what is usr.manifest, etc.
>

if I understood, the script that handles OSv modules uses module.py to
expose OSv apps as  OSv modules, otherwise, we would need to move OSv apps
inside /modules (or change the python script that handles modules
in other directories accordingly)

Well, in fact, it might be a future refactoring, moving non-essential
modules to OSv apps, for example, I think java, go, openssl, httpserver-*,
monitoring-agent could be moved to OSv apps

As for usr.manifest, personally, I would prefer to not have user.manifest
and instead have a default directory inside app directory and everything
that you puts there will be added to the final osv file system image
I think most of the apps already generates a ROOTFS directory that creates
such a structure
not sure

also, we could create tests to build each app automatically and see if
they're still working
I guess we have a number of apps that are not working due to various reasons


I think you're right that just documenting the conventions we used will go
> a long way in helping people to use this system, even if we don't change
> anything.
>
>
>>
>>-
>>- I know our build system (scripts/build and related python scripts)
>>is complicated enough. But it would be super nice to allow passing
>>parameters from scripts/build to app Makefile. The best use case for that
>>is building java9 (10,11,12 as well) JREs using jlink where it would be
>>nice to pass a list of JRE modules to incorporate - see
>>
>> https://github.com/cloudius-systems/osv-apps/blob/master/openjdk9-zulu-java-base/Makefile#L26;
>>I think there are many other apps that would benefit
>>
>> Possibly.  Indeed if properly documented, it shouldn't matter that it's
> even more complicated.
>
>>
>>-
>>- Eliminate external -
>>https://github.com/cloudius-systems/osv/issues/743
>>- It would be nice to detail what to do to each subdirectory (I am
>>   not positive we want to eliminate all - see x64/acpica)
>>
>> I agree. We should do that. "external" is an idea that really outlived
> its usefulness, I think.
> Indeed we don't need to remove everything at once, we can do it piece by
> piece (and stop using pieces before actually removing them).
>


Re: [osv-dev] Hermitux - A Binary-Compatible Unikernel

2019-03-31 Thread Geraldo Netto
Helo Waldek/Friends,

Red Hat is also doing research on unikernels:
https://github.com/razaaliraza/ukl
So, this linux unikernel might not require modification too
But I didn't try...

Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Sun, 31 Mar 2019 at 17:44, Waldek Kozaczuk  wrote:

> Accidentally while googling I came across this paper -
> https://www.ssrg.ece.vt.edu/papers/vee2019.pdf - which is about new
> unikernel - Hermitux (https://ssrg-vt.github.io/hermitux/). It looks like
> it is also about to be presented at some conference soon.
>
> I have not read the paper thoroughly but I think it compares Hermitux to
> OSv and Rumprun among others. I think it It claims that it is the only
> Linux binary compatible unikernel. I always thought that OSv is able to
> execute unmodified Linux apps as long as ... (fill the blanks). The best
> example is unmodified JVM. Where am I wrong?
>
> I wonder what others think,
> Waldek
>
> PS. The source files are here - https://github.com/ssrg-vt/hermitux-kernel
> and https://github.com/ssrg-vt/hermitux.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH] tomcat: require java8

2019-03-10 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 tomcat/module.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tomcat/module.py b/tomcat/module.py
index cbe6872..a9584db 100644
--- a/tomcat/module.py
+++ b/tomcat/module.py
@@ -1,5 +1,7 @@
 from osv.modules import api
 
+api.require('java8')
+
 _catalina_base = "/usr/tomcat"
 _catalina_home = _catalina_base
 _catalina_tmpdir = _catalina_base + "/temp"
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] Re: [PATCH] add and explicit java8 alias

2019-03-10 Thread Geraldo Netto
Nadav/Waldek,

Do you think it is reasonable to add an alias for each java version?
and then if someone wants a different version, we can always use the
image=,


Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Sun, 10 Mar 2019 at 17:31, geraldo netto  wrote:

> this alias was already declared in some modules like akka-example,
> apache-derby, elasticsearch, ratpack-example
> and for some reason it was not picking up jdk8 properly
>
> just for reference, we have the following modules declared as providing
> java8:
>
> openjdk10-zulu-java-base/module.py:provides =
> ['java','java8','java9','java10']
> openjdk11-zulu-java-base/module.py:provides =
> ['java','java8','java9','java10', 'java11']
> openjdk8-fedora/module.py:provides = ['java','java8']
> openjdk8-zulu-compact1/module.py:provides = ['java','java8']
> openjdk8-zulu-compact2/module.py:provides = ['java','java8']
> openjdk8-zulu-compact3/module.py:provides = ['java','java8']
> openjdk8-zulu-compact3-with-java-beans/module.py:provides =
> ['java','java8']
> openjdk8-zulu-full/module.py:provides = ['java','java8']
> openjdk9-zulu-java-base/module.py:provides = ['java','java8','java9']
>
> Signed-off-by: geraldo netto 
> ---
>  modules/java8/module.py | 4 
>  1 file changed, 4 insertions(+)
>  create mode 100644 modules/java8/module.py
>
> diff --git a/modules/java8/module.py b/modules/java8/module.py
> new file mode 100644
> index ..0c0eb6c5
> --- /dev/null
> +++ b/modules/java8/module.py
> @@ -0,0 +1,4 @@
> +from osv.modules import api
> +
> +api.require('java-non-isolated')
> +api.require('openjdk8-zulu-full')
> --
> 2.17.1
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH] add and explicit java8 alias

2019-03-10 Thread geraldo netto
this alias was already declared in some modules like akka-example, 
apache-derby, elasticsearch, ratpack-example
and for some reason it was not picking up jdk8 properly

just for reference, we have the following modules declared as providing java8:

openjdk10-zulu-java-base/module.py:provides = ['java','java8','java9','java10']
openjdk11-zulu-java-base/module.py:provides = ['java','java8','java9','java10', 
'java11']
openjdk8-fedora/module.py:provides = ['java','java8']
openjdk8-zulu-compact1/module.py:provides = ['java','java8']
openjdk8-zulu-compact2/module.py:provides = ['java','java8']
openjdk8-zulu-compact3/module.py:provides = ['java','java8']
openjdk8-zulu-compact3-with-java-beans/module.py:provides = ['java','java8']
openjdk8-zulu-full/module.py:provides = ['java','java8']
openjdk9-zulu-java-base/module.py:provides = ['java','java8','java9']

Signed-off-by: geraldo netto 
---
 modules/java8/module.py | 4 
 1 file changed, 4 insertions(+)
 create mode 100644 modules/java8/module.py

diff --git a/modules/java8/module.py b/modules/java8/module.py
new file mode 100644
index ..0c0eb6c5
--- /dev/null
+++ b/modules/java8/module.py
@@ -0,0 +1,4 @@
+from osv.modules import api
+
+api.require('java-non-isolated')
+api.require('openjdk8-zulu-full')
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [osv-dev] [PATCH 0/9] upgrade from tomcat 8 to tomcat 9

2019-03-10 Thread Geraldo Netto
Think I found/fixed it
Let me finish the tests to make sure, I'm not missing anything else


See You,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Sun, 10 Mar 2019 at 16:52, Geraldo Netto  wrote:

> Nadav/Waldek,
>
> It turns out that module.py is not resolving java8
> and in fact it sems broken also for other apps like elastic search which
> also requires jdk8
> I'm checking why...
> the workaround fr tomcat and all other apps that depend on java8 is to use
> image=openjdk8-zulu-full,
>
> the log:
> ...
> Building into build/release.x64
> ./scripts/build image=tomcat
> make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent
> make rule.
> make[1]: Entering directory '/home/netto/Desktop/osv'
> Building into build/release.x64
>   GEN gen/include/osv/version.h
> make[1]: Leaving directory '/home/netto/Desktop/osv'
> No such image configuration: tomcat. Assuming list of modules.
> Importing /home/netto/Desktop/osv/apps/tomcat/module.py
> Traceback (most recent call last):
>   File "scripts/module.py", line 281, in 
> args.func(args)
>   File "scripts/module.py", line 205, in build
> api.require_running(name)
>   File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 194,
> in require_running
> module = require(module_name)
>   File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 169,
> in require
> module_properties = local_import(module_file)
>   File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 48,
> in local_import
> return runpy.run_path(path)
>   File "/usr/lib/python2.7/runpy.py", line 252, in run_path
> return _run_module_code(code, init_globals, run_name, path_name)
>   File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
> mod_name, mod_fname, mod_loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
> exec code in run_globals
>   File "/home/netto/Desktop/osv/apps/tomcat/module.py", line 3, in 
> api.require('java8')
>   File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 152,
> in require
> raise Exception("Module not found: %s. Please check configuration: %s"
> % (module_name, get_config_path()))
> Exception: Module not found: java8. Please check configuration:
> /home/netto/Desktop/osv/config.json
> ./scripts/build failed: fs_type=$fs_type jdkbase=$jdkbase ARCH=$arch
> mode=$mode OSV_BASE=$SRC OSV_BUILD_PATH=$OSV_BUILD_PATH scripts/module.py
> $j_arg build -c $modules $usrskel_arg $no_required_arg
>
>
> Kind Regards,
>
> Geraldo Netto
> Sapere Aude => Non dvcor, dvco
> http://exdev.sf.net/
>
>
> On Sun, 10 Mar 2019 at 16:35, Nadav Har'El  wrote:
>
>> I already committed your previous patch so please make an incremental
>> patch. Thanks.
>>
>> On Sun, Mar 10, 2019, 17:11 Geraldo Netto  wrote:
>>
>>> Hey,
>>>
>>> I beg your pardon by this I forgot to point the jdk8  requirement once
>>> I usually build with "openjdk8-zulu-full,tomcat" :(
>>> let me do another patch with it
>>> Do you prefer me to make a single patch or would you prefer me to make
>>> a new set and also fix some comment?
>>>
>>>
>>> Kind Regards,
>>>
>>> Geraldo Netto
>>> Sapere Aude => Non dvcor, dvco
>>> http://exdev.sf.net/
>>>
>>> On Sun, 10 Mar 2019 at 16:04, Nadav Har'El  wrote:
>>> >
>>> > Thanks. I committed your patches, because there's no halting progress
>>> :-)
>>> > But  does it work for you? It doesn't for me... When I try
>>> >
>>> > $ scripts/build image=tomcat
>>> > $ scripts/run
>>> >
>>> > I get:
>>> >
>>> > java.so: Starting JVM app using:
>>> io/osv/nonisolated/RunNonIsolatedJvmApp
>>> > java.so: Setting Java system classloader to
>>> NonIsolatingOsvSystemClassLoader
>>> > io.osv.AppThreadTerminatedWithUncaughtException:
>>> java.lang.UnsupportedClassVersionError:
>>> org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
>>> > at
>>> io.osv.nonisolated.NonIsolatedJvm.runSync(NonIsolatedJvm.java:81)
>>> > at io.osv.RunJvmAppHelper.runSync(RunJvmAppHelper.java:40)
>>> > at
>>> io.osv.nonisolated.RunNonIsolatedJvmApp.main(RunNonIsolatedJvmApp.java:34)
>>> > Caused by: java.lang.UnsupportedClassVersionError:
>>> org/apache/catalina/startup/Bootstrap : Unsupp

Re: [osv-dev] [PATCH 0/9] upgrade from tomcat 8 to tomcat 9

2019-03-10 Thread Geraldo Netto
Nadav/Waldek,

It turns out that module.py is not resolving java8
and in fact it sems broken also for other apps like elastic search which
also requires jdk8
I'm checking why...
the workaround fr tomcat and all other apps that depend on java8 is to use
image=openjdk8-zulu-full,

the log:
...
Building into build/release.x64
./scripts/build image=tomcat
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make
rule.
make[1]: Entering directory '/home/netto/Desktop/osv'
Building into build/release.x64
  GEN gen/include/osv/version.h
make[1]: Leaving directory '/home/netto/Desktop/osv'
No such image configuration: tomcat. Assuming list of modules.
Importing /home/netto/Desktop/osv/apps/tomcat/module.py
Traceback (most recent call last):
  File "scripts/module.py", line 281, in 
args.func(args)
  File "scripts/module.py", line 205, in build
api.require_running(name)
  File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 194,
in require_running
module = require(module_name)
  File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 169,
in require
module_properties = local_import(module_file)
  File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 48,
in local_import
return runpy.run_path(path)
  File "/usr/lib/python2.7/runpy.py", line 252, in run_path
return _run_module_code(code, init_globals, run_name, path_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
  File "/home/netto/Desktop/osv/apps/tomcat/module.py", line 3, in 
api.require('java8')
  File "/home/netto/Desktop/osv/scripts/osv/modules/resolve.py", line 152,
in require
raise Exception("Module not found: %s. Please check configuration: %s"
% (module_name, get_config_path()))
Exception: Module not found: java8. Please check configuration:
/home/netto/Desktop/osv/config.json
./scripts/build failed: fs_type=$fs_type jdkbase=$jdkbase ARCH=$arch
mode=$mode OSV_BASE=$SRC OSV_BUILD_PATH=$OSV_BUILD_PATH scripts/module.py
$j_arg build -c $modules $usrskel_arg $no_required_arg


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Sun, 10 Mar 2019 at 16:35, Nadav Har'El  wrote:

> I already committed your previous patch so please make an incremental
> patch. Thanks.
>
> On Sun, Mar 10, 2019, 17:11 Geraldo Netto  wrote:
>
>> Hey,
>>
>> I beg your pardon by this I forgot to point the jdk8  requirement once
>> I usually build with "openjdk8-zulu-full,tomcat" :(
>> let me do another patch with it
>> Do you prefer me to make a single patch or would you prefer me to make
>> a new set and also fix some comment?
>>
>>
>> Kind Regards,
>>
>> Geraldo Netto
>> Sapere Aude => Non dvcor, dvco
>> http://exdev.sf.net/
>>
>> On Sun, 10 Mar 2019 at 16:04, Nadav Har'El  wrote:
>> >
>> > Thanks. I committed your patches, because there's no halting progress
>> :-)
>> > But  does it work for you? It doesn't for me... When I try
>> >
>> > $ scripts/build image=tomcat
>> > $ scripts/run
>> >
>> > I get:
>> >
>> > java.so: Starting JVM app using: io/osv/nonisolated/RunNonIsolatedJvmApp
>> > java.so: Setting Java system classloader to
>> NonIsolatingOsvSystemClassLoader
>> > io.osv.AppThreadTerminatedWithUncaughtException:
>> java.lang.UnsupportedClassVersionError:
>> org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
>> > at io.osv.nonisolated.NonIsolatedJvm.runSync(NonIsolatedJvm.java:81)
>> > at io.osv.RunJvmAppHelper.runSync(RunJvmAppHelper.java:40)
>> > at
>> io.osv.nonisolated.RunNonIsolatedJvmApp.main(RunNonIsolatedJvmApp.java:34)
>> > Caused by: java.lang.UnsupportedClassVersionError:
>> org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
>> >
>> > Is it possible that we compile Tomcat in a way it can't run on the
>> antique Java (version 7) we supply by default?
>> > Is this a new Tomcat requirement, that it only runs on Java 8? If it
>> is, we need to have tomcat "require" Java 8, not just any java (which today
>> is Java 7).
>> >
>> > Anyway, I wonder how it worked for you?
>> >
>> > --
>> > Nadav Har'El
>> > n...@scylladb.com
>> >
>> >
>> > On Sat, Mar 9, 2019 at 3:02 AM geraldo netto 
>> wrote:
>> >>
>> >> geraldo netto (9):
>> >>   tomcat: upgrade

Re: [osv-dev] [PATCH 2/9] update 0001-configure-web-admin-user.patch

2019-03-10 Thread Geraldo Netto
Hello Nadav/Waldek/Friends,

Just to document this is the flow of the changes on tomcat
As you already pointed out, this set contains patch-of-patch
The following are all correlated to the same file:
- update 0001-configure-web-admin-user.patch
- add admin-gui permission
- add manager-script permission

This "update 0001-configure-web-admin-user.patch" goes from this
(tomcat-users.xml, note that only the new user is enabled):

...



to this:

...





The second patch goes from:

...



to:

...




The third patch goes from:

...



to:

...



and then we have the renaming so patches change the configuration without
"jumps"
before we were changing the files without any other, eg:
conf/tomcat-users.xml => 0001-configure-web-admin-user.patch
conf/server.xml => 0002-change-http-port-to-8081.patch
conf/tomcat-users.xml => 0003-assign-admin-gui-role-to-tomcat-user.patch
conf/web.xml => 0004-disable-Jasper-development-mode.patch
conf/server.xml => 0005-bump-up-number-of-threads.patch
conf/tomcat-users.xml => 0006-Add-script-managment-role-to-tomcat-user.patch
conf/server.xml => 0007-Use-bio-connector-explicitly.patch
conf/server.xml => 0008-Do-not-enable-AJP-connector.patch

with this set, the changes are in order:
conf/tomcat-users.xml => 0001-configure-web-admin-user.patch
conf/tomcat-users.xml => 0002-assign-admin-gui-role-to-tomcat-user.patch
conf/tomcat-users.xml => 0003-Add-script-managment-role-to-tomcat-user.patch
conf/web.xml => 0004-disable-Jasper-development-mode.patch
conf/server.xml => 0005-bump-up-number-of-threads.patch
conf/server.xml => 0006-change-http-port-to-8081.patch
conf/server.xml => 0007-Use-nio-connector-explicitly.patch
conf/server.xml => 0008-Do-not-enable-AJP-connector.patch


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/



Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Sun, 10 Mar 2019 at 15:41, Geraldo Netto  wrote:

> Hey Nadav,
>
> Thanks for reviewing the patches :)
> Sorry by not answer in line
> but yes, instead of deleting commented lines and then add just the one
> we need (old approach)
> I keep the commented code and just add one single line with the
> configuration we need just before the last line
> that way it also makes simpler to change in future
> the other users are commented anyway, so, they won't impact
>
> and then, in the next patches, we apply the changes just in one single line
> of course, if you see any problem, please, let me know
>
>
> Kind Regards,
> Geraldo Netto
>
>
> >>
> >> update the patch 0001-configure-web-admin-user.patch in order to work
> on tomcat 9
> >> the change only adds a new user with manager-gui on second-last line
> >> instead of removing the past lines and then add the user
> >>
> >> in any case, the changes on tomcat-user.xml must be done in order
> >> once all 3 patches touch the same line
> >>
> >> Signed-off-by: geraldo netto 
> >> ---
> >>  .../perf/0001-configure-web-admin-user.patch  | 15 ---
> >>  1 file changed, 4 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/tomcat/patches/perf/0001-configure-web-admin-user.patch
> b/tomcat/patches/perf/0001-configure-web-admin-user.patch
> >> index d445541..0dbb4ed 100644
> >> --- a/tomcat/patches/perf/0001-configure-web-admin-user.patch
> >> +++ b/tomcat/patches/perf/0001-configure-web-admin-user.patch
> >> @@ -13,18 +13,11 @@ diff --git a/conf/tomcat-users.xml
> b/conf/tomcat-users.xml
> >>  index 7f022ff..2f9579c 100644
> >>  --- a/conf/tomcat-users.xml
> >>  +++ b/conf/tomcat-users.xml
> >> -@@ -26,11 +26,6 @@
> >> -   and thus are ignored when reading this file. Do not forget to remove
> >> -that surrounds them.
> >> +@@ -41,4 +41,5 @@
> >> +roles="tomcat,role1"/>
> >> +   
> >
> >
> > Hmm, I think I'm starting to understand this patch-of-patch.
> >
> > The existing patch 0001-configure-web-admin-user.patch the patch also
> removed
> > the "both" and "role1" users, and in this patch, you no longer do.
> > Seeing the above  two "context lines" I see that in order to remove
> these two users,
> > you would need to change what this patch removes, but you decided that
> it's simpler
> > not to remove those extra users at all. Is this a correct understanding?
> I have no idea
> > why we cared about removing these two example users in the first case,
> so I'm fine
> > with not removing them, but I just want to understand if this is really
> what you did.
> >
> >>   -->
> &g

Re: [osv-dev] [PATCH 0/9] upgrade from tomcat 8 to tomcat 9

2019-03-10 Thread Geraldo Netto
Hey,

I beg your pardon by this I forgot to point the jdk8  requirement once
I usually build with "openjdk8-zulu-full,tomcat" :(
let me do another patch with it
Do you prefer me to make a single patch or would you prefer me to make
a new set and also fix some comment?


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Sun, 10 Mar 2019 at 16:04, Nadav Har'El  wrote:
>
> Thanks. I committed your patches, because there's no halting progress :-)
> But  does it work for you? It doesn't for me... When I try
>
> $ scripts/build image=tomcat
> $ scripts/run
>
> I get:
>
> java.so: Starting JVM app using: io/osv/nonisolated/RunNonIsolatedJvmApp
> java.so: Setting Java system classloader to NonIsolatingOsvSystemClassLoader
> io.osv.AppThreadTerminatedWithUncaughtException: 
> java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap 
> : Unsupported major.minor version 52.0
> at io.osv.nonisolated.NonIsolatedJvm.runSync(NonIsolatedJvm.java:81)
> at io.osv.RunJvmAppHelper.runSync(RunJvmAppHelper.java:40)
> at 
> io.osv.nonisolated.RunNonIsolatedJvmApp.main(RunNonIsolatedJvmApp.java:34)
> Caused by: java.lang.UnsupportedClassVersionError: 
> org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
>
> Is it possible that we compile Tomcat in a way it can't run on the antique 
> Java (version 7) we supply by default?
> Is this a new Tomcat requirement, that it only runs on Java 8? If it is, we 
> need to have tomcat "require" Java 8, not just any java (which today is Java 
> 7).
>
> Anyway, I wonder how it worked for you?
>
> --
> Nadav Har'El
> n...@scylladb.com
>
>
> On Sat, Mar 9, 2019 at 3:02 AM geraldo netto  wrote:
>>
>> geraldo netto (9):
>>   tomcat: upgrade from 8.0.15 to 9.0.16
>>   update 0001-configure-web-admin-user.patch
>>   add admin-gui permission
>>   add manager-script permission
>>   rename: 0003-assign-admin-gui-role-to-tomcat-user ->
>> 0002-assign-admin-gui-role-to-tomcat-user
>>   renamed: 0002-change-http-port-to-8081.patch ->
>> 0003-change-http-port-to-8081.patch
>>   renamed: 0006-Add-script-managment-role-to-tomcat-user.patch ->
>> 0003-Add-script-managment-role-to-tomcat-user.patch
>>   renamed: 0003-change-http-port-to-8081.patch ->
>> 0006-change-http-port-to-8081.patch
>>   update bio connector to nio
>>
>>  tomcat/GET| 20 ++-
>>  .../perf/0001-configure-web-admin-user.patch  | 15 --
>>  ...ssign-admin-gui-role-to-tomcat-user.patch} | 10 +-
>>  ...cript-managment-role-to-tomcat-user.patch} | 10 +-
>>  ...ch => 0006-change-http-port-to-8081.patch} |  0
>>  ...> 0007-Use-nio-connector-explicitly.patch} |  4 ++--
>>  6 files changed, 27 insertions(+), 32 deletions(-)
>>  rename tomcat/patches/perf/{0003-assign-admin-gui-role-to-tomcat-user.patch 
>> => 0002-assign-admin-gui-role-to-tomcat-user.patch} (64%)
>>  rename 
>> tomcat/patches/perf/{0006-Add-script-managment-role-to-tomcat-user.patch => 
>> 0003-Add-script-managment-role-to-tomcat-user.patch} (70%)
>>  rename tomcat/patches/perf/{0002-change-http-port-to-8081.patch => 
>> 0006-change-http-port-to-8081.patch} (100%)
>>  rename tomcat/patches/perf/{0007-Use-bio-connector-explicitly.patch => 
>> 0007-Use-nio-connector-explicitly.patch} (91%)
>>
>> --
>> 2.17.1
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [osv-dev] [PATCH 2/9] update 0001-configure-web-admin-user.patch

2019-03-10 Thread Geraldo Netto
Hey Nadav,

Thanks for reviewing the patches :)
Sorry by not answer in line
but yes, instead of deleting commented lines and then add just the one
we need (old approach)
I keep the commented code and just add one single line with the
configuration we need just before the last line
that way it also makes simpler to change in future
the other users are commented anyway, so, they won't impact

and then, in the next patches, we apply the changes just in one single line
of course, if you see any problem, please, let me know


Kind Regards,
Geraldo Netto


>>
>> update the patch 0001-configure-web-admin-user.patch in order to work on 
>> tomcat 9
>> the change only adds a new user with manager-gui on second-last line
>> instead of removing the past lines and then add the user
>>
>> in any case, the changes on tomcat-user.xml must be done in order
>> once all 3 patches touch the same line
>>
>> Signed-off-by: geraldo netto 
>> ---
>>  .../perf/0001-configure-web-admin-user.patch  | 15 ---
>>  1 file changed, 4 insertions(+), 11 deletions(-)
>>
>> diff --git a/tomcat/patches/perf/0001-configure-web-admin-user.patch 
>> b/tomcat/patches/perf/0001-configure-web-admin-user.patch
>> index d445541..0dbb4ed 100644
>> --- a/tomcat/patches/perf/0001-configure-web-admin-user.patch
>> +++ b/tomcat/patches/perf/0001-configure-web-admin-user.patch
>> @@ -13,18 +13,11 @@ diff --git a/conf/tomcat-users.xml 
>> b/conf/tomcat-users.xml
>>  index 7f022ff..2f9579c 100644
>>  --- a/conf/tomcat-users.xml
>>  +++ b/conf/tomcat-users.xml
>> -@@ -26,11 +26,6 @@
>> -   and thus are ignored when reading this file. Do not forget to remove
>> -that surrounds them.
>> +@@ -41,4 +41,5 @@
>> +   
>> +   
>
>
> Hmm, I think I'm starting to understand this patch-of-patch.
>
> The existing patch 0001-configure-web-admin-user.patch the patch also removed
> the "both" and "role1" users, and in this patch, you no longer do.
> Seeing the above  two "context lines" I see that in order to remove these two 
> users,
> you would need to change what this patch removes, but you decided that it's 
> simpler
> not to remove those extra users at all. Is this a correct understanding? I 
> have no idea
> why we cared about removing these two example users in the first case, so I'm 
> fine
> with not removing them, but I just want to understand if this is really what 
> you did.
>
>>   -->
>> --
>> -+  
>> ++
>>   
>>  --
>>  1.8.1.2
>> --
>> 2.17.1
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 0/9] upgrade from tomcat 8 to tomcat 9

2019-03-08 Thread geraldo netto
geraldo netto (9):
  tomcat: upgrade from 8.0.15 to 9.0.16
  update 0001-configure-web-admin-user.patch
  add admin-gui permission
  add manager-script permission
  rename: 0003-assign-admin-gui-role-to-tomcat-user ->
0002-assign-admin-gui-role-to-tomcat-user
  renamed: 0002-change-http-port-to-8081.patch ->
0003-change-http-port-to-8081.patch
  renamed: 0006-Add-script-managment-role-to-tomcat-user.patch ->
0003-Add-script-managment-role-to-tomcat-user.patch
  renamed: 0003-change-http-port-to-8081.patch ->
0006-change-http-port-to-8081.patch
  update bio connector to nio

 tomcat/GET| 20 ++-
 .../perf/0001-configure-web-admin-user.patch  | 15 --
 ...ssign-admin-gui-role-to-tomcat-user.patch} | 10 +-
 ...cript-managment-role-to-tomcat-user.patch} | 10 +-
 ...ch => 0006-change-http-port-to-8081.patch} |  0
 ...> 0007-Use-nio-connector-explicitly.patch} |  4 ++--
 6 files changed, 27 insertions(+), 32 deletions(-)
 rename tomcat/patches/perf/{0003-assign-admin-gui-role-to-tomcat-user.patch => 
0002-assign-admin-gui-role-to-tomcat-user.patch} (64%)
 rename 
tomcat/patches/perf/{0006-Add-script-managment-role-to-tomcat-user.patch => 
0003-Add-script-managment-role-to-tomcat-user.patch} (70%)
 rename tomcat/patches/perf/{0002-change-http-port-to-8081.patch => 
0006-change-http-port-to-8081.patch} (100%)
 rename tomcat/patches/perf/{0007-Use-bio-connector-explicitly.patch => 
0007-Use-nio-connector-explicitly.patch} (91%)

-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 3/9] add admin-gui permission

2019-03-08 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 .../0003-assign-admin-gui-role-to-tomcat-user.patch| 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch 
b/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
index 27ed2ae..430ed99 100644
--- a/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
+++ b/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
@@ -13,12 +13,12 @@ diff --git a/conf/tomcat-users.xml b/conf/tomcat-users.xml
 index 2f9579c..bcf840a 100644
 --- a/conf/tomcat-users.xml
 +++ b/conf/tomcat-users.xml
-@@ -27,5 +27,5 @@
-that surrounds them.
+@@ -41,5 +41,5 @@
+   
+   
  -->
-   
--  
-+  
+-
++
  
 -- 
 1.8.1.2
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 2/9] update 0001-configure-web-admin-user.patch

2019-03-08 Thread geraldo netto
update the patch 0001-configure-web-admin-user.patch in order to work on tomcat 
9
the change only adds a new user with manager-gui on second-last line
instead of removing the past lines and then add the user

in any case, the changes on tomcat-user.xml must be done in order
once all 3 patches touch the same line

Signed-off-by: geraldo netto 
---
 .../perf/0001-configure-web-admin-user.patch  | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/tomcat/patches/perf/0001-configure-web-admin-user.patch 
b/tomcat/patches/perf/0001-configure-web-admin-user.patch
index d445541..0dbb4ed 100644
--- a/tomcat/patches/perf/0001-configure-web-admin-user.patch
+++ b/tomcat/patches/perf/0001-configure-web-admin-user.patch
@@ -13,18 +13,11 @@ diff --git a/conf/tomcat-users.xml b/conf/tomcat-users.xml
 index 7f022ff..2f9579c 100644
 --- a/conf/tomcat-users.xml
 +++ b/conf/tomcat-users.xml
-@@ -26,11 +26,6 @@
-   and thus are ignored when reading this file. Do not forget to remove
-that surrounds them.
+@@ -41,4 +41,5 @@
+   
+   
  -->
--
-+  
++
  
 -- 
 1.8.1.2
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 1/9] tomcat: upgrade from 8.0.15 to 9.0.16

2019-03-08 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 tomcat/GET | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/tomcat/GET b/tomcat/GET
index 0a21749..e6af3f3 100755
--- a/tomcat/GET
+++ b/tomcat/GET
@@ -1,32 +1,34 @@
 #!/usr/bin/env bash
 set -e
-MAJOR=8
-VERSION=${MAJOR}.0.15
+MAJOR=9
+VERSION=${MAJOR}.0.16
 
 dir=apache-tomcat-$VERSION
 archive=$dir.tar.gz
 
 mkdir -p upstream
 pushd upstream
+
 wget -c 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}
-wget -c 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}.md5
-if [ "$(md5sum -c ${archive}.md5)" != "${archive}: OK" ];
+wget -c 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}.sha512
+
+if [ "$(sha512sum -c ${archive}.sha512)" != "${archive}: OK" ];
 then
-echo "Aborting: invalid md5 for Apache Tomcat $VERSION"
+echo "Aborting: invalid sha512 for Apache Tomcat $VERSION"
 exit 1
 fi
+
 tar zxvf $archive
 
 pushd $dir
-for p in $(find ../../patches/perf/ -name '*.patch' | sort); do
-echo "Applying $p"
-patch -p1 < $p
+for patch in $(find ../../patches/perf/ -name '*.patch' | sort); do
+echo "Applying $patch"
+patch -p1 < "$patch"
 done
 popd
 
 popd
 
-
 mkdir ROOTFS
 mkdir -p ROOTFS/usr/tomcat
 mv upstream/$dir/* ROOTFS/usr/tomcat
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 8/9] renamed: 0003-change-http-port-to-8081.patch -> 0006-change-http-port-to-8081.patch

2019-03-08 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 ...ttp-port-to-8081.patch => 0006-change-http-port-to-8081.patch} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename tomcat/patches/perf/{0003-change-http-port-to-8081.patch => 
0006-change-http-port-to-8081.patch} (100%)

diff --git a/tomcat/patches/perf/0003-change-http-port-to-8081.patch 
b/tomcat/patches/perf/0006-change-http-port-to-8081.patch
similarity index 100%
rename from tomcat/patches/perf/0003-change-http-port-to-8081.patch
rename to tomcat/patches/perf/0006-change-http-port-to-8081.patch
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 5/9] rename: 0003-assign-admin-gui-role-to-tomcat-user -> 0002-assign-admin-gui-role-to-tomcat-user

2019-03-08 Thread geraldo netto
rename patches in order to follow an order

Signed-off-by: geraldo netto 
---
 ...user.patch => 0002-assign-admin-gui-role-to-tomcat-user.patch} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename tomcat/patches/perf/{0003-assign-admin-gui-role-to-tomcat-user.patch => 
0002-assign-admin-gui-role-to-tomcat-user.patch} (100%)

diff --git 
a/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch 
b/tomcat/patches/perf/0002-assign-admin-gui-role-to-tomcat-user.patch
similarity index 100%
rename from tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
rename to tomcat/patches/perf/0002-assign-admin-gui-role-to-tomcat-user.patch
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 4/9] add manager-script permission

2019-03-08 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 ...0006-Add-script-managment-role-to-tomcat-user.patch | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/tomcat/patches/perf/0006-Add-script-managment-role-to-tomcat-user.patch 
b/tomcat/patches/perf/0006-Add-script-managment-role-to-tomcat-user.patch
index 9c068f4..91f01e9 100644
--- a/tomcat/patches/perf/0006-Add-script-managment-role-to-tomcat-user.patch
+++ b/tomcat/patches/perf/0006-Add-script-managment-role-to-tomcat-user.patch
@@ -16,12 +16,12 @@ diff --git a/conf/tomcat-users.xml b/conf/tomcat-users.xml
 index bcf840a..aad3acb 100644
 --- a/conf/tomcat-users.xml
 +++ b/conf/tomcat-users.xml
-@@ -27,5 +27,5 @@
-that surrounds them.
+@@ -41,5 +41,5 @@
+   
+   
  -->
-   
--  
-+  
+-
++
  
 -- 
 1.8.5.3
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 7/9] renamed: 0006-Add-script-managment-role-to-tomcat-user.patch -> 0003-Add-script-managment-role-to-tomcat-user.patch

2019-03-08 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 patch => 0003-Add-script-managment-role-to-tomcat-user.patch} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename 
tomcat/patches/perf/{0006-Add-script-managment-role-to-tomcat-user.patch => 
0003-Add-script-managment-role-to-tomcat-user.patch} (100%)

diff --git 
a/tomcat/patches/perf/0006-Add-script-managment-role-to-tomcat-user.patch 
b/tomcat/patches/perf/0003-Add-script-managment-role-to-tomcat-user.patch
similarity index 100%
rename from 
tomcat/patches/perf/0006-Add-script-managment-role-to-tomcat-user.patch
rename to 
tomcat/patches/perf/0003-Add-script-managment-role-to-tomcat-user.patch
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[osv-dev] [PATCH 6/9] renamed: 0002-change-http-port-to-8081.patch -> 0003-change-http-port-to-8081.patch

2019-03-08 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 ...ttp-port-to-8081.patch => 0003-change-http-port-to-8081.patch} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename tomcat/patches/perf/{0002-change-http-port-to-8081.patch => 
0003-change-http-port-to-8081.patch} (100%)

diff --git a/tomcat/patches/perf/0002-change-http-port-to-8081.patch 
b/tomcat/patches/perf/0003-change-http-port-to-8081.patch
similarity index 100%
rename from tomcat/patches/perf/0002-change-http-port-to-8081.patch
rename to tomcat/patches/perf/0003-change-http-port-to-8081.patch
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [osv-dev] Fwd: Unikernel performance review paper inquiry

2019-03-07 Thread Geraldo Netto
Hey!

Interesting paper Waldek!
I'm trying to push OSv to my friends here, let's hope
This sparks some contributions :)


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Thu, 7 Mar 2019 at 13:56, Waldek Kozaczuk  wrote:
>
> Hi,
>
> I am forwarding here my exchange with the author of the paper about OSv on 
> Xen beating docker in single vCPU setup. Adding the link to the article here:
> https://biblio.ugent.be/publication/8582433/file/8582438.pdf
>
> Enjoy,
> Waldek
> -- Forwarded message -
> From: Waldek Kozaczuk 
> Date: Sat, Mar 2, 2019 at 5:17 PM
> Subject: Re: Unikernel performance review paper inquiry
> To: Tom Goethals 
>
>
> Tom,
>
> Thanks for replying to my email.
>
> Do you mind if I forward our email exchange to the OSv development group 
> osv-dev@googlegroups.com? I think that other would also be very interested in 
> your article and findings. Also you might also get some good insight from 
> more experienced than me OSv users and developers.
>
> Please see my comments to some of your comments below.
>
> Regards,
> Waldek
>
> On Tue, Feb 26, 2019 at 5:19 AM Tom Goethals  
> wrote:
>>
>> Hello Waldek,
>>
>>
>> Thank you for the thorough read of my paper. It's interesting to see it from 
>> the perspective of an OSv contributor. I have to admit I was very new to 
>> unikernels (I had barely started my PhD) when I wrote the paper, so I may 
>> have missed some things. Considering the amount of bullet points, I inserted 
>> my answers/comments below for each point.
>>
>>
>> Generally, I did choose OSv as a focus because it seemed (by far) the most 
>> mature and stable platform to create and run unikernels with, so it's good 
>> to see new features and compatibility for languages being added. In the 
>> future, I would really like to do some research on mixed container-unikernel 
>> deployments with a single orchestration platform, but someone else may very 
>> well beat me to it :)
>>
>>
>> During the tests I did not find any large problems or lack of features in 
>> OSv, so I have little to add there. In fact, once I got the hang of it, OSv 
>> unikernels were quite easy to build and run on a lot of hypervisors. Most 
>> problems were about getting Python3 to work, but that has apparently been 
>> fixed. Note that the tests were mostly centered on network performance and 
>> simple workloads, so more in-depth future work could still result in 
>> suggestions.
>>
>>
>> Regards,
>>
>> Tom
>>
>> 
>> Van: Waldek Kozaczuk 
>> Verzonden: dinsdag 26 februari 2019 0:15
>> Aan: Tom Goethals
>> Onderwerp: Unikernel performance review paper inquiry
>>
>> Hi,
>>
>> Congratulations on writing this interesting and thorough paper - 
>> https://biblio.ugent.be/publication/8582433/file/8582438.pdf !!! Indeed it 
>> is probably first paper trying to compare performance of OSv and Docker 
>> containers.
>>
>> I hope this email finds the authors of this paper as I would like to ask 
>> some questions regarding it as well as clarify/explain some observations 
>> about OSv you touched on.
>>
>> First I wanted to introduce myself. My name is Waldemar Kozaczuk and I am 
>> one of the OSv committers. Though I am not one of the original authors of 
>> OSv, I have been playing with it and contributing to since 2015. My major 
>> contributions have been:
>>
>> Implementing ROFS (Read-Only FS)
>> Adding support of golang and python 3
>> Enhancing OSv to make it run on AWS firecracker
>>
>> I must say I have been very pleased to learn about how well OSv did in the 
>> single-vCPU performance tests but also a little disappointed that OSv did 
>> not fare that well in multi-vCPU tests ;-) Not surprised with results of 
>> workload tests on other hand. I would love to be able to reproduce it myself 
>> at some point. I noticed you refer to this project 
>> https://github.com/togoetha/unikernels-v-containers where I have found the 
>> source code and build scripts for OSv and Docker images. On other hand I 
>> could not locate any scripts nor JMeter setups that would let me run those 
>> tests. Could you possibly point me to those?
>> => I did not actually make any JMeter scripts. The JMeter GUI was used to 
>> find the breaking point for each service/language, but admittedly it was 
>> time-consuming work that could have been handled better. I can however tell 
>> you the basic settings: 40 threads, started simult

Re: [osv-dev] [PATCH V2] Reset FPU state after saving it and upon context switch

2019-01-29 Thread Geraldo Netto
Hey Guys,

I know, it's not a useful comment from my part
but where is the button to "like" or "love" this commit? :)

While it's off topic, I'm still planning to submit patches for tomcat 9 support


Keep Rocking/Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Tue, 29 Jan 2019 at 08:13, Nadav Har'El  wrote:
>
> Thanks! I just committed your patch. It has to be a record on the number of 
> issues fixed by a single patch :-)
>
> --
> Nadav Har'El
> n...@scylladb.com
>
>
> On Tue, Jan 29, 2019 at 7:16 AM Waldemar Kozaczuk  
> wrote:
>>
>> This patch adds "emms" instruction in critical places
>> of OSv thread scheduler code to reset FPU state after it is saved
>> upon involuntary context switch (for example interrupt) and right
>> after executing context switch on new thread to clear FPU status word.
>> Clearing FPU status word is necessary because old thread we are switching
>> from, might have used MMX instructions and any code executing after that
>> - new thread we are switching to - on the same CPU that needs to execute
>> traditional FPU instructions would fail with FPU overflow exception leading
>> to all kind of mysterious and nasty bugs. For more detailed explanation
>> please look at the issues #1019 and #1020.
>>
>> This patch also adds new unit test that verifies that FPU status
>> word is cleared upon involuntary context switch from thread using MMX
>> instruction to a thread that uses traditional FPU instructions -
>> printf of a float number.
>>
>> Please note there are some voluntary context switch scenarios
>> where FPU gets into non-clean state right after context switch which
>> may lead to other kinds of bugs like infinite loop in printf leading
>> to a page fault (see #536, #1010 and #1018). This patch fixes those as well
>> however we have not been able to provide a unit test that would demonstrate
>> this nor we have a clear understanding why FPU status word gets corrupted.
>>
>> Fixes #1019
>> Fixes #1020
>>
>> Fixes #536 - based on around 10 successful test runs where it would crash 
>> every other
>> time before the patch
>>
>> Fixes #1010 - based on over 100 successful test runs where it would crash 
>> almost every time
>>
>> Fixes #1018 - based on over successful 50 test runs with /os/threads API 
>> being used
>> in tight loop and before patch would crash sporadically
>>
>> Signed-off-by: Waldemar Kozaczuk 
>> ---
>>  arch/x64/arch-cpu.hh|  5 +++
>>  arch/x64/arch-switch.hh |  3 ++
>>  modules/tests/Makefile  |  4 +--
>>  tests/tst-mmx-fpu.cc| 71 +
>>  4 files changed, 81 insertions(+), 2 deletions(-)
>>  create mode 100644 tests/tst-mmx-fpu.cc
>>
>> diff --git a/arch/x64/arch-cpu.hh b/arch/x64/arch-cpu.hh
>> index b1cb0bf6..978217d0 100644
>> --- a/arch/x64/arch-cpu.hh
>> +++ b/arch/x64/arch-cpu.hh
>> @@ -71,6 +71,11 @@ struct save_fpu {
>>  T state;
>>  void save() {
>>  fpu_state_save(state.addr());
>> +// Reset FPU state after saving it as the thread we are about
>> +// to switch from might have been using MMX registers and
>> +// the thread scheduler that does FPU calculations needs
>> +// FPU to be a clean state
>> +asm volatile("emms");
>>  }
>>  void restore() {
>>  fpu_state_restore(state.addr());
>> diff --git a/arch/x64/arch-switch.hh b/arch/x64/arch-switch.hh
>> index e3769540..88bef949 100644
>> --- a/arch/x64/arch-switch.hh
>> +++ b/arch/x64/arch-switch.hh
>> @@ -103,6 +103,9 @@ void thread::switch_to()
>> [rip]"i"(offsetof(thread_state, rip))
>>   : "rbx", "rdx", "rsi", "rdi", "r8", "r9",
>> "r10", "r11", "r12", "r13", "r14", "r15", "memory");
>> +// As the catch-all solution, reset FPU state and more specifically
>> +// its status word. For details why we need it please see issue #1020.
>> +asm volatile ("emms");
>>  processor::fldcw(fpucw);
>>  processor::ldmxcsr(mxcsr);
>>  }
>> diff --git a/modules/tests/Makefile b/modules/tests/Makefile
>> index ece5f846..5c94e549 100644
>> --- a/modules/tests/Makefile
>> +++ b/modules/tests/Makefile
>> @@ -116,8 +116,8 @@ tests := tst-pthread.so misc-ramdisk.so tst-vblk.so 
>> tst-bsd-evh.so \
>

[osv-dev] VirtIO v1.1 draft (from dec/2018)

2019-01-27 Thread Geraldo Netto
Dear Friends,

Once Waldek is working on VirtIO and the topic is gaining attention
It might be relevant to point out the draft of the new spec (v1.1):
https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] Implement more space-efficient early memory allocation scheme

2018-12-04 Thread Geraldo Netto
Ciao Waldek/Nadav/Friends,

Nadav should give the ok
But it seems great on my small/just for fun tests! :)


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Tue, 4 Dec 2018 at 13:37, Waldek Kozaczuk  wrote:
>
> Ping.
>
> On Tuesday, November 27, 2018 at 7:36:30 AM UTC-5, Waldek Kozaczuk wrote:
>>
>> Any feedback, please?
>>
>> On Thursday, November 22, 2018 at 1:07:16 PM UTC-5, Waldek Kozaczuk wrote:
>>>
>>> As I noted in the commit message this patch may be not very elegant but 
>>> seems to be pretty effective. Please suggest any other ideas of how to 
>>> implement it better. Please my self-review comments below.
>>>
>>> On Thursday, November 22, 2018 at 1:28:32 AM UTC-5, Waldek Kozaczuk wrote:
>>>>
>>>> This patch implements a naive but efficient scheme of allocating
>>>> memory before SMP is enabled and regular malloc pools are setup.
>>>> Before this patch every single pre-SMP allocation would
>>>> be backed by full 4K page regardless if requested size
>>>> was 8 or 2000 bytes.
>>>>
>>>> New pre-SMP allocation scheme is based on the fact that
>>>> relatively few objects are allocated (~ 2,000) and rarely
>>>> freed (< 20%) and most are very small (<50 bytes).
>>>> The algorithm is as simple as finding next big enough aligned
>>>> space in a 4K page of memory, marking its size and resetting
>>>> offset to the next free area of the page otherwise allocating
>>>> new 4K page. For details read comments in the code.
>>>>
>>>> Even though this scheme is very simplistic it is
>>>> roughly 35 times more space efficient and allows
>>>> us to save around 6M of memory. It was measured that the net sum of
>>>> sizes (as is) of all requested allocations is typically around 125K
>>>> and new scheme uses ~44 pages (176K) of memory to satisfy all requests.
>>>>
>>>> Fixes #270
>>>>
>>>> Signed-off-by: Waldemar Kozaczuk 
>>>> ---
>>>>  core/mempool.cc| 133 -
>>>>  include/osv/mempool.hh |   5 ++
>>>>  2 files changed, 136 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/core/mempool.cc b/core/mempool.cc
>>>> index 23dc67da..8c23e916 100644
>>>> --- a/core/mempool.cc
>>>> +++ b/core/mempool.cc
>>>> @@ -284,6 +284,9 @@ void pool::free_same_cpu(free_object* obj, unsigned 
>>>> cpu_id)
>>>>  trace_pool_free_same_cpu(this, object);
>>>>
>>>>  page_header* header = to_header(obj);
>>>> +if (!header->owner) {
>>>> +return;
>>>> +}
>>>
>>> Not sure if that check and in other place is necessary but in case we get 
>>> here and it is early alloc page the code below will not execute that way as 
>>> it does not apply.
>>>>
>>>>  if (!--header->nalloc && have_full_pages()) {
>>>>  if (header->local_free) {
>>>>  _free->erase(_free->iterator_to(*header));
>>>> @@ -321,6 +324,9 @@ void pool::free(void* object)
>>>>
>>>>  free_object* obj = static_cast(object);
>>>>  page_header* header = to_header(obj);
>>>> +if (!header->owner) {
>>>> +return;
>>>> +}
>>>>  unsigned obj_cpu = header->cpu_id;
>>>>  unsigned cur_cpu = mempool_cpuid();
>>>>
>>>> @@ -1432,6 +1438,113 @@ static void early_free_page(void* v)
>>>>  auto pr = new (v) page_range(page_size);
>>>>  free_page_range(pr);
>>>>  }
>>>> +//
>>>> +// Following variables and functions implement simple
>>>> +// early (pre-SMP) memory allocation scheme.
>>>> +mutex early_alloc_lock;
>>>> +// early_object_pages holds a pointer to the beginning of the current page
>>>> +// intended to be used for next early object allocation
>>>> +static void* early_object_page = nullptr;
>>>> +// early_alloc_next_offset points to the 0-relative address of free
>>>> +// memory within a page pointed by early_object_page
>>>> +static size_t early_alloc_next_offset = 0;
>>>> +
>>>> +static early_page_header* to_early_page_header(void* object)
>>>> +{
>>>> +return reinterpret_

[RFC] build script

2018-11-25 Thread Geraldo Netto
Dear Friends,

How are you doing?

Well, I started working a single python script to build the apps a while ago
Long story short, I would like to ask you which features would you
find interesting to have?

By now, I have a set of 'stages' that are declared like download,
patch, compile, clean, dependency and a json config file for it
I know it's ugly but this json file can have both configuration data
and commands (eg: command line to call a script)
The idea is to replace all custom scripts by a standard builder that
also supports custom scripts that will be used only when really
required
Currently, we have many different shell/makefiles doing the same
thing, for example, downloading a file using different approaches

Any suggestion?


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[OT] clang support for asm goto

2018-11-22 Thread Geraldo Netto
l "X" input constraints and blockaddress statements
while also being used directly as elements of the jump list.

Implementing the callbr instruction and asm-goto requires some
adaptation of the existing passes:

* All passes that deal with the CFG must consider all potential
successors of the callbr instruction to be possible. This means that
no passes that simplify the CFG based on any assumptions can work with
callbr

* Due to the way successor and predecessor detection works, some CFG
simplifications such as trivial block elimination may be blocked if
they would result in duplicate successors for the callbr instruction,
as such duplicate successors are incorrectly processed in the IR and
cannot be removed due to being used by the callee

* The indirectbr expansion pass may destroy blockaddress expressions
if the basic blocks they reference are possible successors of an
indirectbr. It may have to be reworked to support this new usage of
the blockaddress expression

Some other notes on the instruction and asm-goto implementation:

* The special status of the "normal" destination label allows to
specifically adjust its transition probability to make it likely to
become a fallthrough successor
* While the initial implementation of asm-goto won't allow outputs,
the instruction's syntax supports them in principle, so the support
for this can be added at a later date
* The general syntax of the callbr instruction allows to use it to
implement the control flow tracking for setjmp/longjmp, but that is
beyond the scope of this RFC


I would like to kindly ask for your comments and thoughts on that. I
will also submit the prototype patch implementing the proposal to
phabricator.

And the most important part, we would like to say huge thanks to
Chandler Carruth, Reid Kleckner, James Y Knight, Bill Wendling, Eric
Christopher, Richard Smith, Matthias Braun, Nick Desaulniers and
others who contributed to this RFC - without you it would not be
possible.


Alexander Ivchenko, Mikhail Dvoretckii
"

Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


tests/tst-truncate.c:10: warning: the use of `tmpnam' is dangerous, better use `mkstemp'

2018-11-20 Thread Geraldo Netto
Dear Friends,

While checking the warnings on tests, I have found this one:
tests/tst-truncate.c:10: warning: the use of `tmpnam' is dangerous,
better use `mkstemp'

The problem in fixing it with mkstemp()  doesn't work exactly the same
way and the most similar function I have found is mkostemp() which is
a gnu extension

I might be wrong since my skills in c/c++ are limited but we have the
following possibilities:
- disable some gcc flag (?)
- reimpliment tmpnam() using other name and possibly other logic
- compose file path with P_tmpdir
(musl implements it
https://github.com/cloudius-systems/musl/blob/master/include/stdio.h)

This is the tmpnam implementation from musl
http://git.musl-libc.org/cgit/musl/tree/src/stdio/tmpnam.c
...
char *tmpnam(char *buf)
{
static char internal[L_tmpnam];
char s[] = "/tmp/tmpnam_XX";
int try;
int r;
for (try=0; try Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] README: document -j option on make / scripts/build

2018-11-18 Thread geraldo netto
Just in case, document -j option on make / scripts/build
Once someone might be unaware of this option

Also, document that nproc is a built-in command from bash/core-utils [1]
That counts the number of available processors

In my case, using compilation without -j takes ~5 minutes against 1.5 minutes 
with -j$(nproc)
Before, I used to overcommit the cpu/thread number on make / scripts/build
but the saturation can actually slow things down...

[1] http://www.gnu.org/software/coreutils/manual/coreutils.html#nproc-invocation

Signed-off-by: geraldo netto 
---
 README.md | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index f68bee57..d9e2d9d6 100644
--- a/README.md
+++ b/README.md
@@ -98,17 +98,26 @@ git submodule update --init --recursive
 Finally, build everything at once:
 
 ```
-make
+make -j$(nproc)
 ```
 
 to build only the OSv kernel, or more usefully,
 
 ```
-scripts/build
+scripts/build -j$(nproc)
 ```
 
 to build an image of the OSv kernel and the default application.
 
+Command nproc (embedded in bash/core-utils) will calculte the number of 
jobs/threads for make and scripts/build automatically.
+Alternatively, the environment variable MAKEFLAGS can be exported as follows:
+
+```
+export MAKEFLAGS=-j$(nproc)
+```
+
+In that case, make and scripts/build do not need the parameter -j.
+
 scripts/build creates the image ```build/last/usr.img``` in qcow2 format.
 To convert this image to other formats, use the ```scripts/convert```
 tool, which can create an image in the vmdk, vdi, raw, or qcow2-old formats
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: info about OSv unikernel architecture

2018-11-15 Thread Geraldo Netto
Ciao Francesco,

Come Stai?

OSv mindset is a little different, the idea is to have 1 OSv instance per
application like a microservice
Imagine OSv like a SpringBoot at the operating system level

Also, we have to consider that OSv doesn't have some primitives like fork()
by design:
https://github.com/cloudius-systems/osv/wiki/OSv-Linux-ABI-Compatibility


Tanti Saluti,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On Wed, 14 Nov 2018 at 23:53, Francesco Iadanza 
wrote:

> Dear OSv community,
> I am testing OSv and I am using the /app REST api to launch commands
> (ffmpeg).
> As far as I understand, the best scenario for OSv is a "microservice"
> approach, one task/app per instance, but I stretched this a bit only to
> understand the OSv architecture.
> So I launched two/three concurrent executions of the same command in new
> ELF namespaces and it seemed to work correctly.
>
> So my question is: would it be safe to run on a single OSv instance a Java
> server + a MySQL server + httpserver for monitoring (or whatever else)?
> Could you explain if there could be any problems if working like this or
> address to some documentation that can clarify this (maybe add a note to
> the official doc)?
>
> Thanks and BR,
> Francesco
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Next (0.53.0 and onwards) OSv releases roadmap proposal

2018-11-13 Thread Geraldo Netto
Hello Roman/Friends,

Roman, I'm having the freedom to share this message with the list once I'm
not an expert in gvisor
Actually, the idea is not to integrate gvisor, but instead take the list of
implemented syscalls and check if we implemented them in OSv or not
But theoretically, gvisor is written in go and go can be interfaced with
assembly/c/c++/...
So, theoretically, we might be able to replace OSv kernel by gvisor but
that would have other implications as far as I know
eg: gvisor is a user space implementation of linux kernel which means we
would still need to provide some linux ABI somehow
Maybe someone from the list might be able to correct me if I'm saying some
no-sense...


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Tue, 13 Nov 2018 at 20:14, Roman Shaposhnik  wrote:

> On Tue, Nov 13, 2018 at 11:10 AM Geraldo Netto 
> wrote:
> >
> > Hi Waldek/Friends!
> >
> > As always, it's very interesting!
> > If you allow me to suggest another thing is to review the syscalls that
> are most used
> > So, we implement them from time to time
> > I think gvisor from google might give an interesting idea once if I
> understood it correctly it's a linux kernel implementation in go
> > and they probably don't support all syscalls but only the most used ones
> > I volunteer myself to check this if you find interesting
>
> I am curious: what kind of integration with gvisor do you have in mind?
>
> Thanks,
> Roman.
>
> > Do You/Nadav happen to have any suggestion?
> >
> > Also, I would suggest to review the wiki page, see if all information
> are still valid
> > and possibily include it in the code, once there are troubleshooting and
> information that might be relevant when running OSv only in terminal
> >
> > As from my personal side, I'm still interested in working (just for fun)
> in the following things:
> > - finish tomcat9 upgrade ("a promise is a debt")
> > - finish the python app build script (it's working but incomplete, I
> might upload to github any time soon)
> > - musl upgrade
> > - modular syscall (check application code recursively to disable all
> unused syscalls, honestly, i don't think I'll ever finish this task, but
> once the idea is interesting enough, i'll keep listing...)
> >
> >
> > Kind Regards,
> >
> > Geraldo Netto
> > Sapere Aude => Non dvcor, dvco
> > http://exdev.sf.net/
> >
> >
> > On Tue, 13 Nov 2018 at 19:54, Waldek Kozaczuk 
> wrote:
> >>
> >> This is somewhat revised version of the roadmap I sent couple of months
> ago. I think that the main premise of it which I wrote in the original
> version still stands:
> >>
> >> "In my opinion, if OSv is to become more relevant than it is now, its
> primary target should be a platform for running stateless and serverless
> apps. Therefore it needs to become leaner (memory usage and kernel size), a
> little more modular and boot faster while preserving its functionality in
> terms of Linux/POSIX ABI (and possibly expanding where it makes sense).
> That is not say that we should not improve support for stateful apps like
> mysql or elasticsearch which would require optimizations to VFS and
> possibly ZFS which I list below."
> >>
> >> OBJECTIVES
> >>
> >> Make OSv more modular
> >>
> >> ZFS and commands/runscript functionality should be moved as optional
> modules in form of shared libraries
> >> The key building block to achieve it should be an improved ROFS
> intended as a default filesystem to load code from
> >>
> >> Optimize kernel size
> >>
> >> My experiments show that kernel (loader-stripped.elf) can be as small
> as 5.1MB after ZFS and program options are compiled out (and there is still
> room for improvements)
> >>
> >> Optimize boot time
> >>
> >> OSv can execute under 50ms on hyperkit and under 100ms on QEMU with
> qboot
> >> Smaller kernel should reduce boot time
> >>
> >> Optimize memory usage
> >>
> >> My recent investigation about memory allocation is OSv shows that it
> should be possible and quite easy to reduce memory utilization in many areas
> >> The aggressive but quite realistic goal should be an ability to run OSv
> with simple C app using no more than 10MB of RAM
> >> Smaller kernel should also reduce memory usage
> >>
> >>
> >> MORE IMPORTANT
> >> File systems
> >>
> >> ROFS
> >>
> >> [FASTER BOOT] Add compression -
> https://github.com/cloudius-systems/osv/issues/978
> >&

Re: Next (0.53.0 and onwards) OSv releases roadmap proposal

2018-11-13 Thread Geraldo Netto
Hi Waldek/Friends!

As always, it's very interesting!
If you allow me to suggest another thing is to review the syscalls that are
most used
So, we implement them from time to time
I think gvisor from google might give an interesting idea once if I
understood it correctly it's a linux kernel implementation in go
and they probably don't support all syscalls but only the most used ones
I volunteer myself to check this if you find interesting
Do You/Nadav happen to have any suggestion?

Also, I would suggest to review the wiki page, see if all information are
still valid
and possibily include it in the code, once there are troubleshooting and
information that might be relevant when running OSv only in terminal

As from my personal side, I'm still interested in working (just for fun) in
the following things:
- finish tomcat9 upgrade ("a promise is a debt")
- finish the python app build script (it's working but incomplete, I might
upload to github any time soon)
- musl upgrade
- modular syscall (check application code recursively to disable all unused
syscalls, honestly, i don't think I'll ever finish this task, but once the
idea is interesting enough, i'll keep listing...)


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Tue, 13 Nov 2018 at 19:54, Waldek Kozaczuk  wrote:

> This is somewhat revised version of the roadmap I sent couple of months
> ago. I think that the main premise of it which I wrote in the original
> version still stands:
>
> "In my opinion, if OSv is to become more relevant than it is now, its
> primary target should be a platform for running stateless and serverless
> apps. Therefore it needs to become leaner (memory usage and kernel size), a
> little more modular and boot faster while preserving its functionality in
> terms of Linux/POSIX ABI (and possibly expanding where it makes sense).
> That is not say that we should not improve support for stateful apps like
> mysql or elasticsearch which would require optimizations to VFS and
> possibly ZFS which I list below."
>
> *OBJECTIVES*
>
>- Make OSv more modular
>-
>   - ZFS and commands/runscript functionality should be moved as
>   optional modules in form of shared libraries
>   - The key building block to achieve it should be an improved ROFS
>   intended as a default filesystem to load code from
>- Optimize kernel size
>-
>   - My experiments show that kernel (loader-stripped.elf) can be as
>   small as 5.1MB after ZFS and program options are compiled out (and 
> there is
>   still room for improvements)
>- Optimize boot time
>-
>   - OSv can execute under 50ms on hyperkit and under 100ms on QEMU
>   with qboot
>   - Smaller kernel should reduce boot time
>- Optimize memory usage
>-
>   - My recent investigation about memory allocation is OSv shows that
>   it should be possible and quite easy to reduce memory utilization in 
> many
>   areas
>   - The aggressive but quite realistic goal should be an ability to
>   run OSv with simple C app using *no more than 10MB of RAM*
>   - Smaller kernel should also reduce memory usage
>
>
> MORE IMPORTANT
> File systems
>
>- ROFS
>-
>   - [FASTER BOOT] Add compression -
>   https://github.com/cloudius-systems/osv/issues/978
>   - [LESS MEMORY] Avoid creating another copy when mmap-ing ROFS file
>   - https://github.com/cloudius-systems/osv/issues/979
>- ZFS
>-
>   - [MODULARITY, SMALLER KERNEL, FASTER BOOT] move all ZFS code in
>   kernel into libzfs.so
>   -
>  - Make ZFS an optional library -
>  https://github.com/cloudius-systems/osv/issues/1009
>   - RAMFS
>-
>   - [SPEED, LESS MEMORY] Fix slow write/append of files on RAMFS -
>   https://github.com/cloudius-systems/osv/issues/884
>   - Eliminate BootFS
>- 9pFS
>-
>   - [ENHANCEMENTS] https://github.com/cloudius-systems/osv/issues/1008
>
>
> Optimize memory usage
>
>- Wasted memory in early (pre-SMP-enabled) malloc (*possibly save 6MB
>of memory!!!*) - https://github.com/cloudius-systems/osv/issues/270
>- Make allocations < 16 bytes more space efficient -
>https://github.com/cloudius-systems/osv/issues/1011
>- Improve physical memory utilization by using memory below 2MB -
>https://github.com/cloudius-systems/osv/issues/1012
>- Make L1/L2 memory pool sizes self-configurable depending on physical
>memory available - https://github.com/cloudius-systems/osv/issues/1013
>- Consider more space-efficient allocation between 1024 and 4096 bytes
>- https://github.com/cloudius-systems/osv/issues/1000
>
>
> Impro

Re: Bug report: soabort() will free *so twice:

2018-11-04 Thread Geraldo Netto
Hey Guys!

I guess, a simple if would solve the problem at the surface
eg:
if (so) sofree(so);

What do you think?
Shall I submit a patch on this?

@jack wang <885...@gmail.com>, do you happen to have any test case
So we can confirm this if (so) might be enough?

Any suggestion is welcomed :)


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Mon, 29 Oct 2018 at 15:28, Waldek Kozaczuk  wrote:

> Adding Charles to the thread.
>
> On Mon, Oct 29, 2018 at 2:24 PM Waldek Kozaczuk 
> wrote:
>
>> I think that this code in tcp_usr_abort has to be changed -
>> https://github.com/cloudius-systems/osv/blob/master/bsd/sys/netinet/tcp_usrreq.cc#L909-L924.
>> If first "if" with two conditions is true than the second is as well
>> (unless inp_flags get changed by tcp_drop()) and even this statement might
>> blow up -
>>
>> so->so_state |= SS_PROTOREF; .
>>
>> I think that tcp_drop() returns NULL if it calls sofree() downstream in
>> tcp_close(). So I think we need to change the tcp_usr_abort to detect if
>> tcp_drop returned NULL, change the signature and pass somehow the
>> information back to soabort() to make it do not call soclose() again.
>>
>> I checked and pru_abort is only used in 2 places.
>>
>> I also wonder if Charles Meyers from Spirent fixed it in one of his
>> patches.
>>
>> Waldek
>>
>> On Monday, October 29, 2018 at 12:12:14 PM UTC-4, Nadav Har'El wrote:
>>>
>>> I wonder if https://github.com/cloudius-systems/osv/issues/936 is
>>> related to this?
>>>
>>> --
>>> Nadav Har'El
>>> n...@scylladb.com
>>>
>>>
>>> On Tue, Oct 23, 2018 at 6:22 PM Geraldo Netto 
>>> wrote:
>>>
>>>> Hello Jack/All,
>>>>
>>>> Nice catch, as soon as I can I'll check that
>>>>
>>>> I guess we can do a recursive grep for sofree to check where sofree()
>>>> is been called
>>>> Let's keep in touch
>>>>
>>>>
>>>> Kind Regards,
>>>> Geraldo Netto
>>>>
>>>> Em ter, 23 de out de 2018 06:32, jack wang <885...@gmail.com> escreveu:
>>>>
>>>>> I found a bug: soabort() will free *so twice:
>>>>>
>>>>> soabort() (in bsd/sys/kern/uipc_socket.cc)
>>>>>-> pru_abort() (in tcp_usr_abort in bsd/sys/netinet/tcp_usrreq.cc)
>>>>>->tcp_drop() (in tcp_usr_abort in bsd/sys/netinet/tcp_subr.cc)
>>>>>->tcp_close() (in tcp_usr_abort in
>>>>> bsd/sys/netinet/tcp_subr.cc)
>>>>>->sofree(so) //free so here for the first time
>>>>>->sofree(so); //free so here for the second time
>>>>>
>>>>>
>>>>> I am not familiar with the code here. I don't know how to fix it. Can
>>>>> someone help me?
>>>>>
>>>>> source code:
>>>>> void
>>>>> soabort(struct socket *so)
>>>>> {
>>>>>uipc_d("soabort() so=%" PRIx64, (uint64_t)so);
>>>>>
>>>>> /*
>>>>> * In as much as is possible, assert that no references to this
>>>>> * socket are held.  This is not quite the same as asserting
>>>>> that the
>>>>> * current thread is responsible for arranging for no
>>>>> references, but
>>>>> * is as close as we can get for now.
>>>>> */
>>>>>KASSERT(so->so_count == 0, ("soabort: so_count"));
>>>>>KASSERT((so->so_state & SS_PROTOREF) == 0, ("soabort:
>>>>> SS_PROTOREF"));
>>>>>KASSERT(so->so_state & SS_NOFDREF, ("soabort: !SS_NOFDREF"));
>>>>>KASSERT((so->so_state & SQ_COMP) == 0, ("soabort: SQ_COMP"));
>>>>>KASSERT((so->so_state & SQ_INCOMP) == 0, ("soabort: SQ_INCOMP"
>>>>> ));
>>>>>VNET_SO_ASSERT(so);
>>>>>
>>>>> if (so->so_proto->pr_usrreqs->pru_abort != NULL)
>>>>>(*so->so_proto->pr_usrreqs->pru_abort)(so);  /*free
>>>>> so*/
>>>>>
>>>>> ACCEPT_LOCK();
>>>>>SOCK_LOCK(so);
>>>>>sofree(so); /*free so*/
>>>>> }
>>>>

[PATCH v2 3/3] test: fix possible undefined behaviour at the loop that fills the buffer for crypt tests

2018-11-04 Thread geraldo netto
this patch avoids a possible undefined behviour at the loop when it tries to 
access the password field after the 6th position (password is a fixed size 
string of 6 chars)
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:44:29: warning: iteration 
6 invokes undefined behavior [-Waggressive-loop-optimizations]
buf[i * 8 + j] = password[i] >> j & 1;
 ^~~
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:42:2: note: within this 
loop
  for (i = 0; i < 8; i++) {
  ^~~

Signed-off-by: geraldo netto 
---
 tests/tst-crypt.c | 18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
index abcec95f..9aec1692 100644
--- a/tests/tst-crypt.c
+++ b/tests/tst-crypt.c
@@ -32,41 +32,37 @@ int main(void) {
if (strcmp(result3, crypt(password, concat_str((char*) "$5$", 
password))) != 0) return -3;
 
// 
$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1
-   if (strcmp(result4, crypt(password, concat_str((char*) "$6$", 
password))) !=0) return -4;
+   if (strcmp(result4, crypt(password, concat_str((char*) "$6$", 
password))) != 0) return -4;
 
// encrypt
// http://man7.org/linux/man-pages/man3/encrypt.3.html
char key[64];
char buf[64];
-   char txt[9];
+   char txt[6];
int i, j;
 
-   for (i = 0; i < 8; i++) {
+   for (i = 0; i < 6; i++) {
for (j = 0; j < 8; j++) {
buf[i * 8 + j] = password[i] >> j & 1;
}
-
-   setkey(key);
}
+   setkey(key);
+
 
encrypt(buf, 0);
-   for (i = 0; i < 8; i++) {
+   for (i = 0; i < 6; i++) {
for (j = 0, txt[i] = '\0'; j < 8; j++) {
txt[i] |= buf[i * 8 + j] << j;
}
-
-   txt[8] = '\0';
}
 
if (strcmp(password, txt) == 0) return -5;
 
encrypt(buf, 1);
-   for (i = 0; i < 8; i++) {
+   for (i = 0; i < 6; i++) {
for (j = 0, txt[i] = '\0'; j < 8; j++) {
txt[i] |= buf[i * 8 + j] << j;
}
-
-   txt[8] = '\0';
}
 
return (strcmp(password, txt) == 0) ? 0 : -6;
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 2/3] test: replace strncat() by strcat() to fix crypt warnings

2018-11-04 Thread geraldo netto
this patch fixes the following warnings:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c: In function ‘concat_str’:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:9:34: warning: argument 
to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you 
mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
  strncat(tmp, first_block, sizeof(first_block));
  ^
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:10:35: warning: argument 
to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you 
mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
  strncat(tmp, second_block, sizeof(second_block));
   ^

Signed-off-by: geraldo netto 
---
 tests/tst-crypt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
index 7ccc8235..abcec95f 100644
--- a/tests/tst-crypt.c
+++ b/tests/tst-crypt.c
@@ -6,10 +6,10 @@
 #include 
 
 char* concat_str(char* first_block, char* second_block) {
-   static char tmp[10];
+   static char tmp[8];
memset(tmp, 0, sizeof(tmp));
-   strncat(tmp, first_block, sizeof(first_block));
-   strncat(tmp, second_block, sizeof(second_block));
+   strcat(tmp, first_block);
+   strcat(tmp, second_block);
return tmp;
 }
 
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] update libedit (GNU readline replacement)

2018-11-02 Thread geraldo netto
this patch updates libedit from version 20140620-3.1 to 20180525-3.1
which brings a huge number of fixes/improvements

for more details:
https://thrysoee.dk/editline/
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/

Signed-off-by: geraldo netto 
---
 modules/libedit/Makefile  | 4 ++--
 modules/libedit/module.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/libedit/Makefile b/modules/libedit/Makefile
index 04979144..66db300d 100644
--- a/modules/libedit/Makefile
+++ b/modules/libedit/Makefile
@@ -5,7 +5,7 @@ DOWNLOAD=download
 BUILD=build
 
 # libedit
-LE_VERSION=20140620-3.1
+LE_VERSION=20180525-3.1
 LE_FOLDER=libedit-$(LE_VERSION)
 LE_DOWNLOAD=http://thrysoee.dk/editline/libedit-$(LE_VERSION).tar.gz
 LE_ARCHIVE=download/$(LE_FOLDER).tar.gz
@@ -14,7 +14,7 @@ LE_BUILD=$(BUILD)/$(LE_FOLDER)
 CFLAGS:=-fPIC
 LDFLAGS:=-L$(abspath $(lastword $(wildcard ../ncurses/build/*/lib)))
 
-MAIN=$(LE_BUILD)/src/.libs/libedit.so.0
+MAIN=$(LE_BUILD)/src/.libs/libedit.so.2
 
 module: $(MAIN)
 
diff --git a/modules/libedit/module.py b/modules/libedit/module.py
index 53582563..785d7d62 100644
--- a/modules/libedit/module.py
+++ b/modules/libedit/module.py
@@ -1,6 +1,6 @@
 from osv.modules.filemap import FileMap
 
-VERSION = '20140620-3.1'
+VERSION = '20180525-3.1'
 
 usr_files = FileMap()
 usr_files.add('${OSV_BASE}/modules/libedit/build/libedit-%s/src/.libs' % 
VERSION).to('/usr/lib') \
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH 2/3] test: fix strncat() calls by passing proper sizeof()

2018-11-02 Thread Geraldo Netto
Hey Waldek/Friends,

Uhm, I see, let me double check it
Because I just adapted the code and my c/c++ skills are limited
In any case, let's keep in touch


Kind regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Fri, 2 Nov 2018 at 00:33, Waldek Kozaczuk  wrote:

> I think this patch fixes the warning but the underlying test has the bugs
> - should not we be using strlen() instead of sizeof() which simply returns
> 8 (size of the pointer) instead of intended length of the string. Do we
> actually need strncat - shouldn't strcat be enough? I guess you are also
> assuming that total length of first_block and second_block is not longer
> than 10?
>
> On Wednesday, October 31, 2018 at 11:21:42 PM UTC-4, Geraldo Netto wrote:
>>
>> this patch fix the following strncat() calls by passing proper sizeof():
>> /home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c: In function
>> ‘concat_str’:
>> /home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:9:34: warning:
>> argument to ‘sizeof’ in ‘strncat’ call is the same expression as the
>> source; did you mean to provide an explicit length?
>> [-Wsizeof-pointer-memaccess]
>>   strncat(tmp, first_block, sizeof(first_block));
>>   ^
>> /home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:10:35: warning:
>> argument to ‘sizeof’ in ‘strncat’ call is the same expression as the
>> source; did you mean to provide an explicit length?
>> [-Wsizeof-pointer-memaccess]
>>   strncat(tmp, second_block, sizeof(second_block));
>>^
>>
>> Signed-off-by: geraldo netto 
>> ---
>>  tests/tst-crypt.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
>> index 7ccc8235..dc9a6341 100644
>> --- a/tests/tst-crypt.c
>> +++ b/tests/tst-crypt.c
>> @@ -8,11 +8,12 @@
>>  char* concat_str(char* first_block, char* second_block) {
>>  static char tmp[10];
>>  memset(tmp, 0, sizeof(tmp));
>> -strncat(tmp, first_block, sizeof(first_block));
>> -strncat(tmp, second_block, sizeof(second_block));
>> +strncat(tmp, first_block, sizeof(char*));
>> +strncat(tmp, second_block, sizeof(char*));
>>  return tmp;
>>  }
>>
>> +// to test as a standalone app: gcc tests/tst-crypt.c -lcrypt -o crypt
>>  int main(void) {
>>  // http://man7.org/linux/man-pages/man3/crypt.3.html
>>  char password[] = "Ab(d3";
>> --
>> 2.17.1
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 1/3] test: fix 'implicit declaration of function' by including stdlib, unistd

2018-10-31 Thread geraldo netto
this patch fixes the following warnings by adding stdlib.h and unistd.h:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c: In function ‘main’:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:47:3: warning: implicit 
declaration of function ‘setkey’; did you mean ‘setbuf’? 
[-Wimplicit-function-declaration]
   setkey(key);
   ^~
   setbuf
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:50:2: warning: implicit 
declaration of function ‘encrypt’; did you mean ‘crypt’? 
[-Wimplicit-function-declaration]
  encrypt(buf, 0);
  ^~~
  crypt

Signed-off-by: geraldo netto 
---
 tests/tst-crypt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
index ffc52933..7ccc8235 100644
--- a/tests/tst-crypt.c
+++ b/tests/tst-crypt.c
@@ -1,6 +1,8 @@
 #define _XOPEN_SOURCE
 #include 
+#include 
 #include 
+#include 
 #include 
 
 char* concat_str(char* first_block, char* second_block) {
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 0/3] test: cleanup warnings on tst-crypt

2018-10-31 Thread geraldo netto
This serie of patches do cleanup all the warnings found on tst-crypt

geraldo netto (3):
  test: fix 'implicit declaration of function' by including stdlib,
unistd
  test: fix strncat() calls by passing proper sizeof()
  test: fix possible undefined behaviour at the loop that fills the
buffer for crypt tests

 tests/tst-crypt.c | 27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 2/3] test: fix strncat() calls by passing proper sizeof()

2018-10-31 Thread geraldo netto
this patch fix the following strncat() calls by passing proper sizeof():
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c: In function ‘concat_str’:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:9:34: warning: argument 
to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you 
mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
  strncat(tmp, first_block, sizeof(first_block));
  ^
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:10:35: warning: argument 
to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you 
mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
  strncat(tmp, second_block, sizeof(second_block));
   ^

Signed-off-by: geraldo netto 
---
 tests/tst-crypt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
index 7ccc8235..dc9a6341 100644
--- a/tests/tst-crypt.c
+++ b/tests/tst-crypt.c
@@ -8,11 +8,12 @@
 char* concat_str(char* first_block, char* second_block) {
static char tmp[10];
memset(tmp, 0, sizeof(tmp));
-   strncat(tmp, first_block, sizeof(first_block));
-   strncat(tmp, second_block, sizeof(second_block));
+   strncat(tmp, first_block, sizeof(char*));
+   strncat(tmp, second_block, sizeof(char*));
return tmp;
 }
 
+// to test as a standalone app: gcc tests/tst-crypt.c -lcrypt -o crypt
 int main(void) {
// http://man7.org/linux/man-pages/man3/crypt.3.html
char password[] = "Ab(d3";
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 3/3] test: fix possible undefined behaviour at the loop that fills the buffer for crypt tests

2018-10-31 Thread geraldo netto
this patch avoids a possible undefined behviour at the loop when it tries to 
access the password field after the 6th position (password is a fixed size 
string of 6 chars)
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:44:29: warning: iteration 
6 invokes undefined behavior [-Waggressive-loop-optimizations]
buf[i * 8 + j] = password[i] >> j & 1;
 ^~~
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-crypt.c:42:2: note: within this 
loop
  for (i = 0; i < 8; i++) {
  ^~~

Signed-off-by: geraldo netto 
---
 tests/tst-crypt.c | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
index dc9a6341..25a81aba 100644
--- a/tests/tst-crypt.c
+++ b/tests/tst-crypt.c
@@ -39,36 +39,32 @@ int main(void) {
// http://man7.org/linux/man-pages/man3/encrypt.3.html
char key[64];
char buf[64];
-   char txt[9];
+   char txt[7];
int i, j;
 
-   for (i = 0; i < 8; i++) {
+   for (i = 0; i < 6; i++) {
for (j = 0; j < 8; j++) {
buf[i * 8 + j] = password[i] >> j & 1;
}
-
-   setkey(key);
}
+   setkey(key);
 
encrypt(buf, 0);
-   for (i = 0; i < 8; i++) {
+   for (i = 0; i < 6; i++) {
for (j = 0, txt[i] = '\0'; j < 8; j++) {
txt[i] |= buf[i * 8 + j] << j;
}
-
-   txt[8] = '\0';
}
-
+   txt[6] = '\0';
if (strcmp(password, txt) == 0) return -5;
 
+
encrypt(buf, 1);
-   for (i = 0; i < 8; i++) {
+   for (i = 0; i < 6; i++) {
for (j = 0, txt[i] = '\0'; j < 8; j++) {
txt[i] |= buf[i * 8 + j] << j;
}
-
-   txt[8] = '\0';
}
-
+   txt[6] = '\0';
return (strcmp(password, txt) == 0) ? 0 : -6;
 }
\ No newline at end of file
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] test: fix warning on tst-calloc by removing unused variable

2018-10-31 Thread geraldo netto
this patch fixes the following warning:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-calloc.cc: In function ‘int 
main()’:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-calloc.cc:34:16: warning: unused 
variable ‘refX’ [-Wunused-variable]
 const char refX[11] = "XX";
^~~~

Signed-off-by: geraldo netto 
---
 tests/tst-calloc.cc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/tst-calloc.cc b/tests/tst-calloc.cc
index a0cb5548..7cf52757 100644
--- a/tests/tst-calloc.cc
+++ b/tests/tst-calloc.cc
@@ -31,7 +31,6 @@ int main()
 {
 char *buf1;
 const char ref0[11] = "\0";
-const char refX[11] = "XX";
 int len1, len2;
 
 len1 = 1;
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] test: fix warning on tst-pthread.c by including unistd.h

2018-10-31 Thread geraldo netto
this patch fixes the following warning by adding unistd.h
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-pthread.c: In function ‘main’:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-pthread.c:171:5: warning: 
implicit declaration of function ‘usleep’; did you mean ‘fseek’? 
[-Wimplicit-function-declaration]
usleep(1000);
^~
fseek

Signed-off-by: geraldo netto 
---
 tests/tst-pthread.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/tst-pthread.c b/tests/tst-pthread.c
index 066fff79..44854313 100644
--- a/tests/tst-pthread.c
+++ b/tests/tst-pthread.c
@@ -5,6 +5,7 @@
  * BSD license as described in the LICENSE file in the top-level directory.
  */
 
+#include 
 #include 
 #include 
 #include 
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] test: fix warning on tst-pthread.c by including unistd.h

2018-10-31 Thread geraldo netto
this patch fix the following warning by adding unistd.h
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-pthread.c: In function ‘main’:
/home/netto/Desktop/osv/osv-tomcat9/tests/tst-pthread.c:171:5: warning: 
implicit declaration of function ‘usleep’; did you mean ‘fseek’? 
[-Wimplicit-function-declaration]
usleep(1000);
^~
fseek

Signed-off-by: geraldo netto 
---
 tests/tst-pthread.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/tst-pthread.c b/tests/tst-pthread.c
index 066fff79..44854313 100644
--- a/tests/tst-pthread.c
+++ b/tests/tst-pthread.c
@@ -5,6 +5,7 @@
  * BSD license as described in the LICENSE file in the top-level directory.
  */
 
+#include 
 #include 
 #include 
 #include 
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] test: fix tst-pthread.c by including unistd.h

2018-10-31 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 tests/tst-pthread.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/tst-pthread.c b/tests/tst-pthread.c
index 066fff79..44854313 100644
--- a/tests/tst-pthread.c
+++ b/tests/tst-pthread.c
@@ -5,6 +5,7 @@
  * BSD license as described in the LICENSE file in the top-level directory.
  */
 
+#include 
 #include 
 #include 
 #include 
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Add explicit instructions on how to contribute

2018-10-24 Thread Geraldo Netto
Hello Waldek/Friends,

Me neither, I guess Nadav/Avi might have permission to edit this information
BTW, great work with the last patches!!! :)
I'm still busy with other personal things
But as soon as I can I'll check the report from Jack Wang, review tomcat9
patches, crypt, 


Semper Fidelis,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Wed, 24 Oct 2018 at 22:31, Waldek Kozaczuk  wrote:

> Every so often someone would submit github PR and waste his time because
> he/she does not know we accept email patches only. I think that may also
> discourage potential contributors.
>
> Could some add following text in this area as shown in the attached
> screenshot:
>
> "Please see
> https://github.com/cloudius-systems/osv/wiki/Formatting-and-sending-patches 
> for
> how to submit changes to OSv. Pull Requests are ignored. "
>
> I would have done it myself but I do not have permission.
>
> Regards,
> Waldek
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bug report: soabort() will free *so twice:

2018-10-23 Thread Geraldo Netto
Hello Jack/All,

Nice catch, as soon as I can I'll check that

I guess we can do a recursive grep for sofree to check where sofree() is
been called
Let's keep in touch


Kind Regards,
Geraldo Netto

Em ter, 23 de out de 2018 06:32, jack wang <885...@gmail.com> escreveu:

> I found a bug: soabort() will free *so twice:
>
> soabort() (in bsd/sys/kern/uipc_socket.cc)
>-> pru_abort() (in tcp_usr_abort in bsd/sys/netinet/tcp_usrreq.cc)
>->tcp_drop() (in tcp_usr_abort in bsd/sys/netinet/tcp_subr.cc)
>->tcp_close() (in tcp_usr_abort in bsd/sys/netinet/tcp_subr.cc)
>->sofree(so) //free so here for the first time
>->sofree(so); //free so here for the second time
>
>
> I am not familiar with the code here. I don't know how to fix it. Can
> someone help me?
>
> source code:
> void
> soabort(struct socket *so)
> {
>uipc_d("soabort() so=%" PRIx64, (uint64_t)so);
>
> /*
> * In as much as is possible, assert that no references to this
> * socket are held.  This is not quite the same as asserting that
> the
> * current thread is responsible for arranging for no references,
> but
> * is as close as we can get for now.
> */
>KASSERT(so->so_count == 0, ("soabort: so_count"));
>KASSERT((so->so_state & SS_PROTOREF) == 0, ("soabort: SS_PROTOREF"
> ));
>KASSERT(so->so_state & SS_NOFDREF, ("soabort: !SS_NOFDREF"));
>KASSERT((so->so_state & SQ_COMP) == 0, ("soabort: SQ_COMP"));
>KASSERT((so->so_state & SQ_INCOMP) == 0, ("soabort: SQ_INCOMP"));
>VNET_SO_ASSERT(so);
>
> if (so->so_proto->pr_usrreqs->pru_abort != NULL)
>(*so->so_proto->pr_usrreqs->pru_abort)(so);  /*free so*/
>
> ACCEPT_LOCK();
>SOCK_LOCK(so);
>sofree(so); /*free so*/
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OSv v0.52.0 released !!!

2018-10-19 Thread Geraldo Netto
Hey Guys,

This is great, Long live OSv

while (1) { Waldek++; }


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Fri, 19 Oct 2018 at 00:55, Waldek Kozaczuk  wrote:

> I have just published another release of OSv -
> https://github.com/cloudius-systems/osv/releases/tag/v0.52.0. I am also
> enclosing the release notes down here. Feel free to point out things that I
> wrote incorrectly in any place (even though it has been published I believe
> we can still edit the notes).
>
> Regards,
> Waldek
>
> "This is the next release of OSv since the previous release 0.51.0 was
> crafted. Though this release does not deliver any dramatic features, it
> brings major improvements around kernel size and memory utilization and
> adds support of many new apps including Python 3. We hope new releases will
> happen every quarter and the next one should be expected around beginning
> of 2019.
> Features Highlights
>
>- Smaller kernel which makes OSv use less memory and boot faster
>   - reduces non-compressed kernel size from 9.2MB to 6.7MB (27%
>   reduction) and compressed one from 6.2MB to 3.9MB (37% reduction)
>   - reduces boot time by ~ 20ms
>- Reduced minimal memory to run OSv to 25MB
>- Reduced memory utilization for ram images (especially large ones)
>- Added support for Python 3 and Golang 1.11
>- Added many new apps including ffmpeg, spring boot, ratpack and akka
>
> Specifics
>
>- Set non-isolated mode as a default one for Java images
>- Removed obscure UTF8 normalization feature to save 130 KB in kernel
>size
>- Started merging IPv6 code from Spirent
>- Relaxed ELF symbol resolution failure when BIND_NOW which should
>make more apps supported out of the box on OSv
>- Improved bootfs to remove unnecessary copy of data
>- Revived multi boot mode to support eventually booting on Hyperkit
>and on QEMU with qboot
>- Implemented almost-in-place kernel decompression to reduce minimal
>memory size that provides a foundation for even less memory usage changes
>in the future
>- Disabled '—whole-archive' linking for libgcc.a to reduce kernel size
>by 2.5MB
>
> Closed issues
>
>- #645 <https://github.com/cloudius-systems/osv/issues/645>
>- #781 <https://github.com/cloudius-systems/osv/issues/781>
>- #792 <https://github.com/cloudius-systems/osv/issues/792>
>- #977 <https://github.com/cloudius-systems/osv/issues/977>
>- #984 <https://github.com/cloudius-systems/osv/issues/984>
>- #985 <https://github.com/cloudius-systems/osv/issues/985>
>- #989 <https://github.com/cloudius-systems/osv/issues/989>
>- #990 <https://github.com/cloudius-systems/osv/issues/990>
>- #993 <https://github.com/cloudius-systems/osv/issues/993>
>- #999 <https://github.com/cloudius-systems/osv/issues/999>
>
> List of contributors alphabetically
>
>- Charles Myers (@cmyers-spirent <https://github.com/cmyers-spirent>)
>- 2 patches
>- Geraldo Netto - 2 patches
>- Nadav Har'El (@nyh <https://github.com/nyh>) - 13 patches
>- Timmons C. Player (@DerangedMonkeyNinja
><https://github.com/DerangedMonkeyNinja>) - 1 patch
>- Waldemar Kozaczuk (@wkozaczuk <https://github.com/wkozaczuk>) - 23
>patches
>
> Acknowledgments
>
> We want to thank all contributors to the project. But the special thanks
> go to:
>
>- Nadav Har’El for contributing and reviewing many patches and
>providing guidance for many others
>- Waldemar Kozaczuk for contributing most patches
>- Timmons C. Player and Charles Myers for contributing patches
>providing initial IPV6 support
>
> Artifacts
>
> This time we are only publishing kernel and capstan packages for Python 3
> and ffmpeg."
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 0/2] fix openjdk8-zulu url

2018-09-07 Thread geraldo netto
the first patch applies the same url extraction as committed a few days ago
the second patch reuses the script from the first patch

please, note, it's a partial fix once it only fixes the download of 
openjdk8-zulu
we still need to review all the compact profile

geraldo netto (2):
  improve url parsing for openjdk8-zulu-compact-common
  openjdk8-zulu-full: reuse openjdk8-zulu-compact-common

 openjdk8-zulu-compact-common/latest.sh | 2 +-
 openjdk8-zulu-full/latest.sh   | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 2/2] openjdk8-zulu-full: reuse openjdk8-zulu-compact-common

2018-09-07 Thread geraldo netto
reuse openjdk8-zulu-compact-common/latest.sh in order to avoid duplicated script
now, all zulu profiles (compact1, 2, 3, 3 with beans, full) are using a single 
source

Signed-off-by: geraldo netto 
---
 openjdk8-zulu-full/latest.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/openjdk8-zulu-full/latest.sh b/openjdk8-zulu-full/latest.sh
index f8d9d5a..d0195a5 100755
--- a/openjdk8-zulu-full/latest.sh
+++ b/openjdk8-zulu-full/latest.sh
@@ -1,3 +1,2 @@
 #!/bin/bash
-
-wget -c -qO- http://www.azul.com/downloads/zulu/zulu-linux | grep -o 'https://groups.google.com/d/optout.


[PATCH 2/2] tomcat: reorganise patches

2018-09-04 Thread geraldo netto
reorganise patches to make it easier to change in the future

Signed-off-by: geraldo netto 
---
 tomcat/patches/perf/0001-add-admin-user.patch | 32 +++
 .../perf/0001-configure-web-admin-user.patch  | 31 --
 .../0002-grant-admin-gui-to-tomcat-user.patch | 26 +++
 ...assign-admin-gui-role-to-tomcat-user.patch | 25 ---
 ...grant-manager-script-to-tomcat-user.patch} | 21 ++--
 ...004-disable-jasper-development-mode.patch} | 17 +-
 ...ch => 0005-change-http-port-to-8081.patch} | 19 +--
 ... => 0006-increase-number-of-threads.patch} | 17 +-
 ...ch => 0007-force-HTTP-NIO-connector.patch} | 21 ++--
 ...patch => 0008-disable-AJP-connector.patch} | 17 ++
 10 files changed, 119 insertions(+), 107 deletions(-)
 create mode 100644 tomcat/patches/perf/0001-add-admin-user.patch
 delete mode 100644 tomcat/patches/perf/0001-configure-web-admin-user.patch
 create mode 100644 
tomcat/patches/perf/0002-grant-admin-gui-to-tomcat-user.patch
 delete mode 100644 
tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
 rename 
tomcat/patches/perf/{0006-Add-script-managment-role-to-tomcat-user.patch => 
0003-grant-manager-script-to-tomcat-user.patch} (56%)
 rename tomcat/patches/perf/{0004-disable-Jasper-development-mode.patch => 
0004-disable-jasper-development-mode.patch} (57%)
 rename tomcat/patches/perf/{0002-change-http-port-to-8081.patch => 
0005-change-http-port-to-8081.patch} (54%)
 rename tomcat/patches/perf/{0005-bump-up-number-of-threads.patch => 
0006-increase-number-of-threads.patch} (56%)
 rename tomcat/patches/perf/{0007-Use-bio-connector-explicitly.patch => 
0007-force-HTTP-NIO-connector.patch} (53%)
 rename tomcat/patches/perf/{0008-Do-not-enable-AJP-connector.patch => 
0008-disable-AJP-connector.patch} (59%)

diff --git a/tomcat/patches/perf/0001-add-admin-user.patch 
b/tomcat/patches/perf/0001-add-admin-user.patch
new file mode 100644
index 000..33318f7
--- /dev/null
+++ b/tomcat/patches/perf/0001-add-admin-user.patch
@@ -0,0 +1,32 @@
+From 64efcb7d8aa8279cf80b10accf09ba4fdff1027d Mon Sep 17 00:00:00 2001
+From: geraldo netto 
+Date: Tue, 4 Sep 2018 13:22:13 -0300
+Subject: [PATCH 1/8] add admin user
+
+original patch from Tomasz Grabiec
+
+Signed-off-by: geraldo netto 
+---
+ conf/tomcat-users.xml | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/conf/tomcat-users.xml b/conf/tomcat-users.xml
+index aef66d0..18c3d07 100644
+--- a/conf/tomcat-users.xml
 b/conf/tomcat-users.xml
+@@ -35,10 +35,11 @@
+   them. You will also need to set the passwords to something appropriate.
+ -->
+ 
++  
++  
+ 
+-- 
+2.17.1
+
diff --git a/tomcat/patches/perf/0001-configure-web-admin-user.patch 
b/tomcat/patches/perf/0001-configure-web-admin-user.patch
deleted file mode 100644
index d445541..000
--- a/tomcat/patches/perf/0001-configure-web-admin-user.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 08dea01a79210846ae959f05ccc2d85a9a78e92e Mon Sep 17 00:00:00 2001
-From: Tomasz Grabiec 
-Date: Thu, 17 Oct 2013 15:34:25 +0200
-Subject: [PATCH 1/5] configure web admin user
-
-
-Signed-off-by: Tomasz Grabiec 

- conf/tomcat-users.xml | 7 +--
- 1 file changed, 1 insertion(+), 6 deletions(-)
-
-diff --git a/conf/tomcat-users.xml b/conf/tomcat-users.xml
-index 7f022ff..2f9579c 100644
 a/conf/tomcat-users.xml
-+++ b/conf/tomcat-users.xml
-@@ -26,11 +26,6 @@
-   and thus are ignored when reading this file. Do not forget to remove
-that surrounds them.
- -->
--
-+  
- 
--- 
-1.8.1.2
-
diff --git a/tomcat/patches/perf/0002-grant-admin-gui-to-tomcat-user.patch 
b/tomcat/patches/perf/0002-grant-admin-gui-to-tomcat-user.patch
new file mode 100644
index 000..8811cf0
--- /dev/null
+++ b/tomcat/patches/perf/0002-grant-admin-gui-to-tomcat-user.patch
@@ -0,0 +1,26 @@
+From e9dc960c8baff6de21da552f41812a8875e9b53c Mon Sep 17 00:00:00 2001
+From: geraldo netto 
+Date: Tue, 4 Sep 2018 13:23:20 -0300
+Subject: [PATCH 2/8] grant admin-gui to tomcat user
+
+original patch from Tomasz Grabiec
+
+Signed-off-by: geraldo netto 
+---
+ conf/tomcat-users.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/conf/tomcat-users.xml b/conf/tomcat-users.xml
+index 18c3d07..fff2786 100644
+--- a/conf/tomcat-users.xml
 b/conf/tomcat-users.xml
+@@ -41,5 +41,5 @@
+   
+ -->
+   
+-  
++  
+ 
+-- 
+2.17.1
+
diff --git 
a/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch 
b/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
deleted file mode 100644
index 27ed2ae..000
--- a/tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 4da61bbd4d8e54db1da9b77c16f5bb02c91bce60 Mon Sep 17 00:00:00 2001
-From: Tomasz Grabiec 
-Date: Wed, 20 Nov 2013 09:11:31 +0100
-Subject: [PATCH 3/5] assign admin-gui role to tomcat user
-
-
-Signed-off-by: Tomasz Grabiec 

- conf/t

[PATCH 1/2] tomcat: upgrade from 8.0.15 to 9.0.11

2018-09-04 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 tomcat/GET | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/tomcat/GET b/tomcat/GET
index 0a21749..a15be5f 100755
--- a/tomcat/GET
+++ b/tomcat/GET
@@ -1,32 +1,34 @@
 #!/usr/bin/env bash
 set -e
-MAJOR=8
-VERSION=${MAJOR}.0.15
+MAJOR=9
+VERSION=${MAJOR}.0.11
 
 dir=apache-tomcat-$VERSION
 archive=$dir.tar.gz
 
 mkdir -p upstream
 pushd upstream
+
 wget -c 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}
-wget -c 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}.md5
-if [ "$(md5sum -c ${archive}.md5)" != "${archive}: OK" ];
+wget -c 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}.sha1
+
+if [ "$(sha1sum -c ${archive}.sha1)" != "${archive}: OK" ];
 then
-echo "Aborting: invalid md5 for Apache Tomcat $VERSION"
+echo "Aborting: invalid sha1 for Apache Tomcat $VERSION"
 exit 1
 fi
+
 tar zxvf $archive
 
 pushd $dir
-for p in $(find ../../patches/perf/ -name '*.patch' | sort); do
-echo "Applying $p"
-patch -p1 < $p
+for patch in $(find ../../patches/perf/ -name '*.patch' | sort); do
+echo "Applying $patch"
+patch -p1 < "$patch"
 done
 popd
 
 popd
 
-
 mkdir ROOTFS
 mkdir -p ROOTFS/usr/tomcat
 mv upstream/$dir/* ROOTFS/usr/tomcat
-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 0/2] tomcat: upgrade from tomcat 8 to tomcat 9

2018-09-04 Thread geraldo netto
these 2 patches upgrade tomcat version from 8.0.15 to 9.0.11
the patches applied on tomcat were reorganised to make it easier to tune in the 
future
HTTP NIO connector is used instead of HTTP NIO2 connector because of general 
protection fault (see past emails)

geraldo netto (2):
  tomcat: upgrade from 8.0.15 to 9.0.11
  tomcat: reorganise patches

 tomcat/GET| 20 ++--
 tomcat/patches/perf/0001-add-admin-user.patch | 32 +++
 .../perf/0001-configure-web-admin-user.patch  | 31 --
 .../0002-grant-admin-gui-to-tomcat-user.patch | 26 +++
 ...assign-admin-gui-role-to-tomcat-user.patch | 25 ---
 ...grant-manager-script-to-tomcat-user.patch} | 21 ++--
 ...004-disable-jasper-development-mode.patch} | 17 +-
 ...ch => 0005-change-http-port-to-8081.patch} | 19 +--
 ... => 0006-increase-number-of-threads.patch} | 17 +-
 ...ch => 0007-force-HTTP-NIO-connector.patch} | 21 ++--
 ...patch => 0008-disable-AJP-connector.patch} | 17 ++
 11 files changed, 130 insertions(+), 116 deletions(-)
 create mode 100644 tomcat/patches/perf/0001-add-admin-user.patch
 delete mode 100644 tomcat/patches/perf/0001-configure-web-admin-user.patch
 create mode 100644 
tomcat/patches/perf/0002-grant-admin-gui-to-tomcat-user.patch
 delete mode 100644 
tomcat/patches/perf/0003-assign-admin-gui-role-to-tomcat-user.patch
 rename 
tomcat/patches/perf/{0006-Add-script-managment-role-to-tomcat-user.patch => 
0003-grant-manager-script-to-tomcat-user.patch} (56%)
 rename tomcat/patches/perf/{0004-disable-Jasper-development-mode.patch => 
0004-disable-jasper-development-mode.patch} (57%)
 rename tomcat/patches/perf/{0002-change-http-port-to-8081.patch => 
0005-change-http-port-to-8081.patch} (54%)
 rename tomcat/patches/perf/{0005-bump-up-number-of-threads.patch => 
0006-increase-number-of-threads.patch} (56%)
 rename tomcat/patches/perf/{0007-Use-bio-connector-explicitly.patch => 
0007-force-HTTP-NIO-connector.patch} (53%)
 rename tomcat/patches/perf/{0008-Do-not-enable-AJP-connector.patch => 
0008-disable-AJP-connector.patch} (59%)

-- 
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


general protection fault on Tomcat9 with HTTP NIO2

2018-09-04 Thread Geraldo Netto
9.798 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web
application directory [/usr/tomcat/webapps/manager] has finished in [364] ms
04-Sep-2018 18:47:59.800 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory [/usr/tomcat/webapps/ROOT]
04-Sep-2018 18:47:59.818 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web
application directory [/usr/tomcat/webapps/ROOT] has finished in [18] ms
04-Sep-2018 18:47:59.820 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory [/usr/tomcat/webapps/host-manager]
04-Sep-2018 18:47:59.847 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web
application directory [/usr/tomcat/webapps/host-manager] has finished in
[27] ms
04-Sep-2018 18:47:59.850 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory [/usr/tomcat/webapps/docs]
04-Sep-2018 18:47:59.867 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web
application directory [/usr/tomcat/webapps/docs] has finished in [17] ms
04-Sep-2018 18:47:59.873 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory [/usr/tomcat/webapps/examples]
04-Sep-2018 18:48:00.208 INFO [Thread-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web
application directory [/usr/tomcat/webapps/examples] has finished in [334]
ms
04-Sep-2018 18:48:00.212 INFO [Thread-1]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
["http-nio2-8081"]
04-Sep-2018 18:48:00.216 INFO [Thread-1]
org.apache.catalina.startup.Catalina.start Server startup in 877 ms
04-Sep-2018 19:01:44.519 INFO [Thread-6]
org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler
["http-nio2-8081"]
04-Sep-2018 19:01:44.626 INFO [Thread-6]
org.apache.catalina.core.StandardService.stopInternal Stopping service
[Catalina]
04-Sep-2018 19:01:44.766 INFO [Thread-6]
org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler
["http-nio2-8081"]
pthread_kill() stubbed
04-Sep-2018 19:01:45.769 INFO [Thread-6]
org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler
["http-nio2-8081"]
[registers]
RIP: 0x003e1200 
RFL: 0x00010282  CS:  0x0008  SS:  0x0010
RAX: 0x8840d010  RBX: 0x0001  RCX: 0x
 RDX: 0x80001996e781
RSI: 0xe88000199b4f  RDI: 0x80001996e010  RBP: 0x815d5f80
 R8:  0x00c2e5c8
R9:  0x80f48140  R10: 0x814d2170  R11: 0x0001
 R12: 0x
R13: 0x80f48140  R14: 0x814d2170  R15: 0x0001
 RSP: 0x815d5f50
general protection fault

[backtrace]
0x003988ca 
0x00395dc2 
0x003e12a8 
0x00417af7 
0x00417c68 
0x003f4e96 
0x00396d82 

Some times the error is the following:
...
04-Sep-2018 19:07:47.557 INFO [Thread-6]
org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler
["http-nio2-8081"]
page fault outside application, addr: 0x
[registers]
RIP: 0x003d2e17 
RFL: 0x00010202  CS:  0x0008  SS:  0x0010
RAX: 0x0001  RBX: 0xf8e0  RCX: 0x00246c00
RDX: 0xa9305e80
RSI: 0x8000  RDI: 0x  RBP: 0x200022aff680
R8:  0xf8e0
R9:  0x00c2e5f8  R10: 0x204195e2  R11: 0x12542b80
R12: 0x
R13: 0x00c2e5f8  R14: 0x204195e2  R15: 0x12542b80
RSP: 0x200022aff640
Aborted

[backtrace]
0x003344c5 
0x00336be9 
0x00396fae 
0x00395e06 
0x00246c19 
0x00415528 
0x0043851b 
0x004386a5 
0x00432687 
0x13807936 
0x2041960d 
0x2040801c 
0x2040801c 
0x2040801c 
0x20408061 
0x2040050a 
0x1225ebba 
0x1225ffd6 
0x12260496 
0x122ada70 
0x125f24f0 
0x125f26d7 
0x124af501 
0x0045aca5 
0x003f4e96 
0x00396d82 
0x01910065004100ff 
0x0000003f488f 
0x4156415741e58947 



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] improve url parsing for openjdk8-zulu-full

2018-09-04 Thread geraldo netto
for some reason the parsing of openjdk8 (zulu full) was broken
so, based on [1] we first extract all  elements and then we extract the 
latest version available

[1] 
https://stackoverflow.com/questions/1881237/easiest-way-to-extract-the-urls-from-an-html-page-using-sed-or-awk-only

Signed-off-by: geraldo netto 
---
 openjdk8-zulu-full/latest.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openjdk8-zulu-full/latest.sh b/openjdk8-zulu-full/latest.sh
index 66d42fe..f8d9d5a 100755
--- a/openjdk8-zulu-full/latest.sh
+++ b/openjdk8-zulu-full/latest.sh
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-wget -c -qO- http://www.azul.com/downloads/zulu/zulu-linux | grep 
"jdk8.*linux.*64.tar.gz\"" | grep -o "http:.*tar.gz" | head -1
+wget -c -qO- http://www.azul.com/downloads/zulu/zulu-linux | grep -o 'https://groups.google.com/d/optout.


Re: Some woes with Fedora 28 distribution of Python 3

2018-08-27 Thread Geraldo Netto
Dear Friends,

I think we could use pip to check if  we have any python package that
binds/uses systemd
I don't have a fedora vm anymore but on linux mint, I have installed "pip"
(I guess yum/dnf has the same package name)

Then, we can list all packages:
netto@morpheus:~$ pip list --format=columns
Package Version
--- -
...
six 1.11.0
...

Finally:
netto@morpheus:~$ sudo pip show -f six
Name: six
Version: 1.11.0
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: benja...@python.org
License: MIT
Location: /home/netto/.local/lib/python2.7/site-packages
Requires:
Files:
  six-1.11.0.dist-info/DESCRIPTION.rst
  six-1.11.0.dist-info/INSTALLER
  six-1.11.0.dist-info/METADATA
  six-1.11.0.dist-info/RECORD
  six-1.11.0.dist-info/WHEEL
  six-1.11.0.dist-info/metadata.json
  six-1.11.0.dist-info/top_level.txt
  six.py
  six.pyc

I took six as an example because as Waldek said, ubuntu based distros don't
have any systemd binding/dependency installed
(I could confirm it on linux mint too)


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/


On Mon, 27 Aug 2018 at 06:01, Nadav Har'El  wrote:

> The missing functions seem to be from libsystemd, I guess we need to add
> that too. The question is how to automatically figure out it's needed.
> Maybe we need to "ldd" more stuff to collect more needed libraries...
>
> I don't know if there's something we can do to *not* need these libraries.
> After all,  OSv does *not* really have systemd. I wonder if we just delete
> (blacklist) /lib/python3.6/site-packages/systemd/ or something, may python
> will not look for it in the first place.
>
>
>
> --
> Nadav Har'El
> n...@scylladb.com
>
> On Fri, Aug 17, 2018 at 7:01 AM, Waldek Kozaczuk 
> wrote:
>
>> Even all 3 examples from Python 3 readme work fine with Fedora 28
>> distribution of Python 3 with my latest ELF patch, there is some weird
>> behavior which I do not see with Ubuntu distribution.
>>
>> For example if I try to execute some erroneous python code Python breaks
>> like so:
>>
>> ./scripts/run.py --api -e "/python3 -c \"prin('Hello')\""
>> OSv v0.51.0-25-g807f0385
>> eth0: 192.168.122.15
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol
>> sched_getscheduler to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol flistxattr to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol unlinkat to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol __wcscat_chk
>> to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol fsetxattr to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol llistxattr to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol fremovexattr
>> to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol lgetxattr to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol listxattr to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol
>> sched_getparam to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol
>> sched_setscheduler to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol sigtimedwait
>> to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol readlinkat to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol fexecve to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol mkdirat to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol __wcsncpy_chk
>> to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol lsetxattr to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol clock_settime
>> to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol fgetxattr to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol
>> sched_rr_get_interval to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol __xmknodat to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol linkat to
>> bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol removexattr
>> to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol getgrouplist
>> to bind now
>> WARN:/usr/lib/libpython3.6m.so.1.0: - failed to find symbol sigpending to
>> bind now

Re: __wcscpy_chk and Python 3

2018-08-13 Thread Geraldo Netto
Hello Waldek/Friends! :)

On Mon, 13 Aug 2018 at 18:34, Waldek Kozaczuk  wrote:

> I managed to get Python 3.5 working on OSv (I only tested simple 'Hello
> world!' and httpserver example). However to get it working I had to add
> missing __wcscpy_chk to libc.
>
> According to
> http://refspecs.linux-foundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc---wcscpy-chk-1.html
> it should check for buffer overflow condition and I am not sure this
> implementation would suffice:
>
> libc/string/__wcscpy_chk.c:
>
> #include 
> #include 
>
> extern wchar_t *wcscpy(wchar_t *__restrict d, const wchar_t *__restrict s);
> extern size_t wcslen(const wchar_t *s);
>
> wchar_t *__wcscpy_chk(wchar_t *__restrict dest, const wchar_t *__restrict
> src, size_t destlen)
> {
> assert(wcslen(src) + sizeof(L'\0') <= destlen);
> return wcscpy(dest, src);
> }
>
> What do you think?
>

If you allow me to suggest, just add a TODO/XXX mark and push it upstream
I'd rather prefer an ugly working car than a super cool futuristic car that
is on paper :)
In any case, time will tell us if it's enough or not
Ghost readers are welcome'd to contribute too!!! :P


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cassandra Admin@Sunnyvale, CA

2018-05-25 Thread Geraldo Netto
Hey Guys,

If you allow me to suggest, I think we should ban santosh emails...
kuntal.santosh-at-nityo.com
santosh1990nityo-at-gmail.com
santosh01nityo-at-gmail.com


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 25 May 2018 at 13:59, Santosh <kuntal.sant...@nityo.com> wrote:

> Hi,
>
> Hope you are doing Great!!
>
> I have an urgent position with my client at Location* “Sunnyvale, CA”*. This
> is an urgent fill and the client is looking for *“Cassandra Admin“. *I
> appreciate your quick response.
>
>
>
> *Role:** Cassandra Admin *
>
> *Location: Sunnyvale, CA*
>
> *Work Duration:** Long Term*
>
> *Job Description:*
> 1. Cassandra Admin
> 2. Shell Scripting
> 3. Oracle
>
> Detailed Job Description:
> Should have strong skills in database administration including NoSQL DBs.
> Should have Cassandra Admin skills. Strong skills in scripting languages
> like Unix scripting, Perl, Python is a must have. Should have prior
> experience in supporting and managing large database clusters. Should have
> played DevOps role or implemented automations for large DB migrations.
>
>
> If I'm not available over the phone, best way to reach me in email...
>
>
>
>
>
> [image: Description: Description: cid:image001.jpg@01D0BE16.B9DD7240]
>
>
>
> Nityo Infotech Corp.
> 666 Plainsboro Road,
> <https://maps.google.com/?q=666+Plainsboro+Road,+Suite+1285+Plainsboro,+NJ+08536=gmail=g>
>
>
> Suite 1285
> <https://maps.google.com/?q=666+Plainsboro+Road,+Suite+1285+Plainsboro,+NJ+08536=gmail=g>
>
> Plainsboro, NJ 08536
> <https://maps.google.com/?q=666+Plainsboro+Road,+Suite+1285+Plainsboro,+NJ+08536=gmail=g>
>
> *Santosh Kumar *
>
> *Technical Recruiter*
>
> Desk No-609-853-0818 Ext-2170
> Fax :   609 799 5746
>
> kuntal.sant...@nityo.com
> www.nityo.com
>
>
> --
>
> USA | Canada | India | Singapore | Malaysia | Indonesia | Philippines |
> Thailand  | UK | Australia / Zealand
> --
>
> Nityo Infotech has been rated as One of the top 500 Fastest growing
> companies by INC 500
> --
>
> *Disclaimer:* http://www.nityo.com/Email_Disclaimer.html
> --
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: osv-apps: HEAD detached at 7d9b71e

2018-05-10 Thread Geraldo Netto
Hello Nadav/Friends,


> This is how "git submodules" work. Basically the main osv.git can decide
> which
> specific version of the separate apps.git "submodule" works with it.
>
> It's not super-convenient, but it works.
>
> But it means every time we add interesting commits in apps.git, we also
> need
> to update osv.git, by doing:
>
>  git add apps
>  git commit
>
> As a non-committer, you usually don't need to do anything like that, the
> committers will do it for you.
> You can also do "cd apps; git checkout master" like you did, if you want.
> Or if you do in the osv/ directory "git submodule update" it will check
> out the one listed in the osv.git repository.
>

That's OK :)


> Also, I think we should apply problame patch on .gitmodules:
>> https://github.com/problame/ba-osv/commit/b679864fea150fb776
>> 117fc850b75b7c4ce61f4d
>>
>
> I don't  remember why we had it relative like that, and if relative why
> two .. and not just one?
> What is the *benefit* of not making it relative? Where does this patch
> come from, and why do you want it?
>
> I think the benefit of relative is that if someone connects to github in a
> different way, not https, he'll also get the submodules via the same way.
> But I'm not sure here.
>
> @@ -1,52 +1,52 @@
>>  [submodule "external/x64/openjdk.bin"]
>>   path = external/x64/openjdk.bin
>> - url = ../../cloudius-systems/openjdk.bin
>> + url = https://github.com/cloudius-systems/openjdk.bin
>>   ignore = dirty
>> ...
>>
>
>
While I agree that using HTTPS might impose some limitation,
I don't think it's a big deal, I rarely saw someone using something
different from HTTPS
(Of course, I might be mistaken)
But putting full path makes easier to see where the repositories come from



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


osv-apps: HEAD detached at 7d9b71e

2018-05-09 Thread Geraldo Netto
Dear Friends,

Just a quick thing, I was syncing my local OSv repos
and I noticed something with osv-apps:

netto@besta01 ~/Desktop/osv/osv-clean $ git pull
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 7 (delta 6), reused 7 (delta 6), pack-reused 0
Unpacking objects: 100% (7/7), done.
>From https://github.com/cloudius-systems/osv
   54e6c42..cc6e8f5  master -> origin/master
Updating 54e6c42..cc6e8f5
Fast-forward
 core/elf.cc| 4 +++-
 include/osv/elf.hh | 9 +
 2 files changed, 12 insertions(+), 1 deletion(-)
netto@besta01 ~/Desktop/osv/osv-clean $ cd apps/
netto@besta01 ~/Desktop/osv/osv-clean/apps $ git pull
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull  

netto@besta01 ~/Desktop/osv/osv-clean/apps $ git branch
* (HEAD detached at 7d9b71e)
  master
netto@besta01 ~/Desktop/osv/osv-clean/apps $ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
netto@besta01 ~/Desktop/osv/osv-clean/apps $ git pull
Already up-to-date.

while it's not a big thing,
it might be interesting to set osv-apps branch to master

Also, I think we should apply problame patch on .gitmodules:
https://github.com/problame/ba-osv/commit/b679864fea150fb776117fc850b75b7c4ce61f4d

@@ -1,52 +1,52 @@
 [submodule "external/x64/openjdk.bin"]
  path = external/x64/openjdk.bin
- url = ../../cloudius-systems/openjdk.bin
+ url = https://github.com/cloudius-systems/openjdk.bin
  ignore = dirty
 [submodule "external/x64/gcc.bin"]
  path = external/x64/gcc.bin
- url = ../../cloudius-systems/gcc.bin
+ url = https://github.com/cloudius-systems/gcc.bin
  ignore = dirty
 [submodule "external/x64/glibc.bin"]
  path = external/x64/glibc.bin
- url = ../../cloudius-systems/glibc.bin
+ url = https://github.com/cloudius-systems/glibc.bin
  ignore = dirty
 [submodule "external/x64/glibc-testsuite"]
  path = external/x64/glibc-testsuite
- url = ../../cloudius-systems/glibc-testsuite
+ url = https://github.com/cloudius-systems/glibc-testsuite
  ignore = dirty
 [submodule "external/x64/acpica"]
  path = external/x64/acpica
- url = ../../cloudius-systems/acpica
+ url = https://github.com/cloudius-systems/acpica
  ignore = dirty
 [submodule "external/x64/misc.bin"]
  path = external/x64/misc.bin
- url = ../../cloudius-systems/misc.bin.git
+ url = https://github.com/cloudius-systems/misc.bin.git
  ignore = dirty
 [submodule "apps"]
  path = apps
- url = ../../cloudius-systems/osv-apps
+ url = https://github.com/cloudius-systems/osv-apps
  ignore = dirty
 [submodule "external/aarch64/gcc.bin"]
  path = external/aarch64/gcc.bin
- url = ../../cloudius-systems/aarch64-gcc.bin.git
+ url = https://github.com/cloudius-systems/aarch64-gcc.bin.git
 [submodule "external/aarch64/misc.bin"]
  path = external/aarch64/misc.bin
- url = ../../cloudius-systems/aarch64-misc.bin.git
+ url = https://github.com/cloudius-systems/aarch64-misc.bin.git
 [submodule "external/aarch64/openjdk.bin"]
  path = external/aarch64/openjdk.bin
- url = ../../cloudius-systems/aarch64-openjdk.bin.git
+ url = https://github.com/cloudius-systems/aarch64-openjdk.bin.git
 [submodule "modules/httpserver/swagger-ui"]
  path = modules/httpserver-html5-gui/swagger-ui
- url = ../../cloudius-systems/swagger-ui.git
+ url = https://github.com/cloudius-systems/swagger-ui.git
 [submodule "musl"]
  path = musl
- url = ../../cloudius-systems/musl.git
+ url = https://github.com/cloudius-systems/musl.git
 [submodule "modules/httpserver/osv-gui"]
  path = modules/httpserver-html5-gui/osv-gui
- url = ../../cloudius-systems/osv-gui.git
+ url = https://github.com/cloudius-systems/osv-gui.git
 [submodule "external/fs/libnfs"]
  path = external/fs/libnfs
  url = https://github.com/sahlberg/libnfs.git




Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Library unikernel or modularization of OSv kernel

2018-05-06 Thread Geraldo Netto
Hey Guys,

Considering Dor/Nadav input, maybe we could approach it differently
What if we could do a static analysis of application code to determine
which syscalls/posix apis the application uses
and then we only add the syscalls/posix interfaces that are really required?
IMHO, Musl is flexible enough for this


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 6 May 2018 at 05:38, Nadav Har'El <n...@scylladb.com> wrote:

>
> On Sun, May 6, 2018 at 7:52 AM, Dor Laor <d...@scylladb.com> wrote:
>
>> On Sat, May 5, 2018 at 9:48 AM, Waldek Kozaczuk <jwkozac...@gmail.com>
>> wrote:
>>
>>> What if there was a way early into the booting process to load specific
>>> features of OSv, that right now are linked in as part of kernel, as
>>> libraries? For example if we mounted ROFS as early and possible we could
>>> load other elements of the logic (configuration, ZFS, boost program options
>>> library, dhcp, etc) on demand and only as needed. Same way even some
>>> drivers could be loaded on demand later.
>>>
>>> Why would it be beneficial?
>>>
>>
>> You can gain it all by preparing the right image ahead of time, so you'll
>> only have the features/setup you wish before boot.
>>
>
> Right. I remember that Linux started this way (you choose the parts of the
> kernel you want in compile time), and then around 1995, they added loadable
> kernel modules.
>
> The best feature of kernel modules was that it allows you not to compile
> your own kernel, and rather take from some distribution a large collection
> of pre-compiled modules, and then use only the one you need.
> This may be useful for projects like Capstan where you want to use
> pre-compiled code, but may still want a smaller kernel.
>
> The biggest question I have, is what sort of applications will truely see
> a big gain from the smaller kernel. After all, OSv is relatively small, and
> doesn't have thousands of rarely used drivers and features like Linux has,
> so there's not *too* much to shave off this way. There is, but not dramatic
> like it is in Linux.
>
>
>>
>> What's good about your approach is that you can boot a generic image
>> ahead of time and only customize it once
>> you actually need to use it (when the first packet arrives) and thus save
>> the boot time
>>
>
>>
>>>
>>>- OSv kernel would be smaller and load even faster
>>>- OSv kernel can be modularized and therefore better tailored for
>>>specific hypervisor or application needs
>>>
>>> What do you think?
>>>
>>> Waldek
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "OSv Development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to osv-dev+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Library unikernel or modularization of OSv kernel

2018-05-05 Thread Geraldo Netto
Hello Waldek/Friends!

That would be great Waldek!

Maybe some of those references might sound interesting/inspiring :)
http://www.lisha.ufsc.br/pub/Frohlich_2001.pdf
http://www.cse.unsw.edu.au/~ikuz/publications/jss.07.pdf
https://docs.sel4.systems/CAmkES/
http://univis.uni-erlangen.de/prg?search=projects=ciao;
director=preikschat=en=long

Probably you're already aware, but there are some really interesting papers
from TU Dresden/KIT/DATA61 CSIRO
But they are mainly focused on L4 family:
http://l4hq.org/
https://www.inf.tu-dresden.de/
http://os.itec.kit.edu (if I'm not mistaken, our friend "problame" from
issue  #952 studies here :P)



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 5 May 2018 at 13:48, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:

> What if there was a way early into the booting process to load specific
> features of OSv, that right now are linked in as part of kernel, as
> libraries? For example if we mounted ROFS as early and possible we could
> load other elements of the logic (configuration, ZFS, boost program options
> library, dhcp, etc) on demand and only as needed. Same way even some
> drivers could be loaded on demand later.
>
> Why would it be beneficial?
>
>- OSv kernel would be smaller and load even faster
>- OSv kernel can be modularized and therefore better tailored for
>specific hypervisor or application needs
>
> What do you think?
>
> Waldek
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] add output to crypt/encrypt tests

2018-04-30 Thread Geraldo Netto
Hello Waldek/Friends,

Thanks for your feedback! :)
First of all, great work with the nb-write test!!! :)

Indeed, I have confirmed the warnings, it was my mistake
I did the unit test in a hurry and forgot to pass -Wall -Werror (oops!)

I already sent a v2 patch, would you mind to check?


Thank You Very Much/Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 30 April 2018 at 08:31, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:

> I applied this patch and I still see the compilation warnings:
>
> "[INFO] 
> 
>   CC tests/tst-crypt.c
> /home/wkozaczuk/projects/osv/tests/tst-crypt.c: In function ‘concat_str’:
> /home/wkozaczuk/projects/osv/tests/tst-crypt.c:19:34: warning: argument
> to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you
> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
>   strncat(tmp, first_block, sizeof(first_block));
>   ^
> /home/wkozaczuk/projects/osv/tests/tst-crypt.c:20:35: warning: argument
> to ‘sizeof’ in ‘strncat’ call is the same expression as the source; did you
> mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
>   strncat(tmp, second_block, sizeof(second_block));
>^
> /home/wkozaczuk/projects/osv/tests/tst-crypt.c: In function ‘main’:
> /home/wkozaczuk/projects/osv/tests/tst-crypt.c:57:3: warning: implicit
> declaration of function ‘setkey’ [-Wimplicit-function-declaration]
>setkey(key);
>^
> /home/wkozaczuk/projects/osv/tests/tst-crypt.c:60:2: warning: implicit
> declaration of function ‘encrypt’ [-Wimplicit-function-declaration]
>   encrypt(buf, 0);
>   ^
> cc1: warning: iteration 6u invokes undefined behavior [-Waggressive-loop-
> optimizations]
> /home/wkozaczuk/projects/osv/tests/tst-crypt.c:52:2: note: containing loop
>   for (i = 0; i < 8; i++) {
>   ^
>   LD tests/tst-crypt.so
> "
>
> Could you please address those and send v2 version of the patch?
>
> Waldek
>
> On Tuesday, April 24, 2018 at 11:25:13 AM UTC-4, Geraldo Netto wrote:
>>
>> Hello Waldek,
>>
>> The patch basically adds some printf() to show pass/fail for each test
>>
>> I didn't address any other possible issue
>> Would you mind to forward to me the warning so I can check it?
>>
>> You can compile the test by yourself with GCC passing -lcrypt
>>
>> Eg: gcc osv-dir/tests/tst-crypt.c -lcrypt -o crypt
>>
>>
>> Kind Regards,
>> Geraldo Netto
>>
>> Em ter, 24 de abr de 2018 11:44, Waldek Kozaczuk <jwkoz...@gmail.com>
>> escreveu:
>>
>>> I saw the original test had some compilation warnings. Does this patch
>>> address those?
>>>
>>> On Tuesday, April 24, 2018 at 9:07:05 AM UTC-4, Geraldo Netto wrote:
>>>>
>>>> Signed-off-by: geraldo netto <gerald...@gmail.com>
>>>> ---
>>>>  tests/tst-crypt.c | 22 +-
>>>>  1 file changed, 17 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
>>>> index ffc5293..0dc3de2 100644
>>>> --- a/tests/tst-crypt.c
>>>> +++ b/tests/tst-crypt.c
>>>> @@ -2,6 +2,16 @@
>>>>  #include 
>>>>  #include 
>>>>  #include 
>>>> +#include 
>>>> +
>>>> +int tests = 0, fails = 0;
>>>> +
>>>> +void report(const char* name, bool passed) {
>>>> +static const char* status[] = {"FAIL", "PASS"};
>>>> +printf("%s: %s\n", status[passed], name);
>>>> +tests += 1;
>>>> +fails += !passed;
>>>> +}
>>>>
>>>>  char* concat_str(char* first_block, char* second_block) {
>>>>  static char tmp[10];
>>>> @@ -21,16 +31,16 @@ int main(void) {
>>>>  char result4[] = "$6$Ab(d3$TB6UIPV7sprvpcQh2esP
>>>> r2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1";
>>>>
>>>>  // 20338EPKt5xtY
>>>> -if (strcmp(result1, crypt(password, salt)) != 0) return -1;
>>>> +report("crypt (des)", strcmp(result1, crypt(password, salt))
>>>> == 0);
>>>>
>>>>  // $1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.
>>>> -if (strcmp(result2, crypt(password, concat_str((char*) "$1$",
>>>> password))) != 0) return -2;
>>>> +report("crypt (md5)&

Re: need: port openvpn into osv

2018-04-27 Thread Geraldo Netto
Hello Maxul,

Waldek/Nadav might provide a more accurate information
but I don't think we have tap on OSv
which means we would need to port ourselves the implementation
I guess the easiest path is to borrow code from FreeBSD or any other
project with a permissive license (we cannot link GPL code on OSv)
and we probably need a Linux like API

Maybe those quick references can help you:
https://github.com/LaKabane/libtuntap
https://www.kernel.org/doc/Documentation/networking/tuntap.txt


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 27 April 2018 at 12:40, <lmy2010...@gmail.com> wrote:

> Hi all,
>
> I enjoy the performance benefit of OSv, especially the No SpinLock and Van
> Jacobson implementation. I wish to establish the OSv image into the real
> cloud. My target app is OpenVPN. I try porting it into the OSv. OpenVPN
> deals with a tap device provided by Linux. Does anyone have any idea how to
> solve this?
>
> Best,
> Maxul
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] add output to crypt/encrypt tests

2018-04-24 Thread Geraldo Netto
Hello Waldek,

The patch basically adds some printf() to show pass/fail for each test

I didn't address any other possible issue
Would you mind to forward to me the warning so I can check it?

You can compile the test by yourself with GCC passing -lcrypt

Eg: gcc osv-dir/tests/tst-crypt.c -lcrypt -o crypt


Kind Regards,
Geraldo Netto

Em ter, 24 de abr de 2018 11:44, Waldek Kozaczuk <jwkozac...@gmail.com>
escreveu:

> I saw the original test had some compilation warnings. Does this patch
> address those?
>
> On Tuesday, April 24, 2018 at 9:07:05 AM UTC-4, Geraldo Netto wrote:
>>
>> Signed-off-by: geraldo netto <gerald...@gmail.com>
>> ---
>>  tests/tst-crypt.c | 22 +-
>>  1 file changed, 17 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
>> index ffc5293..0dc3de2 100644
>> --- a/tests/tst-crypt.c
>> +++ b/tests/tst-crypt.c
>> @@ -2,6 +2,16 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>> +
>> +int tests = 0, fails = 0;
>> +
>> +void report(const char* name, bool passed) {
>> +static const char* status[] = {"FAIL", "PASS"};
>> +printf("%s: %s\n", status[passed], name);
>> +tests += 1;
>> +fails += !passed;
>> +}
>>
>>  char* concat_str(char* first_block, char* second_block) {
>>  static char tmp[10];
>> @@ -21,16 +31,16 @@ int main(void) {
>>  char result4[] =
>> "$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1";
>>
>>
>>  // 20338EPKt5xtY
>> -if (strcmp(result1, crypt(password, salt)) != 0) return -1;
>> +report("crypt (des)", strcmp(result1, crypt(password, salt)) ==
>> 0);
>>
>>  // $1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.
>> -if (strcmp(result2, crypt(password, concat_str((char*) "$1$",
>> password))) != 0) return -2;
>> +report("crypt (md5)", strcmp(result2, crypt(password,
>> concat_str((char*) "$1$", password))) == 0);
>>
>>  // $5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0
>> -if (strcmp(result3, crypt(password, concat_str((char*) "$5$",
>> password))) != 0) return -3;
>> +report("crypt (sha-256)", strcmp(result3, crypt(password,
>> concat_str((char*) "$5$", password))) == 0);
>>
>>  //
>> $6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1
>>
>> -if (strcmp(result4, crypt(password, concat_str((char*) "$6$",
>> password))) !=0) return -4;
>> +report("crypt (sha-512)", strcmp(result4, crypt(password,
>> concat_str((char*) "$6$", password))) ==0);
>>
>>  // encrypt
>>  // http://man7.org/linux/man-pages/man3/encrypt.3.html
>> @@ -67,5 +77,7 @@ int main(void) {
>>  txt[8] = '\0';
>>  }
>>
>> -return (strcmp(password, txt) == 0) ? 0 : -6;
>> +report("encrypt", strcmp(password, txt) == 0);
>> +printf("SUMMARY: %u tests / %u failures\n", tests, fails);
>> +return fails;
>>  }
>> \ No newline at end of file
>> --
>> 2.7.4
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] add output to crypt/encrypt tests

2018-04-24 Thread geraldo netto
Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 tests/tst-crypt.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
index ffc5293..0dc3de2 100644
--- a/tests/tst-crypt.c
+++ b/tests/tst-crypt.c
@@ -2,6 +2,16 @@
 #include 
 #include 
 #include 
+#include 
+
+int tests = 0, fails = 0;
+
+void report(const char* name, bool passed) {
+   static const char* status[] = {"FAIL", "PASS"};
+   printf("%s: %s\n", status[passed], name);
+   tests += 1;
+   fails += !passed;
+}
 
 char* concat_str(char* first_block, char* second_block) {
static char tmp[10];
@@ -21,16 +31,16 @@ int main(void) {
char result4[] = 
"$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1";
 
// 20338EPKt5xtY
-   if (strcmp(result1, crypt(password, salt)) != 0) return -1;
+   report("crypt (des)", strcmp(result1, crypt(password, salt)) == 0);
 
// $1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.
-   if (strcmp(result2, crypt(password, concat_str((char*) "$1$", 
password))) != 0) return -2;
+   report("crypt (md5)", strcmp(result2, crypt(password, 
concat_str((char*) "$1$", password))) == 0);
 
// $5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0
-   if (strcmp(result3, crypt(password, concat_str((char*) "$5$", 
password))) != 0) return -3;
+   report("crypt (sha-256)", strcmp(result3, crypt(password, 
concat_str((char*) "$5$", password))) == 0);
 
// 
$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1
-   if (strcmp(result4, crypt(password, concat_str((char*) "$6$", 
password))) !=0) return -4;
+   report("crypt (sha-512)", strcmp(result4, crypt(password, 
concat_str((char*) "$6$", password))) ==0);
 
// encrypt
// http://man7.org/linux/man-pages/man3/encrypt.3.html
@@ -67,5 +77,7 @@ int main(void) {
txt[8] = '\0';
}
 
-   return (strcmp(password, txt) == 0) ? 0 : -6;
+   report("encrypt", strcmp(password, txt) == 0);
+   printf("SUMMARY: %u tests / %u failures\n", tests, fails);
+   return fails;
 }
\ No newline at end of file
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v3 0/2] add libcrypt.so.1 (fix #945)

2018-04-06 Thread geraldo netto
geraldo netto (2):
  add encrypt (3) functions (fix #945)
  add crypt (3) tests

 Makefile   |1 +
 core/elf.cc|1 +
 libc/crypt/encrypt.c   | 1028 
 modules/tests/Makefile |2 +-
 tests/tst-crypt.c  |   71 
 5 files changed, 1102 insertions(+), 1 deletion(-)
 create mode 100644 libc/crypt/encrypt.c
 create mode 100644 tests/tst-crypt.c

-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v3 2/2] add crypt (3) tests

2018-04-06 Thread geraldo netto
this unit test covers the following algorithms on crypt.c [1] [2]:
1 - MD5
5 - SHA256 (glibc >= 2.7, musl >= 0.9.8)
6 - SHA512 (glibc >= 2.7, musl >= 0.9.8)

the following algorithms are not tested [1] [2]:
2  - blowfish on musl >= 0.9.8
2a - blowfish on glibc but not in mainline glibc distribution

encrypt.c is also covered [3]

[1] http://man7.org/linux/man-pages/man3/crypt.3.html
[2] https://www.musl-libc.org/releases/musl-0.9.8.tar.gz 
(musl-0.9.8/src/crypt/crypt_r.c)
[3] http://man7.org/linux/man-pages/man3/encrypt.3.html

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 modules/tests/Makefile |  2 +-
 tests/tst-crypt.c  | 71 ++
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 tests/tst-crypt.c

diff --git a/modules/tests/Makefile b/modules/tests/Makefile
index b8348dd..3398e4a 100644
--- a/modules/tests/Makefile
+++ b/modules/tests/Makefile
@@ -87,7 +87,7 @@ tests := tst-pthread.so misc-ramdisk.so tst-vblk.so 
tst-bsd-evh.so \
tst-ifaddrs.so tst-pthread-affinity-inherit.so tst-sem-timed-wait.so \
tst-ttyname.so tst-pthread-barrier.so tst-feexcept.so tst-math.so \
tst-sigaltstack.so tst-fread.so tst-tcp-cork.so tst-tcp-v6.so \
-   tst-calloc.so
+   tst-calloc.so tst-crypt.so
 
 #  libstatic-thread-variable.so tst-static-thread-variable.so \
 
diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
new file mode 100644
index 000..ffc5293
--- /dev/null
+++ b/tests/tst-crypt.c
@@ -0,0 +1,71 @@
+#define _XOPEN_SOURCE
+#include 
+#include 
+#include 
+
+char* concat_str(char* first_block, char* second_block) {
+   static char tmp[10];
+   memset(tmp, 0, sizeof(tmp));
+   strncat(tmp, first_block, sizeof(first_block));
+   strncat(tmp, second_block, sizeof(second_block));
+   return tmp;
+}
+
+int main(void) {
+   // http://man7.org/linux/man-pages/man3/crypt.3.html
+   char password[] = "Ab(d3";
+   char salt[] = "201802221723";
+   char result1[] = "20338EPKt5xtY";
+   char result2[] = "$1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.";
+   char result3[] = "$5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0";
+   char result4[] = 
"$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1";
+
+   // 20338EPKt5xtY
+   if (strcmp(result1, crypt(password, salt)) != 0) return -1;
+
+   // $1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.
+   if (strcmp(result2, crypt(password, concat_str((char*) "$1$", 
password))) != 0) return -2;
+
+   // $5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0
+   if (strcmp(result3, crypt(password, concat_str((char*) "$5$", 
password))) != 0) return -3;
+
+   // 
$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1
+   if (strcmp(result4, crypt(password, concat_str((char*) "$6$", 
password))) !=0) return -4;
+
+   // encrypt
+   // http://man7.org/linux/man-pages/man3/encrypt.3.html
+   char key[64];
+   char buf[64];
+   char txt[9];
+   int i, j;
+
+   for (i = 0; i < 8; i++) {
+   for (j = 0; j < 8; j++) {
+   buf[i * 8 + j] = password[i] >> j & 1;
+   }
+
+   setkey(key);
+   }
+
+   encrypt(buf, 0);
+   for (i = 0; i < 8; i++) {
+   for (j = 0, txt[i] = '\0'; j < 8; j++) {
+   txt[i] |= buf[i * 8 + j] << j;
+   }
+
+   txt[8] = '\0';
+   }
+
+   if (strcmp(password, txt) == 0) return -5;
+
+   encrypt(buf, 1);
+   for (i = 0; i < 8; i++) {
+   for (j = 0, txt[i] = '\0'; j < 8; j++) {
+   txt[i] |= buf[i * 8 + j] << j;
+   }
+
+   txt[8] = '\0';
+   }
+
+   return (strcmp(password, txt) == 0) ? 0 : -6;
+}
\ No newline at end of file
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v3 1/2] add encrypt (3) functions (fix #945)

2018-04-06 Thread geraldo netto
the implementation is based on musl libc version 1.1.19:
https://git.musl-libc.org/cgit/musl/plain/src/crypt/encrypt.c
https://git.musl-libc.org/cgit/musl/plain/src/crypt/crypt_des.c

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 Makefile |1 +
 core/elf.cc  |1 +
 libc/crypt/encrypt.c | 1028 ++
 3 files changed, 1030 insertions(+)
 create mode 100644 libc/crypt/encrypt.c

diff --git a/Makefile b/Makefile
index 76db455..681d0ee 100644
--- a/Makefile
+++ b/Makefile
@@ -1740,6 +1740,7 @@ musl += crypt/crypt_md5.o
 musl += crypt/crypt_r.o
 musl += crypt/crypt_sha256.o
 musl += crypt/crypt_sha512.o
+libc += crypt/encrypt.o
 
 #include $(src)/fs/build.mk:
 
diff --git a/core/elf.cc b/core/elf.cc
index 2a46633..9138736 100644
--- a/core/elf.cc
+++ b/core/elf.cc
@@ -1064,6 +1064,7 @@ program::program(void* addr)
   "libstdc++.so.6",
   "libaio.so.1",
   "libxenstore.so.3.0",
+  "libcrypt.so.1",
 };
 auto ml = new modules_list();
 ml->objects.push_back(_core.get());
diff --git a/libc/crypt/encrypt.c b/libc/crypt/encrypt.c
new file mode 100644
index 000..2742492
--- /dev/null
+++ b/libc/crypt/encrypt.c
@@ -0,0 +1,1028 @@
+/*
+
+merge of musl 1.1.19 crypt_des.c and encrypt.c
+
+https://git.musl-libc.org/cgit/musl/plain/src/crypt/crypt_des.c
+https://git.musl-libc.org/cgit/musl/plain/src/crypt/encrypt.c
+
+*/
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct expanded_key {
+   uint32_t l[16], r[16];
+};
+
+
+void __des_enc_setkey(const unsigned char *key, struct expanded_key *ekey);
+void __enc_do_des(uint32_t l_in, uint32_t r_in,
+uint32_t *l_out, uint32_t *r_out,
+uint32_t count, uint32_t saltbits, const struct expanded_key *ekey);
+
+#define _PASSWORD_EFMT1 '_'
+
+static const unsigned char key_shifts[16] = {
+   1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
+};
+
+static const uint32_t psbox[8][64] = {
+   {
+   0x00808200,0x,0x8000,0x00808202,
+   0x00808002,0x8202,0x0002,0x8000,
+   0x0200,0x00808200,0x00808202,0x0200,
+   0x00800202,0x00808002,0x0080,0x0002,
+   0x0202,0x00800200,0x00800200,0x8200,
+   0x8200,0x00808000,0x00808000,0x00800202,
+   0x8002,0x0082,0x0082,0x8002,
+   0x,0x0202,0x8202,0x0080,
+   0x8000,0x00808202,0x0002,0x00808000,
+   0x00808200,0x0080,0x0080,0x0200,
+   0x00808002,0x8000,0x8200,0x0082,
+   0x0200,0x0002,0x00800202,0x8202,
+   0x00808202,0x8002,0x00808000,0x00800202,
+   0x0082,0x0202,0x8202,0x00808200,
+   0x0202,0x00800200,0x00800200,0x,
+   0x8002,0x8200,0x,0x00808002,
+   },{
+   0x40084010,0x40004000,0x4000,0x00084010,
+   0x0008,0x0010,0x40080010,0x40004010,
+   0x4010,0x40084010,0x40084000,0x4000,
+   0x40004000,0x0008,0x0010,0x40080010,
+   0x00084000,0x00080010,0x40004010,0x,
+   0x4000,0x4000,0x00084010,0x4008,
+   0x00080010,0x4010,0x,0x00084000,
+   0x4010,0x40084000,0x4008,0x4010,
+   0x,0x00084010,0x40080010,0x0008,
+   0x40004010,0x4008,0x40084000,0x4000,
+   0x4008,0x40004000,0x0010,0x40084010,
+   0x00084010,0x0010,0x4000,0x4000,
+   0x4010,0x40084000,0x0008,0x4010,
+   0x00080010,0x40004010,0x4010,0x00080010,
+   0x00084000,0x,0x40004000,0x4010,
+   0x4000,0x40080010,0x40084010,0x00084000,
+   },{
+   0x0104,0x04010100,0x,0x04010004,
+   0x04000100,0x,0x00010104,0x04000100,
+   0x00010004,0x0404,0x0404,0x0001,
+   0x04010104,0x00010004,0x0401,0x0104,
+   0x0400,0x0004,0x04010100,0x0100,
+   0x00010100,0x0401,0x04010004,0x00010104,
+   0x04000104,0x00010100,0x0001,0x04000104,
+   0x0004,0x04010104,0x0100,0x0400,
+   0x04010100,0x0400,0x00010004,0x0104,
+   0x0001,0x04010100,0x04000100,0x,
+   0x0100,0x00010004,0x04010104,0x04000100,
+   0x0404,0x0100,0x,0x04010004,
+   0x04000104,0x0001,0x0400,0x04010104,
+   0x0004,0x00010104,0x00010100,0x0404,
+   0x0401,0x04000104,0x0104,0x0401,
+ 

Re: scripts/build check failing

2018-04-04 Thread Geraldo Netto
addPropertyChangeListener(java.beans.PropertyChangeListener)
[ERROR] location: class java.util.logging.LogManager
[ERROR] 
/home/netto/Desktop/osv/osv-crypt-final/modules/java-base/runjava-isolated/src/main/java/io/osv/jul/IsolatingLogManager.java:[31,5]
method does not override or implement a method from a supertype
[ERROR] 
/home/netto/Desktop/osv/osv-crypt-final/modules/java-base/runjava-isolated/src/main/java/io/osv/jul/IsolatingLogManager.java:[33,22]
cannot find symbol
[ERROR] symbol:   method
removePropertyChangeListener(java.beans.PropertyChangeListener)
[ERROR] location: class java.util.logging.LogManager
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :runjava-isolated
Makefile:19: recipe for target 'module' failed
make[1]: *** [module] Error 1
make[1]: Leaving directory
'/home/netto/Desktop/osv/osv-crypt-final/modules/java-isolated'
Traceback (most recent call last):
  File "scripts/module.py", line 281, in 
args.func(args)
  File "scripts/module.py", line 234, in build
make_modules(modules, args)
  File "scripts/module.py", line 124, in make_modules
raise Exception('make failed for ' + module.name)
Exception: make failed for java-isolated
./scripts/build failed: jdkbase=$jdkbase ARCH=$arch mode=$mode
OSV_BASE=$SRC OSV_BUILD_PATH=$OSV_BUILD_PATH scripts/module.py $j_arg
build -c $modules $usrskel_arg $no_required_arg
netto@besta01 ~/Desktop/osv/osv-crypt-final $


[1] https://docs.oracle.com/javase/9/migrate/JSMIG.pdf



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 4 April 2018 at 18:40, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:
> Which version of Java is being used by build process? I have a feeling it is
> higher than java 8.
>
>
> On Wednesday, April 4, 2018 at 3:57:11 PM UTC-4, Geraldo Netto wrote:
>>
>> Dear Friends,
>>
>> While, applying the changes for the crypt functions, I noticed the
>> runjava-isolated module is failing to build
>> I have tried it with a clean git clone and the issue persists
>>
>> Could you try?
>> Just to make sure, I'm not missing some detail (I use linux mint 18.3)
>>
>> netto@besta01 ~/Desktop/osv/osv-clean $ scripts/build check
>> Building into build/release.x64
>>   GEN gen/include/osv/version.h
>> No such image configuration: tests. Assuming list of modules.
>> Importing /home/netto/Desktop/osv/osv-clean/modules/tests/module.py
>> Importing /home/netto/Desktop/osv/osv-clean/modules/java-tests/module.py
>> Importing /home/netto/Desktop/osv/osv-clean/modules/java/module.py
>> Importing
>> /home/netto/Desktop/osv/osv-clean/modules/java-isolated/module.py
>> Importing /home/netto/Desktop/osv/osv-clean/modules/java-base/module.py
>> Importing /home/netto/Desktop/osv/osv-clean/apps/fonts/module.py
>> No module.py in /home/netto/Desktop/osv/osv-clean/modules/ca-certificates
>> No module.py in /home/netto/Desktop/osv/osv-clean/modules/libz
>> Importing /home/netto/Desktop/osv/osv-clean/modules/openjdk7/module.py
>> Modules:
>>   fonts
>>   ca-certificates
>>   libz
>>   java-base
>>   java-isolated
>>   openjdk7
>>   java
>>   java-tests
>>   tests.*
>> mkdir -p build/etc/pki/ca-trust/extracted/openssl
>> mkdir -p build/etc/pki/ca-trust/extracted/pem
>> mkdir -p build/etc/pki/ca-trust/extracted/java
>> p11-kit extract --format=openssl-bundle --filter=certificates
>> --overwrite build/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
>> p11-kit extract --format=pem-bundle --filter=ca-anchors --overwrite
>> --purpose server-auth
>> build/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
>> p11-kit extract --format=pem-bundle --filter=ca-anchors --overwrite
>> --purpose email
>> build/etc/pki/ca-trust/extracted/pem/email-ca-bundle.pem
>> p11-kit extract --format=pem-bundle --filter=ca-anchors --overwrite
>> --purpose code-signing
>> build/etc/pki/ca-trust/extracted/pem/objsign-ca-bundle.pem
>> p11-kit extract --format=java-cacerts --filter=ca-anchors --overwrite
>> --purpose server-auth build/etc/pki/ca-trust/extracted/java/cacerts
>>   MKDIRS
>>   MKDIRS
>> cd /home/netto/Desktop/osv/osv-clean/modules/java-base && mvn
>> --projects :runjava-common,:runjav

scripts/build check failing

2018-04-04 Thread Geraldo Netto
r
[ERROR] 
/home/netto/Desktop/osv/osv-clean/modules/java-base/runjava-isolated/src/main/java/io/osv/jul/IsolatingLogManager.java:[26,5]
method does not override or implement a method from a supertype
[ERROR] 
/home/netto/Desktop/osv/osv-clean/modules/java-base/runjava-isolated/src/main/java/io/osv/jul/IsolatingLogManager.java:[28,22]
cannot find symbol
[ERROR] symbol:   method
addPropertyChangeListener(java.beans.PropertyChangeListener)
[ERROR] location: class java.util.logging.LogManager
[ERROR] 
/home/netto/Desktop/osv/osv-clean/modules/java-base/runjava-isolated/src/main/java/io/osv/jul/IsolatingLogManager.java:[31,5]
method does not override or implement a method from a supertype
[ERROR] 
/home/netto/Desktop/osv/osv-clean/modules/java-base/runjava-isolated/src/main/java/io/osv/jul/IsolatingLogManager.java:[33,22]
cannot find symbol
[ERROR] symbol:   method
removePropertyChangeListener(java.beans.PropertyChangeListener)
[ERROR] location: class java.util.logging.LogManager
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :runjava-isolated
Makefile:19: recipe for target 'module' failed
make: *** [module] Error 1
Traceback (most recent call last):
  File "scripts/module.py", line 281, in 
args.func(args)
  File "scripts/module.py", line 234, in build
make_modules(modules, args)
  File "scripts/module.py", line 124, in make_modules
raise Exception('make failed for ' + module.name)
Exception: make failed for java-isolated
scripts/build failed: jdkbase=$jdkbase ARCH=$arch mode=$mode
OSV_BASE=$SRC OSV_BUILD_PATH=$OSV_BUILD_PATH scripts/module.py $j_arg
build -c $modules $usrskel_arg $no_required_arg



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How could I change resources allocation on Osv.

2018-03-29 Thread Geraldo Netto
Hello,

In this case, please, check the help information (run.py --help as follows)
and we also have a wiki that is outdated but still have some useful
information: https://github.com/cloudius-systems/osv/wiki

netto@besta01 ~/Desktop/osv/osv-3 $ scripts/run.py --help
usage: run [-h] [-d] [-r] [-w] [-i IMAGE] [-S] [-A] [-I] [-3] [-n] [-b BRIDGE]
   [-v] [-m MEMSIZE] [-c VCPUS] [-e CMD] [-p HYPERVISOR] [-D] [-H]
   [-s] [-u] [-g] [-V] [--forward RULE] [--dry-run] [--jvm-debug]
   [--jvm-suspend] [--mac MAC] [--vnc VNC] [--api]
   [--pass-args PASS_ARGS] [--trace TRACE] [--trace-backtrace]
   [--sampler [SAMPLER]] [--qemu-path QEMU_PATH] [--nics NICS]
   [--novnc] [--nogdb] [--gdb GDB] [--script SCRIPT]
   [--cloud-init-image CLOUD_INIT_IMAGE]

optional arguments:
  -h, --helpshow this help message and exit
  -d, --debug   start debug version
  -r, --release start release version
  -w, --waitdon't start OSv till otherwise specified, e.g. through
the QEMU monitor or a remote gdb
  -i IMAGE, --image IMAGE
path to disk image file. defaults to
build/$mode/usr.img
  -S, --scsiuse virtio-scsi instead of virtio-blk
  -A, --satause AHCI instead of virtio-blk
  -I, --ide use ide instead of virtio-blk
  -3, --vmxnet3 use vmxnet3 instead of virtio-net
  -n, --networking  needs root. tap networking, specify interface
  -b BRIDGE, --bridge BRIDGE
bridge name for tap networking
  -v, --vhost   needs root. tap networking and vhost
  -m MEMSIZE, --memsize MEMSIZE
specify memory: ex. 1G, 2G, ...
  -c VCPUS, --vcpus VCPUS
specify number of vcpus
  -e CMD, --execute CMD
edit command line before execution
  -p HYPERVISOR, --hypervisor HYPERVISOR
choose hypervisor to run: kvm, xen, xenpv, vmware,
none (plain qemu)
  -D, --detach  run in background, do not connect the console
  -H, --no-shutdown don't restart qemu automatically (allow debugger to
connect on early errors)
  -s, --with-signalsqemu only. handle signals instead of passing keys to
the guest. pressing ctrl+c from console will kill the
emulator
  -u, --unsafe-cacheSet cache to unsafe. Use it at your own risk.
  -g, --graphicsEnable graphics mode.
  -V, --verbose pass --verbose to OSv, to display more debugging
information on the console
  --forward RULEadd network forwarding RULE (QEMU syntax)
  --dry-run do not run, just print the command line
  --jvm-debug   start JVM with a debugger server
  --jvm-suspend start JVM with a suspended debugger server
  --mac MAC set MAC address for NIC
  --vnc VNC specify vnc port number
  --api redirect the API port (8000) for user-mode networking
  --pass-args PASS_ARGS
pass arguments to underlying hypervisor (e.g. qemu)
  --trace TRACE enable tracepoints
  --trace-backtrace enable collecting of backtrace at tracepoints
  --sampler [SAMPLER]   start sampling profiler. optionally specify sampling
frequency in Hz
  --qemu-path QEMU_PATH
specify qemu command path
  --nics NICS   number of NICs configured for the VM
  --novnc   disable vnc
  --nogdb   disable gdb
  --gdb GDB specify gdb port number
  --script SCRIPT   XEN define configuration script for vif
  --cloud-init-image CLOUD_INIT_IMAGE
Path to the optional cloud-init image that should be
attached to the instance



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 29 March 2018 at 21:01,  <answerhu...@gmail.com> wrote:
> I try to compare the performance of my simple http-server running in Osv 
> and Qemu so I have to allocate the same resources(memory, disk size and so 
> on) to Osv and Qemu.
> I always start Osv by using:
> sudo scripts/build image=xxx
> sudo scripts/run.py
> So my question is how could I change resources allocation to satisfy my 
> test requirements.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiv

Re: Rust example

2018-03-23 Thread Geraldo Netto
uot;timeout:", sizeof("timeout:") - 1)) {
i = atoi(cp + sizeof("timeout:") - 1);
if (i <= RES_MAXRETRANS)
statp->retrans = i;
else
statp->retrans = RES_MAXRETRANS;
} else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
i = atoi(cp + sizeof("attempts:") - 1);
if (i <= RES_MAXRETRY)
statp->retry = i;
else
statp->retry = RES_MAXRETRY;
} else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
#ifdef DEBUG
if (!(statp->options & RES_DEBUG)) {
printf(";; res_setoptions(\"%s\", \"%s\")..\n",
  options, source);
statp->options |= RES_DEBUG;
}
printf(";;\tdebug\n");
#endif
} else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
statp->options |= RES_USE_INET6;
} else if (!strncmp(cp, "ip6-bytestring",
   sizeof("ip6-bytestring") - 1)) {
statp->options |= RES_USEBSTRING;
} else if (!strncmp(cp, "no-ip6-dotint",
   sizeof("no-ip6-dotint") - 1)) {
statp->options |= RES_NOIP6DOTINT;
} else if (!strncmp(cp, "ip6-dotint",
   sizeof("ip6-dotint") - 1)) {
statp->options &= ~RES_NOIP6DOTINT;
} else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) {
statp->options |= RES_ROTATE;
} else if (!strncmp(cp, "no-check-names",
   sizeof("no-check-names") - 1)) {
statp->options |= RES_NOCHECKNAME;
} else {
/* XXX - print a warning here? */
}
/* skip to next run of spaces */
while (*cp && *cp != ' ' && *cp != '\t')
cp++;
}
}

#ifdef RESOLVSORT
/* XXX - should really support CIDR which means explicit masks always. */
static u_int32_t
net_mask(in) /* XXX - should really use system's version of this */
struct in_addr in;
{
register u_int32_t i = ntohl(in.s_addr);

if (IN_CLASSA(i))
return (htonl(IN_CLASSA_NET));
else if (IN_CLASSB(i))
return (htonl(IN_CLASSB_NET));
return (htonl(IN_CLASSC_NET));
}
#endif

u_int
res_randomid(void) {
struct timeval now;

gettimeofday(, NULL);
return (0x & (now.tv_sec ^ now.tv_usec ^ getpid()));
}
#ifdef _LIBC
libc_hidden_def (__res_randomid)
#endif


/*
 * This routine is for closing the socket if a virtual circuit is used and
 * the program wants to close it.  This provides support for endhostent()
 * which expects to close the socket.
 *
 * This routine is not expected to be user visible.
 */
void
res_nclose(res_state statp) {
int ns;

if (statp->_vcsock >= 0) {
close_not_cancel_no_status(statp->_vcsock);
statp->_vcsock = -1;
statp->_flags &= ~(RES_F_VC | RES_F_CONN);
}
#ifdef _LIBC
for (ns = 0; ns < MAXNS; ns++)
#else
for (ns = 0; ns < statp->_u._ext.nscount; ns++)
#endif
if (statp->_u._ext.nsaddrs[ns]
   && statp->_u._ext.nssocks[ns] != -1) {
close_not_cancel_no_status(statp->_u._ext.nssocks[ns]);
statp->_u._ext.nssocks[ns] = -1;
}
statp->_u._ext.nsinit = 0;
}
#ifdef _LIBC
libc_hidden_def (__res_nclose)
#endif

#ifdef _LIBC
# ifdef _LIBC_REENTRANT
/* This is called when a thread is exiting to free resources held in _res.  */
static void __attribute__ ((section ("__libc_thread_freeres_fn")))
res_thread_freeres (void)
{
  if (_res.nscount == 0)
/* Never called res_ninit.  */
return;

  __res_nclose (&_res); /* Close any VC sockets.  */

  for (int ns = 0; ns < MAXNS; ns++)
if (_res._u._ext.nsaddrs[ns] != NULL)
  {
free (_res._u._ext.nsaddrs[ns]);
_res._u._ext.nsaddrs[ns] = NULL;
  }

  /* Make sure we do a full re-initialization the next time.  */
  _res.options = 0;
}
text_set_element (__libc_thread_subfreeres, res_thread_freeres);
text_set_element (__libc_subfreeres, res_thread_freeres);
# endif
#endif



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 23 March 2018 at 09:38, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:
> I managed to build and run simple Rust hello example on OSv.
>
> Initially OSv complained about missing  __res_init symbol. Based on what I
> read it is some old libc function kept for backwards compatibility and it is
> not clear why rust needs it.
>
> I found existing musl implementation in src/network/res_init.c
>
> int res_init()
> {
> return 0;
> }
>
> I added it to Makefile and this also did not help as rust was looking for
> __res_init NOT res_init. I hacked the name in musl version of res_init.c to
> __res_init it made rust example boot properly.
>
> What is the proper way to add __res_init?
>
> Waldek
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH v2 0/4] Added ROFS implementation

2018-03-22 Thread Geraldo Netto
Great Job Waldek!


while (1) {
  Waldek++;
}


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 22 March 2018 at 07:47, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:
> Nadav,
>
> Firsts thanks for reviewing and committing these 2 first patches.
>
> Indeed the ROFS images are larger than ZFS because of lack of any
> compression. However because of mounting/unmounting/threads creation
> overhead ZFS images are much slower to boot/shutdown.
>
> As I point it out in my first commit compression and memory utilization are
> two areas further to improve with ROFS.
>
> Waldek
>
>
>
> Sent from my iPhone
>
> On Mar 22, 2018, at 05:47, Nadav Har'El <n...@scylladb.com> wrote:
>
>
> On Thu, Mar 22, 2018 at 11:44 AM, Nadav Har'El <n...@scylladb.com> wrote:
>>
>>
>> On Thu, Mar 22, 2018 at 7:10 AM, Waldemar Kozaczuk <jwkozac...@gmail.com>
>> wrote:
>>>
>>> All these 4 patches are identical as in the set from March 2. However
>>> they are in different order with the 4-th one being most controversial.
>>
>>
>> Thanks! I pushed the first two patches (those actually adding rofs), and
>> will look at the other two now.
>>
>> Something curious I noticed is that the image created by
>
>
> Oops, trigger-happy gmail :-(
>
> What I wanted to say that I noticed that the image created by
>
> scripts/build fs=rofs image=rogue
>
> was slightly *larger* than the one with the default ZFS. I was surprised, I
> assume that ZFS has a lot
> of overheads on disk (inodes? journal? etc.) which ROFS wouldn't. Perhaps
> it's ZFS compression
> giving it the edge here (if I remember correctly, we enable ZFS compression
> during upload, but then
> disable it). Anyway, it's not a critical issue.
>
>
>>
>>
>>
>>>
>>>
>>> Waldemar Kozaczuk (4):
>>>   Implemented Read-Only File System (ROFS)
>>>   Added read-around cache layer to ROFS
>>>   Enhanced ramfs implementation to handle time and mode node attributes
>>>   Enhanced tests to allows testing rofs/ramfs image
>>>
>>>  Makefile   |   5 +
>>>  fs/ramfs/ramfs.h   |   4 +
>>>  fs/ramfs/ramfs_vnops.cc| 101 +-
>>>  fs/rofs/rofs.hh| 136 
>>>  fs/rofs/rofs_cache.cc  | 274 +++
>>>  fs/rofs/rofs_common.cc |  85 +
>>>  fs/rofs/rofs_vfsops.cc | 223 
>>>  fs/rofs/rofs_vnops.cc  | 320
>>> ++
>>>  fs/vfs/main.cc |  67 ++--
>>>  fs/vfs/vfs_conf.cc |   3 +
>>>  fs/vfs/vfs_vnode.cc|   9 +-
>>>  include/osv/vnode.h|   1 +
>>>  licenses/mfs.txt   |  45 +++
>>>  loader.cc  |  34 +-
>>>  modules/httpserver-api/api/fs.cc   |   4 +-
>>>  modules/tests/Makefile |  52 ++-
>>>  modules/tests/create_static.sh |  36 ++
>>>  scripts/build  |  24 +-
>>>  scripts/gen-rofs-img.py| 373
>>> +
>>>  static/etc/fstab_rofs  |   4 +
>>>  tests/tst-chdir.cc |  42 ++-
>>>  tests/tst-concurrent-read.cc   | 104 ++
>>>  tests/tst-fallocate.cc |   2 +-
>>>  tests/tst-fs-link.cc   |   8 +-
>>>  tests/tst-readdir.cc   |  42 ++-
>>>  tests/tst-symlink.cc   |  84 -
>>>  tests/tst-uio.cc   |   4 +-
>>>  tests/tst-zfs-mount.cc |   2 +-
>>>  usr_nozfs.manifest.skel => usr_ramfs.manifest.skel |   0
>>>  usr_nozfs.manifest.skel => usr_rofs.manifest.skel  |   2 +-
>>>  30 files changed, 1999 insertions(+), 91 deletions(-)
>>>  create mode 100644 fs/rofs/rofs.hh
>>>  create mode 100644 fs/rofs/rofs_cache.cc
>>>  create mode 100644 fs/rofs/rofs_common.cc
>>>  create mode 100644 fs/rofs/rofs_vfsops.cc
>>>  create mode 100644 fs/rofs/rofs_vnops.cc
>>>  

Re: page fault outside application was Re: [PATCH] groonga: fix path separator

2018-03-09 Thread Geraldo Netto
Hello,

Another step below, I was checking musl code and we use exactly the same
block of code:
#include 
#include 
#include 
#include 

#define ALIGN (sizeof(size_t))
#define ONES ((size_t)-1/UCHAR_MAX)
#define HIGHS (ONES * (UCHAR_MAX/2+1))
#define HASZERO(x) (((x)-ONES) & ~(x) & HIGHS)

size_t strlen(const char *s)
{
const char *a = s;
const size_t *w;
for (; (uintptr_t)s % ALIGN; s++) if (!*s) return s-a;
*for (w = (const void *)s; !HASZERO(*w); w++);*
for (s = (const void *)w; *s; s++);
return s-a;
}

If I understood it correctly, strlen is null/empty on?
*for (w = (const void *)s; !HASZERO(*w); w++);*


...
(gdb) where
#0  processor::cli_hlt () at arch/x64/processor.hh:248
#1  0x00209a20 in arch::halt_no_interrupts () at arch/x64/arch.hh:48
#2  0x0049a3a4 in osv::halt () at arch/x64/power.cc:24
#3  0x0022cbff in abort (fmt=0xa20a5d "Aborted\n") at runtime.cc:132
#4  0x0022caca in abort () at runtime.cc:98
#5  0x003c5fa8 in mmu::vm_sigsegv (addr=0, ef=0x83ce3068)
at core/mmu.cc:1316
#6  0x003c6147 in mmu::vm_fault (addr=0, ef=0x83ce3068) at
core/mmu.cc:1338
#7  0x0048a48b in page_fault (ef=0x83ce3068) at
arch/x64/mmu.cc:38
#8  
*#9  0x006a6fda in strlen (s=0x0) at libc/string/strlen.c:16*
#10 0x10c04514 in line_editor_init ()
#11 0x10c10c21 in main ()
#12 0x00643d97 in osv::application::run_main
(this=0xa3528810, path="/usr/bin/groonga",
argc=3, argv=0xa22031e0) at core/app.cc:336
#13 0x00643fea in osv::application::run_main
(this=0xa3528810) at core/app.cc:353
#14 0x00642779 in __libc_start_main (main=0x10c0fa79 ) at
core/app.cc:36
#15 0x10c04399 in _start ()


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 9 March 2018 at 22:26, Geraldo Netto <geraldone...@gmail.com> wrote:

> Dear Friends,
>
> Progressing with groonga fixes, I have updated libedit in order to test if
> it was a problem with libedit version
>
> It turns out I have uncovered another problem, it seems related to our
> libc/strlen
>
> Do you happen to have any suggestion?
>
> I was reading the changelog of libedit and i have a strong feeling it's
> related to UTF8 support on libedit that is enabled by default in recent
> versions (http://thrysoee.dk/editline/)
>
> I have tried to pass a parameter to disable wide-char but it continues to
> give the same error
>
> netto@besta01 ~/osv-clean $ scripts/run.py -V -d
> OSv v0.24-500-g9e28c90
> 4 CPUs detected
> Firmware vendor: SeaBIOS
> bsd: initializing - done
> VFS: mounting ramfs at /
> VFS: mounting devfs at /dev
> net: initializing - done
> vga: Add VGA device instance
> eth0: ethernet address: 52:54:00:12:34:56
> virtio-blk: Add blk device instances 0 as vblk0, devsize=10737418240
> random: virtio-rng registered as a source.
> random: intel drng, rdrand registered as a source.
> random: <Software, Yarrow> initialized
> VFS: unmounting /dev
> VFS: mounting zfs at /zfs
> zfs: mounting osv/zfs from device /dev/vblk0.1
> random: device unblocked.
> VFS: mounting devfs at /dev
> VFS: mounting procfs at /proc
> program zpool.so returned 1
> BSD shrinker: event handler list found: 0xa217bb80
> BSD shrinker found: 1
> BSD shrinker: unlocked, running
> [I/42 dhcp]: Broadcasting DHCPDISCOVER message with xid: [2145432952
> <(21)%204543-2952>]
> [I/42 dhcp]: Waiting for IP...
> [I/244 dhcp]: Received DHCPOFFER message from DHCP server: 192.168.122.1
> regarding offerred IP address: 192.168.122.15
> [I/244 dhcp]: Broadcasting DHCPREQUEST message with xid: [2145432952
> <(21)%204543-2952>] to SELECT offered IP: 192.168.122.15
> [I/244 dhcp]: Received DHCPACK message from DHCP server: 192.168.122.1
> regarding offerred IP address: 192.168.122.15
> [I/244 dhcp]: Server acknowledged IP 192.168.122.15 for interface eth0
> with time to lease in seconds: 86400
> eth0: 192.168.122.15
> [I/244 dhcp]: Configuring eth0: ip 192.168.122.15 subnet mask
> 255.255.255.0 gateway 192.168.122.1 MTU 1500
> *page fault outside application, addr: 0x*
> *[registers]*
> *RIP: 0x006a6fda <strlen+81>*
> *RFL: 0x00010246  CS:  0x0008  SS:  0x0010*
> *RAX: 0x  RBX: 0x201ffce0  RCX:
> 0xa2ec5d60  RDX: 0x0018*
> *RSI: 0x10c10f2b  RDI: 0x  RBP:
> 0x201ffab0  R8:  0xa217be80*
> *R9:  0x00ad8a68  R10: 0x939f6000  R11:
> 0x0200  R12: 0x0008*
> *R13: 0x00ad8a68  R14: 0x939f6000  R15:
> 0x0200  RSP: 0x201ffab0*
> Aborted

page fault outside application was Re: [PATCH] groonga: fix path separator

2018-03-09 Thread Geraldo Netto
Dear Friends,

Progressing with groonga fixes, I have updated libedit in order to test if
it was a problem with libedit version

It turns out I have uncovered another problem, it seems related to our
libc/strlen

Do you happen to have any suggestion?

I was reading the changelog of libedit and i have a strong feeling it's
related to UTF8 support on libedit that is enabled by default in recent
versions (http://thrysoee.dk/editline/)

I have tried to pass a parameter to disable wide-char but it continues to
give the same error

netto@besta01 ~/osv-clean $ scripts/run.py -V -d
OSv v0.24-500-g9e28c90
4 CPUs detected
Firmware vendor: SeaBIOS
bsd: initializing - done
VFS: mounting ramfs at /
VFS: mounting devfs at /dev
net: initializing - done
vga: Add VGA device instance
eth0: ethernet address: 52:54:00:12:34:56
virtio-blk: Add blk device instances 0 as vblk0, devsize=10737418240
random: virtio-rng registered as a source.
random: intel drng, rdrand registered as a source.
random: <Software, Yarrow> initialized
VFS: unmounting /dev
VFS: mounting zfs at /zfs
zfs: mounting osv/zfs from device /dev/vblk0.1
random: device unblocked.
VFS: mounting devfs at /dev
VFS: mounting procfs at /proc
program zpool.so returned 1
BSD shrinker: event handler list found: 0xa217bb80
BSD shrinker found: 1
BSD shrinker: unlocked, running
[I/42 dhcp]: Broadcasting DHCPDISCOVER message with xid: [2145432952]
[I/42 dhcp]: Waiting for IP...
[I/244 dhcp]: Received DHCPOFFER message from DHCP server: 192.168.122.1
regarding offerred IP address: 192.168.122.15
[I/244 dhcp]: Broadcasting DHCPREQUEST message with xid: [2145432952] to
SELECT offered IP: 192.168.122.15
[I/244 dhcp]: Received DHCPACK message from DHCP server: 192.168.122.1
regarding offerred IP address: 192.168.122.15
[I/244 dhcp]: Server acknowledged IP 192.168.122.15 for interface eth0 with
time to lease in seconds: 86400
eth0: 192.168.122.15
[I/244 dhcp]: Configuring eth0: ip 192.168.122.15 subnet mask 255.255.255.0
gateway 192.168.122.1 MTU 1500
*page fault outside application, addr: 0x*
*[registers]*
*RIP: 0x006a6fda <strlen+81>*
*RFL: 0x00010246  CS:  0x0008  SS:  0x0010*
*RAX: 0x  RBX: 0x201ffce0  RCX: 0xa2ec5d60
RDX: 0x0018*
*RSI: 0x10c10f2b  RDI: 0x  RBP: 0x201ffab0
R8:  0xa217be80*
*R9:  0x00ad8a68  R10: 0x939f6000  R11: 0x0200
R12: 0x0008*
*R13: 0x00ad8a68  R14: 0x939f6000  R15: 0x0200
RSP: 0x201ffab0*
Aborted

[backtrace]
0x0022cbd8 <abort(char const*, ...)+270>
0x003c5fa7 
0x003c6146 <mmu::vm_fault(unsigned long, exception_frame*)+350>
0x0048a48a <page_fault+315>
0x004892e6 
0x10c04513 
0x10c10c20 
0x00643d96
<osv::application::run_main(std::__cxx11::basic_string<char,
std::char_traits, std::allocator >, int, char**)+704>
0x00643fe9 <osv::application::run_main()+329>
*0x00642778 <__libc_start_main+138>*
0x10c04398 


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 9 March 2018 at 18:15, Geraldo Netto <geraldone...@gmail.com> wrote:

> Dear Friends,
>
> I was trying to reproduce the same issue on fedora 27
> So, I installed fedora 27 from scratch with all standard configuration
> (eg: next-next-finish)
> and I end up finding something else...
> It seems, for some reason, different versions of the same package are been
> installed:
> I have reordered by name so you can see it, is there any reason for that?
>
> ant-1.10.1-7.fc27.noarch
> 1/231
> ant-lib-1.10.1-7.fc27.noarch
>12/231
> aopalliance-1.0-15.fc27.noarch
>15/231
> apache-commons-cli-1.4-2.fc27.noarch
>16/231
> apache-commons-codec-1.10-5.fc27.noarch
> 55/231
> apache-commons-io-1:2.5-3.fc27.noarch
> 17/231
> apache-commons-lang-2.6-20.fc27.noarch
>18/231
> apache-commons-lang3-3.6-3.fc27.noarch
>19/231
> apache-commons-logging-1.2-11.fc27.noarch
> 20/231
> atinject-1-25.20100611svn86.fc27.noarch
> 21/231
> autoconf-2.69-25.fc27.noarch
> 2/231
> autogen-libopts-5.18.12-5.fc27.x86_64
> 97/231
> automake-1.15.1-2.fc27.noarch
>3/231
> binutils-2.29-6.fc27.x86_64
>   86/231
> binutils-aarch64-linux-gnu-2.29.1-1.fc27.x86_64
> 91/231
> bison-3.0.4-8.fc27.x86_64
>4/231
> boost-1.64.0-5.fc27.x86_64
>60/231
> boost-atomic-1.64.0-5.fc27.x86_64
> 61/231
> boost-chrono-1.64.0-5.fc27.x86_64
> 62/231
> boost-container-1.64.0-5.fc27.x86_64
>63/231
> boost-context-1.64.0-5.fc27.x86_64
>64/231
&g

Re: [PATCH] groonga: fix path separator

2018-03-09 Thread Geraldo Netto
  185/231 *
*nss-softokn-3.33.0-1.0.fc27.x86_64
  218/231 *
*nss-softokn-3.35.0-1.0.fc27.x86_64
  186/231 *
*nss-softokn-freebl-3.33.0-1.0.fc27.x86_64
 223/231 *
*nss-softokn-freebl-3.35.0-1.0.fc27.x86_64
 189/231 *
*nss-sysinit-3.33.0-1.0.fc27.x86_64
  225/231 *
*nss-sysinit-3.35.0-1.1.fc27.x86_64
  191/231 *
*nss-tools-3.33.0-1.0.fc27.x86_64
  224/231 *
*nss-tools-3.35.0-1.1.fc27.x86_64
  190/231 *
*nss-util-3.33.0-1.0.fc27.x86_64
 222/231 *
*nss-util-3.35.0-1.0.fc27.x86_64
 188/231 *
objectweb-asm-5.1-8.fc27.noarch
  50/231
openblas-0.2.20-3.fc27.x86_64
 146/231
openblas-threads-0.2.20-3.fc27.x86_64
 147/231
patch-2.7.6-3.fc27.x86_64
 111/231
perl-Thread-Queue-3.12-394.fc27.noarch
 14/231
plexus-cipher-1.7-13.fc27.noarch
 37/231
plexus-classworlds-2.5.2-8.fc27.noarch
 38/231
plexus-containers-component-annotations-1.7.1-3.fc27.noarch
  39/231
plexus-interpolation-1.22-8.fc27.noarch
  40/231
plexus-sec-dispatcher-1.4-23.fc27.noarch
 41/231
plexus-utils-3.0.24-4.fc27.noarch
  42/231
publicsuffix-list-20180223-1.fc27.noarch
137/231
python-backports-ssl_match_hostname-3.5.0.1-5.fc27.noarch
 121/231
python-chardet-3.0.4-2.fc27.noarch
 51/231
python-ipaddress-1.0.18-2.fc27.noarch
 122/231
python2-asn1crypto-0.23.0-1.fc27.noarch
 139/231
python2-backports-1.0-12.fc27.x86_64
130/231
python2-cffi-1.10.0-3.fc27.x86_64
 127/231
python2-cryptography-2.0.2-3.fc27.x86_64
126/231
python2-dpkt-1.9.1-1.fc27.noarch
 10/231
python2-enum34-1.1.6-3.fc27.noarch
140/231
python2-idna-2.5-2.fc27.noarch
 52/231
python2-nose-1.3.7-15.fc27.noarch
 148/231
python2-numpy-1:1.13.3-4.fc27.x86_64
145/231
python2-ply-3.9-4.fc27.noarch
 129/231
python2-pycparser-2.14-11.fc27.noarch
 128/231
python2-pyOpenSSL-17.2.0-2.fc27.noarch
123/231
python2-pysocks-1.6.7-1.fc27.noarch
 124/231
python2-requests-2.18.4-1.fc27.noarch
  11/231
python2-six-1.11.0-1.fc27.noarch
125/231
python2-urllib3-1.22-3.fc27.noarch
120/231
sisu-inject-1:0.3.3-2.fc27.noarch
  43/231
sisu-plexus-1:0.3.3-2.fc27.noarch
  44/231
slf4j-1.7.25-2.fc27.noarch
 45/231
ttmkfdir-3.0.9-51.fc27.x86_64
 116/231
unbound-libs-1.6.8-6.fc27.x86_64
143/231
xorg-x11-fonts-Type1-7.5-18.fc27.noarch
 115/231
yaml-cpp-0.5.3-9.fc27.x86_64
113/231
yaml-cpp-devel-0.5.3-9.fc27.x86_64
112/231
zlib-devel-1.2.11-4.fc27.x86_64
 118/231



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 9 March 2018 at 10:29, Geraldo Netto <geraldone...@gmail.com> wrote:

> Dear Friends,
>
> I was doing more tests and for some reason, libz and libedit are not been
> included for groonga
> because of that, the function history_w() is to been found, so, osv
> crashes as below
>
> But I would still consider applying this patch otherwise groonga will not
> even build
>
> netto@besta01 ~/osv $ scripts/run.py -V
> OSv v0.24-500-g9e28c90
> 4 CPUs detected
> Firmware vendor: SeaBIOS
> bsd: initializing - done
> VFS: mounting ramfs at /
> VFS: mounting devfs at /dev
> net: initializing - done
> vga: Add VGA device instance
> eth0: ethernet address: 52:54:00:12:34:56
> virtio-blk: Add blk device instances 0 as vblk0, devsize=10737418240
> random: virtio-rng registered as a source.
> random: intel drng, rdrand registered as a source.
> random: <Software, Yarrow> initialized
> VFS: unmounting /dev
> VFS: mounting zfs at /zfs
> zfs: mounting osv/zfs from device /dev/vblk0.1
> random: device unblocked.
> VFS: mounting devfs at /dev
> VFS: mounting procfs at /proc
> program zpool.so returned 1
> BSD shrinker: event handler list found: 0xa18e9b00
> BSD shrinker found: 1
> BSD shrinker: unlocked, running
> [I/42 dhcp]: Broadcasting DHCPDISCOVER message with xid: [2135113627
> <(21)%203511-3627>]
> [I/42 dhcp]: Waiting for IP...
> [I/244 dhcp]: Received DHCPOFFER message from DHCP server: 192.168.122.1
> regarding offerred IP address: 192.168.122.15
> [I/244 dhcp]: Broadcasting DHCPREQUEST message with xid: [2135113627
> <(21)%203511-3627>] to SELECT offered IP: 192.168.122.15
> [I/244 dhcp]: Received DHCPACK message from DHCP server: 192.168.122.1
> regarding offerred IP address: 192.168.122.15
> [I/244 dhcp]: Server acknowledged IP 192.168.122.15 for interface eth0
> with time to lease in seconds: 86400
> eth0: 192.168.122.15
> [I/244 dhcp]: Configuring eth0: ip 192.168.122.15 subnet mask
> 255.255.255.0 gateway 192.168.122.1 MTU 1500
> *could not load libz.so.1*
> *could not load libedit.so.2*
> */usr/bin/groonga: failed looking up symbol history_w*
>
> [backtrace]
> 0x0033e303 <elf::object::symbol(unsigned int)+227>
> 0x0038ca14 <elf::object::arch_relocate_rela(unsig

Re: [PATCH] groonga: fix path separator

2018-03-09 Thread Geraldo Netto
Dear Friends,

I was doing more tests and for some reason, libz and libedit are not been
included for groonga
because of that, the function history_w() is to been found, so, osv crashes
as below

But I would still consider applying this patch otherwise groonga will not
even build

netto@besta01 ~/osv $ scripts/run.py -V
OSv v0.24-500-g9e28c90
4 CPUs detected
Firmware vendor: SeaBIOS
bsd: initializing - done
VFS: mounting ramfs at /
VFS: mounting devfs at /dev
net: initializing - done
vga: Add VGA device instance
eth0: ethernet address: 52:54:00:12:34:56
virtio-blk: Add blk device instances 0 as vblk0, devsize=10737418240
random: virtio-rng registered as a source.
random: intel drng, rdrand registered as a source.
random: <Software, Yarrow> initialized
VFS: unmounting /dev
VFS: mounting zfs at /zfs
zfs: mounting osv/zfs from device /dev/vblk0.1
random: device unblocked.
VFS: mounting devfs at /dev
VFS: mounting procfs at /proc
program zpool.so returned 1
BSD shrinker: event handler list found: 0xa18e9b00
BSD shrinker found: 1
BSD shrinker: unlocked, running
[I/42 dhcp]: Broadcasting DHCPDISCOVER message with xid: [2135113627]
[I/42 dhcp]: Waiting for IP...
[I/244 dhcp]: Received DHCPOFFER message from DHCP server: 192.168.122.1
regarding offerred IP address: 192.168.122.15
[I/244 dhcp]: Broadcasting DHCPREQUEST message with xid: [2135113627] to
SELECT offered IP: 192.168.122.15
[I/244 dhcp]: Received DHCPACK message from DHCP server: 192.168.122.1
regarding offerred IP address: 192.168.122.15
[I/244 dhcp]: Server acknowledged IP 192.168.122.15 for interface eth0 with
time to lease in seconds: 86400
eth0: 192.168.122.15
[I/244 dhcp]: Configuring eth0: ip 192.168.122.15 subnet mask 255.255.255.0
gateway 192.168.122.1 MTU 1500
*could not load libz.so.1*
*could not load libedit.so.2*
*/usr/bin/groonga: failed looking up symbol history_w*

[backtrace]
0x0033e303 <elf::object::symbol(unsigned int)+227>
0x0038ca14 <elf::object::arch_relocate_rela(unsigned int, unsigned
int, void*, long)+292>
0x0033c6a4 <elf::object::relocate_rela()+148>
0x0033f107 <elf::object::relocate()+199>
0x00342412
<elf::program::load_object(std::__cxx11::basic_string<char,
std::char_traits, std::allocator >,
std::vector<std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > > >,
std::vector<std::shared_ptr,
std::allocator<std::shared_ptr > >&)+1602>
0x00342c52
<elf::program::get_library(std::__cxx11::basic_string<char,
std::char_traits, std::allocator >,
std::vector<std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > > >)+322>
0x004144c3
<osv::application::application(std::__cxx11::basic_string<char,
std::char_traits, std::allocator > const&,
std::vector<std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > > > const&, bool,
std::unordered_map<std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, std::__cxx11::basic_string<char,
std::char_traits, std::allocator >,
std::hash<std::__cxx11::basic_string<char, std::char_traits,
std::allocator > >, std::equal_to<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > >,
std::allocator<std::pair<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > const,
std::__cxx11::basic_string<char, std::char_traits,
std::allocator > > > > const*)+707>
0x00414c08 <osv::application::run(std::__cxx11::basic_string<char,
std::char_traits, std::allocator > const&,
std::vector<std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > > > const&, bool,
std::unordered_map<std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, std::__cxx11::basic_string<char,
std::char_traits, std::allocator >,
std::hash<std::__cxx11::basic_string<char, std::char_traits,
std::allocator > >, std::equal_to<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > >,
std::allocator<std::pair<std::__cxx11::basic_string<char,
std::char_traits, std::allocator > const,
std::__cxx11::basic_string<char, std::char_traits,
std::allocator > > > > const*)+104>
0x00414e1b
<osv::application::run(std::vector<std::__cxx11::basic_string<char,
std::char_traits, std::allocator >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits,
std::allocator > &g

[PATCH] groonga: fix path separator

2018-03-08 Thread geraldo netto
fix path separator that way manifest_common.py does not fail when building 
groonga
build was tested on linux mint 18.3

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 groonga/GET | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/groonga/GET b/groonga/GET
index d2e2ee3..47d53f9 100755
--- a/groonga/GET
+++ b/groonga/GET
@@ -24,8 +24,8 @@ cd $BASEDIR
 find . -name "*.so" |  xargs -I {} ldd {} | grep -Po '(?<=> )/[^ ]+' | sort | 
uniq | grep -Pv 'lib(c|dl|m|util|rt|pthread|z|groonga.*).so' | xargs -I {} 
install  {} install/lib
 
 echo "
-/usr/etc/**:${ROOTDIR}/etc/**
-/usr/share/**:${ROOTDIR}/share/**
-/usr/lib/**:${ROOTDIR}/lib/**
-/usr/bin/groonga:${ROOTDIR}/bin/groonga
+/usr/etc/**: ${ROOTDIR}/etc/**
+/usr/share/**: ${ROOTDIR}/share/**
+/usr/lib/**: ${ROOTDIR}/lib/**
+/usr/bin/groonga: ${ROOTDIR}/bin/groonga
 " > usr.manifest
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


cloud-init doubt - do we always use cloud-init?

2018-02-28 Thread Geraldo Netto
Dear Friends,

I know I should be RTFM'ing the code
But just a quick doubt, do we always use cloud-init
even for deployments that are not related to EC2?

Do you see any problem if I try to upgrade json11 library in it?
I didn't check all the changelog, but I see it's still actively maintained
So, probably, there are many fixes once json11 on cloud-init is from 2014
something while we have a new version from months ago


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] Makefile: strip dummy-shlib.so

2018-02-28 Thread Geraldo Netto
Hello Waldek/Friends,

It's interesting, for some reason, I could further strip the dummy-shlib
and I couldn't find the stripped version for dummy-shlib
which seems dummy-shlib is not really stripped, otherwise we would not have
a different file size when I run strip on it, I suppose

In any case, I'll check 2 things:
- if .so files are really stripped (do you see any risk in stripping
everything?)
- find a way to remove dummy-shlib dependency
  (i couldn't find the comment block, but i'm sure dummy-shlib was added to
workaround something on gcc which i don't recall now)


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 28 February 2018 at 10:54, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:

> I am not sure if this patch is necessary. I though all so files get
> stripped by strip_file function in scripts/manifest_common.py.
>
> Also I noticed you reordered the dependencies in the Makefile. Is it
> necessary. That way it is hard to asses if by accident you are not removing
> anything.
>
> On Thursday, February 22, 2018 at 11:46:58 AM UTC-5, Geraldo Netto wrote:
>>
>> with this small change we reduce dummy-shlib.so size from 8.24 KB to 5.62
>> KB
>> i have tested the build with tomcat and some other apps, everything looks
>> good
>>
>> Signed-off-by: geraldo netto <gerald...@gmail.com>
>> ---
>>  Makefile | 37 +++--
>>  1 file changed, 19 insertions(+), 18 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 8dd2371..80a1137 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -410,6 +410,7 @@ cmdline = --nomount tests/tst-hello.so
>>  endif
>>
>>  $(out)/loader-stripped.elf: $(out)/loader.elf
>> +$(call quiet, $(STRIP) $(out)/dummy-shlib.so, STRIP
>> dummy-shlib.so )
>>  $(call quiet, $(STRIP) $(out)/loader.elf -o
>> $(out)/loader-stripped.elf, STRIP loader.elf -> loader-stripped.elf )
>>
>>  ifeq ($(arch),x64)
>> @@ -554,23 +555,23 @@ bsd += bsd/porting/mmu.o
>>  bsd += bsd/porting/pcpu.o
>>  bsd += bsd/porting/bus_dma.o
>>  bsd += bsd/porting/kobj.o
>> -bsd += bsd/sys/netinet/if_ether.o
>> -bsd += bsd/sys/compat/linux/linux_socket.o
>> -bsd += bsd/sys/compat/linux/linux_ioctl.o
>> -bsd += bsd/sys/net/if_ethersubr.o
>> -bsd += bsd/sys/net/if_llatbl.o
>> -bsd += bsd/sys/net/radix.o
>> -bsd += bsd/sys/net/route.o
>> -bsd += bsd/sys/net/raw_cb.o
>> -bsd += bsd/sys/net/raw_usrreq.o
>> -bsd += bsd/sys/net/rtsock.o
>> -bsd += bsd/sys/net/netisr.o
>> -bsd += bsd/sys/net/netisr1.o
>> -bsd += bsd/sys/net/if_dead.o
>> -bsd += bsd/sys/net/if_clone.o
>> -bsd += bsd/sys/net/if_loop.o
>> -bsd += bsd/sys/net/if.o
>> -bsd += bsd/sys/net/pfil.o
>> +bsd += bsd/sys/netinet/if_ether.o
>> +bsd += bsd/sys/compat/linux/linux_socket.o
>> +bsd += bsd/sys/compat/linux/linux_ioctl.o
>> +bsd += bsd/sys/net/if_ethersubr.o
>> +bsd += bsd/sys/net/if_llatbl.o
>> +bsd += bsd/sys/net/radix.o
>> +bsd += bsd/sys/net/route.o
>> +bsd += bsd/sys/net/raw_cb.o
>> +bsd += bsd/sys/net/raw_usrreq.o
>> +bsd += bsd/sys/net/rtsock.o
>> +bsd += bsd/sys/net/netisr.o
>> +bsd += bsd/sys/net/netisr1.o
>> +bsd += bsd/sys/net/if_dead.o
>> +bsd += bsd/sys/net/if_clone.o
>> +bsd += bsd/sys/net/if_loop.o
>> +bsd += bsd/sys/net/if.o
>> +bsd += bsd/sys/net/pfil.o
>>  bsd += bsd/sys/net/routecache.o
>>  bsd += bsd/sys/netinet/in.o
>>  bsd += bsd/sys/netinet/in_pcb.o
>> @@ -1947,7 +1948,7 @@ libuutil-objects = $(foreach file,
>> $(libuutil-file-list), $(out)/bsd/cddl/contri
>>
>>  define libuutil-includes
>>bsd/cddl/contrib/opensolaris/lib/libuutil/common
>> -  bsd/cddl/compat/opensolaris/include
>> +  bsd/cddl/compat/opensolaris/include
>>bsd/sys/cddl/contrib/opensolaris/uts/common
>>bsd/sys/cddl/compat/opensolaris
>>bsd/cddl/contrib/opensolaris/head
>> --
>> 2.7.4
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 2/4] makefile: update crypt references to use libc instead of musl

2018-02-25 Thread geraldo netto
Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 Makefile | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 8dd2371..cc80d2d 100644
--- a/Makefile
+++ b/Makefile
@@ -1733,13 +1733,14 @@ else
 musl += fenv/fenv.o
 endif
 
-musl += crypt/crypt_blowfish.o
-musl += crypt/crypt.o
-musl += crypt/crypt_des.o
-musl += crypt/crypt_md5.o
-musl += crypt/crypt_r.o
-musl += crypt/crypt_sha256.o
-musl += crypt/crypt_sha512.o
+libc += crypt/crypt_blowfish.o
+libc += crypt/crypt_des.o
+libc += crypt/crypt_md5.o
+libc += crypt/crypt_sha256.o
+libc += crypt/crypt_sha512.o
+libc += crypt/encrypt.o
+libc += crypt/crypt.o
+libc += crypt/crypt_r.o
 
 #include $(src)/fs/build.mk:
 
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 3/4] core/elf.cc: export libcrypt.so

2018-02-25 Thread geraldo netto
Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 core/elf.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/elf.cc b/core/elf.cc
index 2a46633..9138736 100644
--- a/core/elf.cc
+++ b/core/elf.cc
@@ -1064,6 +1064,7 @@ program::program(void* addr)
   "libstdc++.so.6",
   "libaio.so.1",
   "libxenstore.so.3.0",
+  "libcrypt.so.1",
 };
 auto ml = new modules_list();
 ml->objects.push_back(_core.get());
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 4/4] tests/crypt: add unit test for crypt functions

2018-02-25 Thread geraldo netto
add unit test for crypt functions and update Makefile to reflect it

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 modules/tests/Makefile |  2 +-
 tests/tst-crypt.c  | 71 ++
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 tests/tst-crypt.c

diff --git a/modules/tests/Makefile b/modules/tests/Makefile
index b8348dd..3398e4a 100644
--- a/modules/tests/Makefile
+++ b/modules/tests/Makefile
@@ -87,7 +87,7 @@ tests := tst-pthread.so misc-ramdisk.so tst-vblk.so 
tst-bsd-evh.so \
tst-ifaddrs.so tst-pthread-affinity-inherit.so tst-sem-timed-wait.so \
tst-ttyname.so tst-pthread-barrier.so tst-feexcept.so tst-math.so \
tst-sigaltstack.so tst-fread.so tst-tcp-cork.so tst-tcp-v6.so \
-   tst-calloc.so
+   tst-calloc.so tst-crypt.so
 
 #  libstatic-thread-variable.so tst-static-thread-variable.so \
 
diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
new file mode 100644
index 000..919d4e5
--- /dev/null
+++ b/tests/tst-crypt.c
@@ -0,0 +1,71 @@
+#define _XOPEN_SOURCE
+#include 
+#include 
+#include 
+
+char* concat_str(char* first_block, char* second_block) {
+   static char tmp[10];
+   memset(tmp, 0, sizeof(tmp));
+   strncat(tmp, first_block, sizeof(first_block));
+   strncat(tmp, second_block, sizeof(second_block));
+   return tmp;
+}
+
+int main(void) {
+   // http://man7.org/linux/man-pages/man3/crypt.3.html
+char password[] = "Ab(d3";
+   char salt[] = "201802221723";
+   char result1[] = "20338EPKt5xtY";
+   char result2[] = "$1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.";
+   char result3[] = "$5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0";
+   char result4[] = 
"$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1";
+
+   // 20338EPKt5xtY
+if (strcmp(result1, crypt(password, salt)) != 0) return -1;
+
+   // $1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.
+   if (strcmp(result2, crypt(password, concat_str((char*) "$1$", 
password))) != 0) return -2;
+
+   // gnu libc extension
+   //if (strcmp((null), crypt(password, concat_str((char*) "$2$", 
password return -7;
+   //if (strcmp((null), crypt(password, concat_str((char*) "$2a", 
password return -8;
+
+   // $5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0
+   if (strcmp(result3, crypt(password, concat_str((char*) "$5$", 
password))) != 0) return -3;
+
+   // 
$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1
+   if (strcmp(result4, crypt(password, concat_str((char*) "$6$", 
password))) !=0) return -4;
+
+   // encrypt
+   // http://man7.org/linux/man-pages/man3/encrypt.3.html
+   char key[64];
+   char buf[64];
+   char txt[9];
+   int i, j;
+
+   for (i = 0; i < 8; i++) {
+   for (j = 0; j < 8; j++) {
+   buf[i * 8 + j] = password[i] >> j & 1;
+   }
+   setkey(key);
+   }
+
+   encrypt(buf, 0);
+   for (i = 0; i < 8; i++) {
+   for (j = 0, txt[i] = '\0'; j < 8; j++) {
+   txt[i] |= buf[i * 8 + j] << j;
+   }
+   txt[8] = '\0';
+   }
+   if (strcmp(password, txt) == 0) return -5;
+
+   encrypt(buf, 1);
+   for (i = 0; i < 8; i++) {
+   for (j = 0, txt[i] = '\0'; j < 8; j++) {
+   txt[i] |= buf[i * 8 + j] << j;
+   }
+   txt[8] = '\0';
+   }
+
+   return (strcmp(password, txt) == 0) ? 0 : -6;
+}
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] prof.py: remove empty prof.py script

2018-02-25 Thread geraldo netto
Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 scripts/prof.py | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 scripts/prof.py

diff --git a/scripts/prof.py b/scripts/prof.py
deleted file mode 100644
index e69de29..000
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] musl-crypt: update crypt functions to musl 1.1.18

2018-02-25 Thread Geraldo Netto
Hello Nadav/All,

Sure, working to prepare the patches now
Sorry for the trouble, i didn't pay attention to this


Kind Regards,
Geraldo Netto

Em dom, 25 de fev de 2018 07:01, Nadav Har'El <n...@scylladb.com> escreveu:

> What is this a patch for? It seems you sent a patch for the "musl"
> submodule, but this "musl" is supposed to be a clean, unmodified, copy of
> musl of one specific version (it's basically a snapshot of Musl's git!) -
> you're not supposed to modify it.
>
> Please send, instead, a patch which put these files in OSv's libc, and
> then modifies the Makefile to take it from there.
>
> Thanks,
> Nadav.
>
>
>
> --
> Nadav Har'El
> n...@scylladb.com
>
> On Sat, Feb 24, 2018 at 7:40 PM, geraldo netto <geraldone...@gmail.com>
> wrote:
>
>> update crypt functions to musl 1.1.18
>> this includes encrypt()
>>
>> Signed-off-by: geraldo netto <geraldone...@gmail.com>
>> ---
>>  src/crypt/crypt_des.c| 12 +-
>>  src/crypt/crypt_sha256.c |  2 +-
>>  src/crypt/crypt_sha512.c |  2 +-
>>  src/crypt/encrypt.c  | 60 ++
>> ++
>>  4 files changed, 68 insertions(+), 8 deletions(-)
>>  create mode 100644 src/crypt/encrypt.c
>>
>> diff --git a/src/crypt/crypt_des.c b/src/crypt/crypt_des.c
>> index dc95dca..d5766a7 100644
>> --- a/src/crypt/crypt_des.c
>> +++ b/src/crypt/crypt_des.c
>> @@ -692,7 +692,7 @@ static uint32_t setup_salt(uint32_t salt)
>> return saltbits;
>>  }
>>
>> -static void des_setkey(const unsigned char *key, struct expanded_key
>> *ekey)
>> +void __des_setkey(const unsigned char *key, struct expanded_key *ekey)
>>  {
>> uint32_t k0, k1, rawkey0, rawkey1;
>> unsigned int shifts, round, i, ibit;
>> @@ -753,7 +753,7 @@ static void des_setkey(const unsigned char *key,
>> struct expanded_key *ekey)
>>  /*
>>   * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
>>   */
>> -static void do_des(uint32_t l_in, uint32_t r_in,
>> +void __do_des(uint32_t l_in, uint32_t r_in,
>>  uint32_t *l_out, uint32_t *r_out,
>>  uint32_t count, uint32_t saltbits, const struct expanded_key *ekey)
>>  {
>> @@ -862,7 +862,7 @@ static void des_cipher(const unsigned char *in,
>> unsigned char *out,
>> ((uint32_t)in[5] << 16) |
>> ((uint32_t)in[4] << 24);
>>
>> -   do_des(rawl, rawr, _out, _out, count, saltbits, ekey);
>> +   __do_des(rawl, rawr, _out, _out, count, saltbits, ekey);
>>
>> out[0] = l_out >> 24;
>> out[1] = l_out >> 16;
>> @@ -894,7 +894,7 @@ static char *_crypt_extended_r_uut(const char *_key,
>> const char *_setting, char
>> if (*key)
>> key++;
>> }
>> -   des_setkey(keybuf, );
>> +   __des_setkey(keybuf, );
>>
>> if (*setting == _PASSWORD_EFMT1) {
>> /*
>> @@ -929,7 +929,7 @@ static char *_crypt_extended_r_uut(const char *_key,
>> const char *_setting, char
>> q = keybuf;
>> while (q <= [sizeof(keybuf) - 1] && *key)
>> *q++ ^= *key++ << 1;
>> -   des_setkey(keybuf, );
>> +   __des_setkey(keybuf, );
>> }
>>
>> memcpy(output, setting, 9);
>> @@ -957,7 +957,7 @@ static char *_crypt_extended_r_uut(const char *_key,
>> const char *_setting, char
>> /*
>>  * Do it.
>>  */
>> -   do_des(0, 0, , , count, setup_salt(salt), );
>> +   __do_des(0, 0, , , count, setup_salt(salt), );
>>
>> /*
>>  * Now encode the result...
>> diff --git a/src/crypt/crypt_sha256.c b/src/crypt/crypt_sha256.c
>> index d5f0b78..e885dc6 100644
>> --- a/src/crypt/crypt_sha256.c
>> +++ b/src/crypt/crypt_sha256.c
>> @@ -230,7 +230,7 @@ static char *sha256crypt(const char *key, const char
>> *setting, char *output)
>> if (u < ROUNDS_MIN)
>> r = ROUNDS_MIN;
>> else if (u > ROUNDS_MAX)
>> -   r = ROUNDS_MAX;
>> +   return 0;
>> else
>> r = u;
>> /* needed when rounds is zero prefixed or out of bounds */
>> diff --git a/src/crypt/crypt_sha512.c b/src/crypt/crypt_sha512.c
>> 

Re: [COMMIT osv-apps master] mysql: fix path separator

2018-02-25 Thread Geraldo Netto
Hello Nadav/All,

My apologies, I though I did negate it wrongly
Think there is too much coffee and too little sleeping in here...


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 25 February 2018 at 18:01, Nadav Har'El <n...@scylladb.com> wrote:

>
> On Sun, Feb 25, 2018 at 4:30 PM, Geraldo Netto <geraldone...@gmail.com>
> wrote:
>
>> Hello Guys,
>>
>> How can I fix a comment after commit?
>>
>> *"fix path separator that way manifest_common.py does not fail when
>> building mysql"*
>>
>
> I didn't understand what you want to fix - the word "not" is already in
> the commit message, it's it?
>
> Anyway, changing an already-comitted version is a mess. It's possible, but
> I'd rather not do it unless there is a compelling reason to do it.
>
>
>>
>>
>> Kind Regards,
>> Geraldo Netto
>>
>>
>> Em dom, 25 de fev de 2018 07:02, Commit Bot <b...@cloudius-systems.com>
>> escreveu:
>>
>>> From: geraldo netto <geraldone...@gmail.com>
>>> Committer: Nadav Har'El <n...@scylladb.com>
>>> Branch: master
>>>
>>> mysql: fix path separator
>>>
>>> fix path separator that way manifest_common.py does not fail when
>>> building
>>> mysql
>>>
>>> Signed-off-by: geraldo netto <geraldone...@gmail.com>
>>> Message-Id: <1519534887-33280-1-git-send-email-geraldone...@gmail.com>
>>>
>>> ---
>>> diff --git a/mysql/GET b/mysql/GET
>>> --- a/mysql/GET
>>> +++ b/mysql/GET
>>> @@ -40,9 +40,9 @@ $(cat CMakeFiles/mysqld.dir/link.txt) -shared
>>>   cd $BASEDIR
>>>
>>>   echo "
>>> -/etc/**:${ROOTDIR}/etc/**
>>> -/usr/share/**:${ROOTDIR}/usr/share/**
>>> -/usr/lib/**:${ROOTDIR}/usr/lib/**
>>> -/usr/data/**:${ROOTDIR}/usr/data/**
>>> -/usr/bin/mysqld:${BUILDDIR}/sql/mysqld
>>> +/etc/**: ${ROOTDIR}/etc/**
>>> +/usr/share/**: ${ROOTDIR}/usr/share/**
>>> +/usr/lib/**: ${ROOTDIR}/usr/lib/**
>>> +/usr/data/**: ${ROOTDIR}/usr/data/**
>>> +/usr/bin/mysqld: ${BUILDDIR}/sql/mysqld
>>>   " > usr.manifest
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Releasing OSv

2018-02-25 Thread Geraldo Netto
Hello Waldek/All,

This is great news! :)
If you allow me to suggest, I think we should cleanup the documentation
before releasing it
Otherwise, new people may come to OSv and experience problems with
old/outdated how-tos/tutorials
Also, I would like to finish the crypt part before release


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 25 February 2018 at 16:14, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:

> Adding Miha and Gregor from Xlab to see if they have any
> suggestions/advise.
>
> On Sun, Feb 25, 2018 at 1:45 PM, Waldek Kozaczuk <jwkozac...@gmail.com>
> wrote:
>
>> I would like to publish new release of OSv. The last official one was
>> 0.24 and published on Oct 30, 2015 (a little over 2 years). I have never
>> released OSv so any input and suggestions are very welcome especially from
>> those that did it in the past.
>>
>> There is an existing wiki page that documents how to publish new release
>> - https://github.com/cloudius-systems/osv/wiki/OSv-Release-Procedure.
>> However I think most of the steps do not apply anymore. I think I should
>> follow standard Github release procedure - https://help.github.com/arti
>> cles/creating-releases/.
>>
>> I would also like to take advantage of ability to upload binaries
>> associated with the release. My plan is to build and attach "osv.loader"
>> (aka usr.img) and "osv.bootstrap" mpm file and then let users use
>> mikelangelo capstan in order to build new app packages. The trick is to
>> build it using same or similar tool chain as other capstan packages are
>> built. I am planning to use same or similar docker file as here -
>> https://github.com/mikelangelo-project/capstan-packages in order to
>> avoid any incompatibility issues as described here -
>> https://www.mikelangelo-project.eu/2017/08/the-art-of-prep
>> aring-osv-packages/. I think it is important to use same host system
>> (ubuntu 14), specific gcc and possibly specific version of other artifacts
>> to make sure usr.img is compatible.
>>
>> My goal is to make it easier for OSv newcomers to try OSv. I also want to
>> focus on promoting OSv as a deployment platform for stateless services.
>> Therefore I would like to make it easy to build images using runtimes like
>> JVM, node.js, erlang, python, ruby and eventually golang. I would be also
>> nice to make it easy to try apps like redis, nginx, etc.
>>
>> Some outstanding questions:
>>
>>- What should be new release version - 0.50, 0.75?
>>- What should be the release notes? I think it would be worth to at
>>least list major new features added since last release.
>>
>> Suggestions? Concerns?
>>
>> Waldek
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "OSv Development" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/osv-dev/UF3gyDgwAMg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH 0/4] add crypt functions

2018-02-24 Thread Geraldo Netto
Hello,

I forgot to add, it fixes Inconsistent inclusion of libcrypt in OSv #945
It depends on [PATCH] musl-crypt: update crypt functions to musl 1.1.18



Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 25 February 2018 at 02:50, geraldo netto <geraldone...@gmail.com> wrote:

> because musl has its own git repository i had to create this other set of
> patches
> this is the second part of the patches related to the crypt functions from
> musl 1.1.18
> basically it adds the unit test itself and the references so makefile can
> build it
>
>
> geraldo netto (4):
>   tst-crypt: add test for crypt functions
>   modules/tests/Makefile: add unit test for crypt functions
>   Makefile: add crypt tests
>   core/elf.cc: export libcrypt.so.1
>
>  Makefile   |  5 ++--
>  core/elf.cc|  1 +
>  modules/tests/Makefile |  2 +-
>  tests/tst-crypt.c  | 71 ++
> 
>  4 files changed, 76 insertions(+), 3 deletions(-)
>  create mode 100644 tests/tst-crypt.c
>
> --
> 2.7.4
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] test.py: black list tst-feexcept.so in order to avoid qemu failure (workaround #855)

2018-02-24 Thread geraldo netto
maybe in the future we could create a blacklist per hypervisor
this is a quick workaroud for #855

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 scripts/test.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/test.py b/scripts/test.py
index 993e2ba..52b52e6 100755
--- a/scripts/test.py
+++ b/scripts/test.py
@@ -19,6 +19,7 @@ os.environ["LANG"]="C"
 
 blacklist= [
 "tst-dns-resolver.so",
+"tst-feexcept.so",
 ]
 
 add_tests([
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: upgrading musl version on osv - progress/issues

2018-02-24 Thread Geraldo Netto
Hello Nadav/Waldek/All,

It turns out most math functions just need a minor tuning
I'm still facing a lot of issues with wide chars and some stdio things
But I hope to start submitting the patches to upgrade musl

Also, I was planning to change the approach - instead of having libc and
musl directories
have just one directory for the patches on top of vanilla musl
that way we can easily identify which part of the code require changes


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 13 February 2018 at 20:31, Nadav Har'El <n...@scylladb.com> wrote:

>
> On Tue, Feb 13, 2018 at 9:06 PM, Geraldo Netto <geraldone...@gmail.com>
> wrote:
>
>> Dear Friends,
>>
>> I was playing with current version of musl on osv
>> I have progressed in compilation, but still failing as below
>>
>> Most problems are related to locales (wide chars?), math, some stdio, etc
>> Do you happen to have any magic suggestion/guidance? :)
>>
>
> No magic suggestion, but it's not going to be a walk in the park...
> As you may have noticed, for some of the Musl stuff we don't take the
> unmodified Musl code directly,
> but rather take a *modified* version in libc/.  Often the git history of
> the modified file says why we modified
> it. It's also not always clear what we modified it *from* - in some cases
> we modified an even older version
> and not the version in the current musl/ submodule. You may need or want
> to take the newer Musl code
> and make the same modifications we did - or even better (when possible...)
> try to push our modifications
> upstream to Musl so they are no longer a modification.
>
> All in all, this is not going to be a simple project, and it also will not
> be easy to test the results - although
> we do have unit tests, I wouldn't presume they test everything, and you'll
> need to run a bunch of code
> which uses all these modified functions, or write new tests, to have any
> certainty that things continue to
> work.
>
>
>
>> ...
>>   LINK zpool.so
>>   CXX runtime.cc
>>   LINK zfs.so
>>   LINK cpiod.so
>>   MKBOOTFS build/release.x64/bootfs.bin
>>   AS bootfs.s
>>   LINK loader.elf
>> build/release.x64/musl/src/ctype/iswctype.o: In function `__iswctype_l':
>> /home/netto/osv-dirty/musl/src/ctype/iswctype.c:66: multiple definition
>> of `__iswctype_l'
>> build/release.x64/libc/locale/iswctype_l.o:/home/netto/osv-d
>> irty/libc/locale/iswctype_l.c:6: first defined here
>>
>
> So, you're taking the new musl "iswctype.c" and the older version we have
> in libc/locale/iswctyle_l.c,
> so it's no wonder you have two definitions.
> In this and similar cases, you'll need to understand why we had our own
> modified version of this
> function and didn't just take musl/'s version directly - and you'll need
> to think if we still need this
> modification.
>
>
>> build/release.x64/musl/src/ctype/iswctype.o: In function `__wctype_l':
>> /home/netto/osv-dirty/musl/src/ctype/iswctype.c:71: multiple definition
>> of `__wctype_l'
>> build/release.x64/libc/locale/wctype_l.o:/home/netto/osv-dirty/libc/locale/wctype_l.c:5:
>> first defined here
>> build/release.x64/musl/src/ctype/toupper.o: In function `toupper':
>> /home/netto/osv-dirty/musl/src/ctype/toupper.c:6: multiple definition of
>> `__toupper_l'
>> build/release.x64/libc/locale/toupper_l.o:/home/netto/osv-dirty/libc/locale/toupper_l.c:6:
>> first defined here
>> build/release.x64/musl/src/ctype/towctrans.o: In function `__towupper_l':
>> /home/netto/osv-dirty/musl/src/ctype/towctrans.c:269: multiple
>> definition of `__towupper_l'
>> build/release.x64/libc/locale/towupper_l.o:/home/netto/osv-d
>> irty/libc/locale/towupper_l.c:5: first defined here
>> build/release.x64/musl/src/ctype/towctrans.o: In function `__towlower_l':
>> /home/netto/osv-dirty/musl/src/ctype/towctrans.c:274: multiple
>> definition of `__towlower_l'
>> build/release.x64/libc/locale/towlower_l.o:/home/netto/osv-d
>> irty/libc/locale/towlower_l.c:5: first defined here
>> build/release.x64/core/elf.o: In function `elf::file::load_elf_header()':
>> /home/netto/osv-dirty/core/elf.cc:236: undefined reference to `strerror'
>>
>
> These and similar errors suggest that something happened to the header
> file which strerror.
>  is supposed to define strerror()  and indeed
> include/api/string.h define it... Maybe it no longer does in your version?
> Did you notice that include/api/ includes symbolic links to musl's header
> files? Did you remember to fix those appropriately?
>
>
>> build/release.x64/core/trace.o: In function `trace_out::t

[PATCH 4/4] core/elf.cc: export libcrypt.so.1

2018-02-24 Thread geraldo netto
Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 core/elf.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/elf.cc b/core/elf.cc
index 2a46633..96754d5 100644
--- a/core/elf.cc
+++ b/core/elf.cc
@@ -1052,6 +1052,7 @@ program::program(void* addr)
   "ld-linux-x86-64.so.2",
   "libboost_system.so.1.55.0",
   "libboost_program_options.so.1.55.0",
+  "libcrypt.so.1",
 #endif /* __x86_64__ */
 #ifdef __aarch64__
   "ld-linux-aarch64.so.1",
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 2/4] modules/tests/Makefile: add unit test for crypt functions

2018-02-24 Thread geraldo netto
Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 modules/tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/tests/Makefile b/modules/tests/Makefile
index b8348dd..3398e4a 100644
--- a/modules/tests/Makefile
+++ b/modules/tests/Makefile
@@ -87,7 +87,7 @@ tests := tst-pthread.so misc-ramdisk.so tst-vblk.so 
tst-bsd-evh.so \
tst-ifaddrs.so tst-pthread-affinity-inherit.so tst-sem-timed-wait.so \
tst-ttyname.so tst-pthread-barrier.so tst-feexcept.so tst-math.so \
tst-sigaltstack.so tst-fread.so tst-tcp-cork.so tst-tcp-v6.so \
-   tst-calloc.so
+   tst-calloc.so tst-crypt.so
 
 #  libstatic-thread-variable.so tst-static-thread-variable.so \
 
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 1/4] tst-crypt: add test for crypt functions

2018-02-24 Thread geraldo netto
the tests include encrypt()

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 tests/tst-crypt.c | 71 +++
 1 file changed, 71 insertions(+)
 create mode 100644 tests/tst-crypt.c

diff --git a/tests/tst-crypt.c b/tests/tst-crypt.c
new file mode 100644
index 000..919d4e5
--- /dev/null
+++ b/tests/tst-crypt.c
@@ -0,0 +1,71 @@
+#define _XOPEN_SOURCE
+#include 
+#include 
+#include 
+
+char* concat_str(char* first_block, char* second_block) {
+   static char tmp[10];
+   memset(tmp, 0, sizeof(tmp));
+   strncat(tmp, first_block, sizeof(first_block));
+   strncat(tmp, second_block, sizeof(second_block));
+   return tmp;
+}
+
+int main(void) {
+   // http://man7.org/linux/man-pages/man3/crypt.3.html
+char password[] = "Ab(d3";
+   char salt[] = "201802221723";
+   char result1[] = "20338EPKt5xtY";
+   char result2[] = "$1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.";
+   char result3[] = "$5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0";
+   char result4[] = 
"$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1";
+
+   // 20338EPKt5xtY
+if (strcmp(result1, crypt(password, salt)) != 0) return -1;
+
+   // $1$Ab(d3$.SgUCw1AqIVAiXBaS6kzU.
+   if (strcmp(result2, crypt(password, concat_str((char*) "$1$", 
password))) != 0) return -2;
+
+   // gnu libc extension
+   //if (strcmp((null), crypt(password, concat_str((char*) "$2$", 
password return -7;
+   //if (strcmp((null), crypt(password, concat_str((char*) "$2a", 
password return -8;
+
+   // $5$Ab(d3$00nkgDrj2dM68IbqFTZPJ.a3mgai49mY.Ezq5ey0xY0
+   if (strcmp(result3, crypt(password, concat_str((char*) "$5$", 
password))) != 0) return -3;
+
+   // 
$6$Ab(d3$TB6UIPV7sprvpcQh2esPr2/ye4FTp9lLft8yAj.2x/HcTXPwzGDxdK/tIF10DdVdV9Z2hhc3MaosUBS3fdueZ1
+   if (strcmp(result4, crypt(password, concat_str((char*) "$6$", 
password))) !=0) return -4;
+
+   // encrypt
+   // http://man7.org/linux/man-pages/man3/encrypt.3.html
+   char key[64];
+   char buf[64];
+   char txt[9];
+   int i, j;
+
+   for (i = 0; i < 8; i++) {
+   for (j = 0; j < 8; j++) {
+   buf[i * 8 + j] = password[i] >> j & 1;
+   }
+   setkey(key);
+   }
+
+   encrypt(buf, 0);
+   for (i = 0; i < 8; i++) {
+   for (j = 0, txt[i] = '\0'; j < 8; j++) {
+   txt[i] |= buf[i * 8 + j] << j;
+   }
+   txt[8] = '\0';
+   }
+   if (strcmp(password, txt) == 0) return -5;
+
+   encrypt(buf, 1);
+   for (i = 0; i < 8; i++) {
+   for (j = 0, txt[i] = '\0'; j < 8; j++) {
+   txt[i] |= buf[i * 8 + j] << j;
+   }
+   txt[8] = '\0';
+   }
+
+   return (strcmp(password, txt) == 0) ? 0 : -6;
+}
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 3/4] Makefile: add crypt tests

2018-02-24 Thread geraldo netto
Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 80a1137..a3038f2 100644
--- a/Makefile
+++ b/Makefile
@@ -1735,12 +1735,13 @@ musl += fenv/fenv.o
 endif
 
 musl += crypt/crypt_blowfish.o
-musl += crypt/crypt.o
 musl += crypt/crypt_des.o
 musl += crypt/crypt_md5.o
-musl += crypt/crypt_r.o
 musl += crypt/crypt_sha256.o
 musl += crypt/crypt_sha512.o
+musl += crypt/crypt.o
+musl += crypt/crypt_r.o
+musl += crypt/encrypt.o
 
 #include $(src)/fs/build.mk:
 
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 0/4] add crypt functions

2018-02-24 Thread geraldo netto
because musl has its own git repository i had to create this other set of 
patches
this is the second part of the patches related to the crypt functions from musl 
1.1.18
basically it adds the unit test itself and the references so makefile can build 
it


geraldo netto (4):
  tst-crypt: add test for crypt functions
  modules/tests/Makefile: add unit test for crypt functions
  Makefile: add crypt tests
  core/elf.cc: export libcrypt.so.1

 Makefile   |  5 ++--
 core/elf.cc|  1 +
 modules/tests/Makefile |  2 +-
 tests/tst-crypt.c  | 71 ++
 4 files changed, 76 insertions(+), 3 deletions(-)
 create mode 100644 tests/tst-crypt.c

-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] mysql: fix path separator

2018-02-24 Thread geraldo netto
fix path separator that way manifest_common.py does not fail when building mysql

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 mysql/GET | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mysql/GET b/mysql/GET
index 0f6b2c9..edc033e 100755
--- a/mysql/GET
+++ b/mysql/GET
@@ -40,9 +40,9 @@ $(cat CMakeFiles/mysqld.dir/link.txt) -shared
 cd $BASEDIR
 
 echo "
-/etc/**:${ROOTDIR}/etc/**
-/usr/share/**:${ROOTDIR}/usr/share/**
-/usr/lib/**:${ROOTDIR}/usr/lib/**
-/usr/data/**:${ROOTDIR}/usr/data/**
-/usr/bin/mysqld:${BUILDDIR}/sql/mysqld
+/etc/**: ${ROOTDIR}/etc/**
+/usr/share/**: ${ROOTDIR}/usr/share/**
+/usr/lib/**: ${ROOTDIR}/usr/lib/**
+/usr/data/**: ${ROOTDIR}/usr/data/**
+/usr/bin/mysqld: ${BUILDDIR}/sql/mysqld
 " > usr.manifest
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] musl-crypt: update crypt functions to musl 1.1.18

2018-02-24 Thread geraldo netto
update crypt functions to musl 1.1.18
this includes encrypt()

Signed-off-by: geraldo netto <geraldone...@gmail.com>
---
 src/crypt/crypt_des.c| 12 +-
 src/crypt/crypt_sha256.c |  2 +-
 src/crypt/crypt_sha512.c |  2 +-
 src/crypt/encrypt.c  | 60 
 4 files changed, 68 insertions(+), 8 deletions(-)
 create mode 100644 src/crypt/encrypt.c

diff --git a/src/crypt/crypt_des.c b/src/crypt/crypt_des.c
index dc95dca..d5766a7 100644
--- a/src/crypt/crypt_des.c
+++ b/src/crypt/crypt_des.c
@@ -692,7 +692,7 @@ static uint32_t setup_salt(uint32_t salt)
return saltbits;
 }
 
-static void des_setkey(const unsigned char *key, struct expanded_key *ekey)
+void __des_setkey(const unsigned char *key, struct expanded_key *ekey)
 {
uint32_t k0, k1, rawkey0, rawkey1;
unsigned int shifts, round, i, ibit;
@@ -753,7 +753,7 @@ static void des_setkey(const unsigned char *key, struct 
expanded_key *ekey)
 /*
  * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format.
  */
-static void do_des(uint32_t l_in, uint32_t r_in,
+void __do_des(uint32_t l_in, uint32_t r_in,
 uint32_t *l_out, uint32_t *r_out,
 uint32_t count, uint32_t saltbits, const struct expanded_key *ekey)
 {
@@ -862,7 +862,7 @@ static void des_cipher(const unsigned char *in, unsigned 
char *out,
((uint32_t)in[5] << 16) |
((uint32_t)in[4] << 24);
 
-   do_des(rawl, rawr, _out, _out, count, saltbits, ekey);
+   __do_des(rawl, rawr, _out, _out, count, saltbits, ekey);
 
out[0] = l_out >> 24;
out[1] = l_out >> 16;
@@ -894,7 +894,7 @@ static char *_crypt_extended_r_uut(const char *_key, const 
char *_setting, char
if (*key)
key++;
}
-   des_setkey(keybuf, );
+   __des_setkey(keybuf, );
 
if (*setting == _PASSWORD_EFMT1) {
/*
@@ -929,7 +929,7 @@ static char *_crypt_extended_r_uut(const char *_key, const 
char *_setting, char
q = keybuf;
while (q <= [sizeof(keybuf) - 1] && *key)
*q++ ^= *key++ << 1;
-   des_setkey(keybuf, );
+   __des_setkey(keybuf, );
}
 
memcpy(output, setting, 9);
@@ -957,7 +957,7 @@ static char *_crypt_extended_r_uut(const char *_key, const 
char *_setting, char
/*
 * Do it.
 */
-   do_des(0, 0, , , count, setup_salt(salt), );
+   __do_des(0, 0, , , count, setup_salt(salt), );
 
/*
 * Now encode the result...
diff --git a/src/crypt/crypt_sha256.c b/src/crypt/crypt_sha256.c
index d5f0b78..e885dc6 100644
--- a/src/crypt/crypt_sha256.c
+++ b/src/crypt/crypt_sha256.c
@@ -230,7 +230,7 @@ static char *sha256crypt(const char *key, const char 
*setting, char *output)
if (u < ROUNDS_MIN)
r = ROUNDS_MIN;
else if (u > ROUNDS_MAX)
-   r = ROUNDS_MAX;
+   return 0;
else
r = u;
/* needed when rounds is zero prefixed or out of bounds */
diff --git a/src/crypt/crypt_sha512.c b/src/crypt/crypt_sha512.c
index 1294e98..39970ca 100644
--- a/src/crypt/crypt_sha512.c
+++ b/src/crypt/crypt_sha512.c
@@ -252,7 +252,7 @@ static char *sha512crypt(const char *key, const char 
*setting, char *output)
if (u < ROUNDS_MIN)
r = ROUNDS_MIN;
else if (u > ROUNDS_MAX)
-   r = ROUNDS_MAX;
+   return 0;
else
r = u;
/* needed when rounds is zero prefixed or out of bounds */
diff --git a/src/crypt/encrypt.c b/src/crypt/encrypt.c
new file mode 100644
index 000..9332a6d
--- /dev/null
+++ b/src/crypt/encrypt.c
@@ -0,0 +1,60 @@
+#include 
+#include 
+#include 
+
+struct expanded_key {
+uint32_t l[16], r[16];
+};
+
+void __des_setkey(const unsigned char *key, struct expanded_key *ekey);
+void __do_des(uint32_t l_in, uint32_t r_in,
+uint32_t *l_out, uint32_t *r_out,
+uint32_t count, uint32_t saltbits, const struct expanded_key *ekey);
+
+
+static struct expanded_key __encrypt_key;
+
+void setkey(const char *key)
+{
+   unsigned char bkey[8];
+   int i, j;
+
+   for (i = 0; i < 8; i++) {
+   bkey[i] = 0;
+   for (j = 7; j >= 0; j--, key++)
+   bkey[i] |= (uint32_t)(*key & 1) << j;
+   }
+
+   __des_setkey(bkey, &__encrypt_key);
+}
+
+void encrypt(char *block, int edflag)
+{
+   struct expanded_key decrypt_key, *key;
+   uint32_t b[2];
+   int i, j;
+   char *p;
+
+   p = block;
+   for (i = 0; i < 2; i++) {
+   b[i] = 0;
+   for (j = 31; j >= 0; j--, p++)
+ 

Re: [PATCH 27/56] node/GET: use wget -c

2018-02-22 Thread Geraldo Netto
Hello Waldek/Friends,

Don't mind, I'll review those patches too!
Must say, I'm trying big things first because it sounds more exciting :)


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 18 February 2018 at 00:09, Waldek Kozaczuk <jwkozac...@gmail.com> wrote:

> Cannot apply this patch:
>
> Applying: node/GET: use wget -c
> error: patch failed: node/GET:10
> error: node/GET: patch does not apply
> Patch failed at 0001 node/GET: use wget -c
> The copy of the patch that failed is found in:
> /home/wkozaczuk/projects/osv/.git/modules/apps/rebase-apply/patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
>
>
> On Tuesday, January 16, 2018 at 2:44:35 PM UTC-5, Geraldo Netto wrote:
>>
>> Signed-off-by: geraldo netto <gerald...@gmail.com>
>> ---
>>  node/GET | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/node/GET b/node/GET
>> index 79a3b27..142ae4f 100755
>> --- a/node/GET
>> +++ b/node/GET
>> @@ -10,6 +10,6 @@ then
>>exit 1
>>  fi
>>
>> -wget "https://github.com/nodejs/node/archive/v${1}.tar.gz; -O - | tar
>> zxf -
>> +wget -c "https://github.com/nodejs/node/archive/v${1}.tar.gz; -O - |
>> tar zxf -
>>
>>  ./patch "$1"
>> --
>> 2.7.4
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >