Hello Johannes, The message "libc suspend() called from non-user context" indicates that you are using POSIX I/O from the initial Libc::Component 'kernel' context, and not the 'user' context. To switch to a user context, supply user level code as a lambda to the 'Libc::with_libc(...)' function. Looking at your code I see that this would likly just be a lamba to wrap the construction of Sntp::Main and a lambda of the body of the Rtc::current_time() RPC method. One example of with_libc in user can be found in genode/repos/gems/src/server/tcp_terminal/main.cc.
Cheers, Emery On Tue, 6 Feb 2018 23:19:16 +0100 Johannes Kliemann <kliem...@componolit.com> wrote: > Hi all, > > when I use the lwip networking I sometimes get the following error: > > > Error: libc suspend() called from non-user context (0x117549a) - > > aborting > > I have tracked it down to a call of getaddrinfo yet I could not find > out when exactly and why this happens. It occurs at ca. 50% of the > tries. Does anyone have an idea how to fix that? > > Also is there a way to check if an IP is available? Sleeping a few > seconds and hoping that DHCP assigned an address does not seem a > reliable solution to me. > > The full code is available at [1], [2] and [3] while the error happens > in [3] at line 24. > To test it yourself, check out [4] and run `make run/sntp`. > > Regards, > Johannes > > [1]: > https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/main.cc > [2]: > https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/client.h > [3]: > https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/client.cc > [4]: https://github.com/jklmnn/genode-world/tree/sntp/src/server/sntp > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > genode-main mailing list > genode-main@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/genode-main
pgpJ0STZi81oK.pgp
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main