https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412018-04-10T13:05:47Zlighty labsLighttpd - Feature #2883: fdevent_init should check if SOCK_NONBLOCK workshttps://redmine.lighttpd.net/issues/2883?journal_id=114172018-04-10T13:05:47Zgstrauss
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Feature</i></li><li><strong>Target version</strong> changed from <i>1.4.50</i> to <i>1.4.x</i></li></ul><blockquote>
<p>for some reason SOCK_NONBLOCK is ignored when passed to socket but an error isn't returned.</p>
</blockquote>
<p>That's pretty ridiculous and arguably a bug in that version of Android or the custom ROM 3.8.13.28-digetx-thor-t72-android</p>
<p>SOCK_CLOEXEC and SOCK_NONBLOCK were added in the later part of the 2.6 kernel series. There are comments in fdevent.c which refer to <a class="external" href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529929">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529929</a> and note that SOCK_CLOEXEC might not work in kernels prior to 2.6.27.</p>
<p>I'll look into adding some checks in lighttpd, but don't like the idea of lighttpd having to validate many different types of operating system behavior at startup. Have you filed a bug for that version of Android? lighttpd is probably not the only application affected by this.</p> Lighttpd - Feature #2883: fdevent_init should check if SOCK_NONBLOCK workshttps://redmine.lighttpd.net/issues/2883?journal_id=114192018-04-11T03:14:51Zstaples1347
<ul></ul><p>Yes it is ridiculous and I already figured it is a bug on the tablet as the kernel version is high enough to support SOCK_NONBLOCK, but this tablet and others like it might not be getting any more system updates (I mainly use it to make sure our project still works with old Android devices). I haven't yet posted a bug report to Android I am going to check if Google's Android Emulators also have the bug first, the reason why I only just noticed this issue is I've been updating the build system that we use for the project that the company I work for is working on and the previous Android NDK we were using didn't define SOCK_CLOEXEC or SOCK_NONBLOCK when targeting older Android versions.</p>
<p>My main reason for filing the bug in lighttpd though was that other Android or even non-Android or non-Linux systems may be affected where a user compiles the latest lighttpd on a dev system that defines SOCK_NONBLOCK, but the system they deploy to has this issue but for whatever reason they are unable to update their operating system/libraries, and since lighttpd already had some checks for SOCK_CLOEXEC it seemed like adding additonal checks as per the test program would be fairly straight forward.</p> Lighttpd - Feature #2883: fdevent_init should check if SOCK_NONBLOCK workshttps://redmine.lighttpd.net/issues/2883?journal_id=114202018-04-11T05:21:23Zgstrauss
<ul></ul><blockquote>
<p>where a user compiles the latest lighttpd on a dev system that defines SOCK_NONBLOCK, but the system they deploy to has this issue</p>
</blockquote>
<p>It is often unwise to compile and build on a system with libraries newer than the target systems to which it will be deployed. If your cross-compilation environment provides the definitions for SOCK_NONBLOCK, then it is reasonable to assume that the target system will be running kernels that support SOCK_NONBLOCK or that the system libraries will properly return an error, e.g EINVAL for the unsupported flag.</p>
<p>.</p>
<p>I have posted a preliminary patch to my personal/gstrauss/master branch. See <a class="wiki-page" href="https://redmine.lighttpd.net/projects/lighttpd/wiki/DevelGit">DevelGit</a></p> Lighttpd - Feature #2883: fdevent_init should check if SOCK_NONBLOCK workshttps://redmine.lighttpd.net/issues/2883?journal_id=114212018-04-13T00:56:39Zstaples1347
<ul></ul><p>It looks like that patch has fixed the problem on my tablet. Thanks. I have also tested various Android versions with Android Emulator and they don't appear to have the problem.</p> Lighttpd - Feature #2883: fdevent_init should check if SOCK_NONBLOCK workshttps://redmine.lighttpd.net/issues/2883?journal_id=114222018-04-15T02:30:10Zgstrauss
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Patch Pending</i></li><li><strong>Target version</strong> changed from <i>1.4.x</i> to <i>1.4.50</i></li></ul> Lighttpd - Feature #2883: fdevent_init should check if SOCK_NONBLOCK workshttps://redmine.lighttpd.net/issues/2883?journal_id=114962018-08-12T19:20:07Zgstrauss
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Fixed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="[core] check if SOCK_NONBLOCK is ignored (fixes #2883) x-ref: "fdevent_init should check if SO..." href="https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/78024584bb9fc549a654bdd72a81d1d6fac9b64e">78024584bb9fc549a654bdd72a81d1d6fac9b64e</a>.</p>