Re: libc blocking functions/with_libc inside thread

2017-06-29 Thread Martijn Verschoor
Hi, Christian, thanks a lot for your speedy refactoring of the OpenVPN port to run the OpenVPN code in the main thread. The OpenVPN code no longer blocks on opening a socket and now tries to setup a VPN connection with the configured server. Unfortunately we are now stumbling upon two new probl

Re: libc blocking functions/with_libc inside thread

2017-06-26 Thread Christian Helmuth
Hello Boris, On Mon, Jun 26, 2017 at 02:46:08PM +0200, Boris Mulder wrote: > Actually the OpenVPN code hangs once it calls the libc socket() > function. Internally, this function calls a blocking write(), and this > write() is handled by Libc::Kernel. thanks to your provided test case and the hin

Re: libc blocking functions/with_libc inside thread

2017-06-26 Thread Boris Mulder
Hello Christian, Actually the OpenVPN code hangs once it calls the libc socket() function. Internally, this function calls a blocking write(), and this write() is handled by Libc::Kernel. So openVPN does not send or receive any packet yet as it is blocked at socket(). Earlier, we have used lwip

Re: libc blocking functions/with_libc inside thread

2017-06-26 Thread Christian Helmuth
Hello Boris, On Fri, Jun 23, 2017 at 03:59:53PM +0200, Boris Mulder wrote: > The entrypoint creates the root component, spawns the thread and > returns. It will then handle RPC requests, as entrypoints do IIRC. > > The program acts as a server (serving Nic sessions asynchronously) and > as a clie

Re: libc blocking functions/with_libc inside thread

2017-06-23 Thread Boris Mulder
The entrypoint creates the root component, spawns the thread and returns. It will then handle RPC requests, as entrypoints do IIRC. The program acts as a server (serving Nic sessions asynchronously) and as a client to lxip vfs with libc. the code can be found in [1]. How can I have the entrypoint

Re: libc blocking functions/with_libc inside thread

2017-06-23 Thread Christian Helmuth
Hey, On Fri, Jun 23, 2017 at 03:21:28PM +0200, Boris Mulder wrote: > Basically if I do not use with_libc, the call to socket() will hang > forever inside the first read() call to the socket file. So, which code does your initial entrypoint execute? As I wrote before, the initial entrypoint is res

Re: libc blocking functions/with_libc inside thread

2017-06-23 Thread Boris Mulder
Hello, > How does socket() fail if you do not wrap the call with with_libc()? > I'd expect the thread to open a socket_fs file and maybe block for the > I/O operation to complete. Also, is there any reason to use a > Genode::Thread which uses POSIX interfaces only (beside the admittedly > more con

Re: libc blocking functions/with_libc inside thread

2017-06-23 Thread Boris Mulder
Hello, > How does socket() fail if you do not wrap the call with with_libc()? > I'd expect the thread to open a socket_fs file and maybe block for the > I/O operation to complete. Also, is there any reason to use a > Genode::Thread which uses POSIX interfaces only (beside the admittedly > more con

Re: libc blocking functions/with_libc inside thread

2017-06-23 Thread Christian Helmuth
Hello Boris, On Fri, Jun 23, 2017 at 02:24:01PM +0200, Boris Mulder wrote: > However, sockets in lxip require the use of the with_libc() function. > When I put this around the openvpn_main() call it gives me the error: > > Error: void Libc::Kernel::run(Libc::Application_code&) called from > non-k